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.mtentrytags.php

    r1174 r1926  
    77 
    88function smarty_block_mtentrytags($args, $content, &$ctx, &$repeat) { 
    9     $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count','all_tag_count'); 
     9    $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count','all_tag_count', '__out'); 
    1010    if (!isset($content)) { 
    1111        $class = 'entry'; 
     
    3737        if (!is_array($tags)) $tags = array(); 
    3838        $ctx->stash('_tags', $tags); 
     39        $ctx->stash('__out', false); 
    3940         
    4041        $counter = 0; 
     
    4243        $tags = $ctx->stash('_tags'); 
    4344        $counter = $ctx->stash('_tags_counter'); 
     45        $out = $ctx->stash('__out'); 
    4446    } 
    4547    if ($counter < count($tags)) { 
     
    4850        $ctx->stash('_tags_counter', $counter + 1); 
    4951        $repeat = true; 
    50         if (($counter > 0) && isset($args['glue'])) { 
    51             $content = $content . $args['glue']; 
     52        if (isset($args['glue']) && !empty($content)) { 
     53            if ($out) 
     54                $content = $args['glue']. $content; 
     55            else 
     56                $ctx->stash('__out', true); 
    5257        } 
    5358    } else { 
     59        if (isset($args['glue']) && $out && !empty($content)) 
     60            $content = $args['glue']. $content; 
    5461        $ctx->restore($localvars); 
    5562        $repeat = false;