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

    r1174 r1926  
    77 
    88function smarty_block_mtassettags($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        $ctx->localize($localvars); 
     
    3232        if (!is_array($tags)) $tags = array(); 
    3333        $ctx->stash('_tags', $tags); 
     34        $ctx->stash('__out', false); 
    3435         
    3536        $counter = 0; 
     
    3738        $tags = $ctx->stash('_tags'); 
    3839        $counter = $ctx->stash('_tags_counter'); 
     40        $out = $ctx->stash('__out'); 
    3941    } 
    4042    if ($counter < count($tags)) { 
     
    4345        $ctx->stash('_tags_counter', $counter + 1); 
    4446        $repeat = true; 
    45         if (($counter > 0) && isset($args['glue'])) { 
    46             $content = $content . $args['glue']; 
     47        if (isset($args['glue']) && !empty($content)) { 
     48            if ($out) 
     49                $content = $args['glue'] . $content; 
     50            else 
     51                $ctx->stash('__out', true); 
    4752        } 
    4853    } else { 
     54        if (isset($args['glue']) && $out && !empty($content)) 
     55            $content = $args['glue'] . $content; 
    4956        $ctx->restore($localvars); 
    5057        $repeat = false;