Show
Ignore:
Timestamp:
04/16/08 10:50:21 (19 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.mttags.php

    r1174 r1926  
    77 
    88function smarty_block_mttags($args, $content, &$ctx, &$repeat) { 
    9     $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count', 'all_tag_count', 'include_blogs', 'exclude_blogs', 'blog_ids'); 
     9  $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count', 'all_tag_count', 'include_blogs', 'exclude_blogs', 'blog_ids', '__out'); 
    1010    if (!isset($content)) { 
    1111        $ctx->localize($localvars); 
     
    5454        $ctx->stash('all_tag_count', $all_count); 
    5555        $ctx->stash('_tags', $tags); 
     56        $ctx->stash('__out', false); 
    5657        $counter = 0; 
    5758    } else { 
    5859        $tags = $ctx->stash('_tags'); 
    5960        $counter = $ctx->stash('_tags_counter'); 
     61        $out = $ctx->stash('__out'); 
    6062    } 
    6163 
     
    6567        $ctx->stash('_tags_counter', $counter + 1); 
    6668        $repeat = true; 
    67         if (($counter > 0) && isset($args['glue'])) { 
    68             $content = $content . $args['glue']; 
     69        if (isset($args['glue'])) { 
     70            if ($out && !empty($content)) 
     71                $content = $args['glue'] . $content; 
     72            if (!$out && !empty($content)) 
     73              $ctx->stash('__out', true); 
    6974        } 
    7075    } else { 
     76        if (isset($args['glue'])) { 
     77            if ($out && !empty($content)) 
     78                $content = $args['glue'] . $content; 
     79        } 
    7180        $ctx->restore($localvars); 
    7281        $repeat = false;