Changeset 2774:65395d6bf0a5
- Timestamp:
- 11/10/14 15:46:31 (11 years ago)
- Branch:
- default
- Location:
- inc/public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/public/class.dc.template.php
r2666 r2774 432 432 $length = isset($attr['length']) ? (integer) $attr['length'] : 'null'; 433 433 $even = isset($attr['even']) ? (integer) (boolean) $attr['even'] : 'null'; 434 $modulo = isset($attr['modulo']) ? (integer) $attr['modulo'] : 'null'; 434 435 435 436 if ($start > 0) { … … 438 439 439 440 return 440 '<?php if ($_ctx->loopPosition('.$start.','.$length.','.$even.' )) : ?>'.441 '<?php if ($_ctx->loopPosition('.$start.','.$length.','.$even.','.$modulo.')) : ?>'. 441 442 $content. 442 443 "<?php endif; ?>"; -
inc/public/lib.tpl.context.php
r2676 r2774 59 59 60 60 # Loop position tests 61 public function loopPosition($start,$length=null,$even=null )61 public function loopPosition($start,$length=null,$even=null,$modulo=null) 62 62 { 63 63 if (!$this->cur_loop) { … … 94 94 if ($even !== null) { 95 95 $test = $test && $index%2 == $even; 96 } 97 98 if ($modulo !== null) { 99 $test = $test && ($index % $modulo == 0); 96 100 } 97 101
Note: See TracChangeset
for help on using the changeset viewer.