Changeset 1926 for branches/release-35/php/lib/block.mtparentcategories.php
- Timestamp:
- 04/16/08 10:50:21 (20 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/release-35/php/lib/block.mtparentcategories.php
r1800 r1926 21 21 22 22 function smarty_block_mtparentcategories($args, $content, &$ctx, &$repeat) { 23 $localvars = array('_categories', 'category', '_categories_counter','glue' );23 $localvars = array('_categories', 'category', '_categories_counter','glue', '__out'); 24 24 if (!isset($content)) { 25 25 $ctx->localize($localvars); … … 39 39 $ctx->stash('_categories', $parents); 40 40 $ctx->stash('glue', $glue); 41 $ctx->stash('__out', false); 41 42 $counter = 0; 42 43 } else { … … 44 45 $counter = $ctx->stash('_categories_counter'); 45 46 $glue = $ctx->stash('glue'); 47 $out = $ctx->stash('__out'); 46 48 } 47 49 … … 50 52 $ctx->stash('_categories_counter', $counter + 1); 51 53 $repeat = true; 54 if (!empty($glue) && !empty($content)) { 55 if ($out) 56 $content = $glue . $content; 57 else 58 $ctx->stash('__out', true); 59 } 52 60 } else { 61 if (!empty($glue) && $out && !empty($content)) 62 $content = $glue . $content; 53 63 $repeat = false; 54 64 $glue = ''; 55 65 $ctx->restore($localvars); 56 66 } 57 return $content .$glue;67 return $content; 58 68 } 59 69 ?>
