Show
Ignore:
Timestamp:
04/16/08 10:50:21 (20 months ago)
Author:
takayama
Message:

Fixed BugId:76389
* Loop tags does not add 'glue', if row in loop tag was empty

  • MTFor
  • MTLoop
  • MTTags
  • MTEntryTags
  • MTEntries
  • MTEntryCategories
  • MTCategories
  • MTEntryAdditionalCategories
  • MTParentCategories
  • MTAssetTags
  • MTPagerBlock
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-35/php/lib/block.mtentries.php

    r1335 r1926  
    77 
    88function smarty_block_mtentries($args, $content, &$ctx, &$repeat) { 
    9     $localvars = array('entry', '_entries_counter','entries','current_timestamp','modification_timestamp','_entries_lastn', 'current_timestamp_end', 'DateHeader', 'DateFooter', '_entries_glue', 'blog', 'blog_id', 'conditional', 'else_content'); 
     9    $localvars = array('entry', '_entries_counter','entries','current_timestamp','modification_timestamp','_entries_lastn', 'current_timestamp_end', 'DateHeader', 'DateFooter', '_entries_glue', 'blog', 'blog_id', 'conditional', 'else_content', '__out'); 
    1010    if (isset($args['sort_by']) && $args['sort_by'] == 'score' && !isset($args['namespace'])) { 
    1111        return $ctx->error($ctx->mt->translate('sort_by="score" must be used in combination with namespace.')); 
     
    2929        $lastn = $args['lastn']; 
    3030        $ctx->stash('_entries_lastn', $lastn); 
     31        $ctx->stash('__out', false); 
    3132    } else { 
    3233        $lastn = $ctx->stash('_entries_lastn'); 
    3334        $counter = $ctx->stash('_entries_counter'); 
     35        $out = $ctx->stash('__out'); 
    3436    } 
    3537    if (!isset($args['class'])) { 
     
    119121        $_REQUEST['entry_ids_published'][$entry['entry_id']] = 1; 
    120122        $glue = $ctx->stash('_entries_glue'); 
    121         if ($glue != '') $content = $content . $glue; 
     123        if (isset($glue) && !empty($content)) { 
     124            if ($out) 
     125                $content = $glue . $content; 
     126            else 
     127                $ctx->stash('__out', true); 
     128        } 
    122129        $repeat = true; 
    123130    } else { 
     131        $glue = $ctx->stash('_entries_glue'); 
     132        if (isset($glue) && $out && !empty($content)) 
     133            $content = $glue . $content; 
    124134        $ctx->restore($localvars); 
    125135        $repeat = false;