fixed behaviour of start=... for {counter}

This commit is contained in:
messju
2003-06-03 13:22:41 +00:00
parent 8ea24a3a20
commit ced3cf376e
2 changed files with 15 additions and 18 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- fixed behaviour of start=... for {counter} (messju)
- fixed assign for {counter} (messju)
- added params vdir, hdir and inner to html_table to allow looping
over the data in various directions (messju)

View File

@@ -36,44 +36,40 @@ function smarty_function_counter($params, &$smarty)
$counters[$name] = array(
'start'=>1,
'skip'=>1,
'assign'=>null,
'direction'=>'up'
'direction'=>'up',
'count'=>1
);
}
$counter =& $counters[$name];
if (isset($start))
$counter['start'] = $start;
else if (!isset($counter['start']))
$counter['start'] = 1;
if (!isset($counter['count']))
$counter['count'] = $counter['start'];
if (isset($start)) {
$counter['start'] = $counter['count'] = $start;
}
if (!empty($assign)) {
$counter['assign'] = $assign;
}
if (!empty($counter['assign'])) {
if (isset($counter['assign'])) {
$smarty->assign($counter['assign'], $counter['count']);
}
if (!isset($print))
$print = empty($counter['assign']);
else
if (isset($print)) {
$print = (bool)$print;
if (isset($skip)) {
$counter['skip'] = $skip;
} else {
$print = empty($counter['assign']);
}
if ($print) {
$retval = $counter['count'];
} else {
$retval = null;
}
if (isset($skip)) {
$counter['skip'] = $skip;
}
if (isset($direction)) {
$counter['direction'] = $direction;
}