Changeset 1926 for branches/release-35/php/lib/block.mtloop.php
- Timestamp:
- 04/16/08 10:50:21 (20 months ago)
- Files:
-
- 1 modified
-
branches/release-35/php/lib/block.mtloop.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-35/php/lib/block.mtloop.php
r1174 r1926 7 7 8 8 function smarty_block_mtloop($args, $content, &$ctx, &$repeat) { 9 $localvars = array('__loop_keys', '__loop_values' );9 $localvars = array('__loop_keys', '__loop_values', '__out'); 10 10 11 11 if (!isset($content)) { … … 67 67 $counter = 1; 68 68 $ctx->stash('__loop_values', $value); 69 $ctx->stash('__out', false); 69 70 } 70 71 else { … … 72 73 $keys = $ctx->stash('__loop_keys'); 73 74 $value = $ctx->stash('__loop_values'); 75 $out = $ctx->stash('__out'); 74 76 if (!isset($keys) || $keys == 0) { 75 77 $ctx->restore($localvars); 76 78 $repeat = false; 79 if (isset($args['glue']) && $out && !empty($content)) 80 $content = $args['glue'] . $content; 77 81 return $content; 78 82 } … … 97 101 } 98 102 } 99 if (array_key_exists('glue', $args)) { 100 if (1 < $counter) 101 $content = $content . $args['glue']; 103 if (isset($args['glue']) && !empty($content)) { 104 if ($out) 105 $content = $args['glue'] . $content; 106 else 107 $ctx->stash('__out', true); 102 108 } 103 109 if ( 0 === count($keys) )
