*
* @var integer
*/
- protected $_ptr = -1;
+ protected $_ptr = 0;
/**
* Constructor.
);
if ($task instanceof Horde_LoginTasks_SystemTask) {
+ $this->_tasks[] = $tmp;
return;
}
*
* @param array $options Options:
* <pre>
- * 'advance' - (boolean) If true, mark ready tasks a completed.
+ * 'advance' - (boolean) If true, mark ready tasks as completed.
* 'runtasks' - (boolean) If true, run all tasks. If false, only run
* system tasks.
* </pre>
reset($this->_tasks);
while (list($k, $v) = each($this->_tasks)) {
- if ((empty($options['runtasks']) &&
- ($v['task'] instanceof Horde_LoginTasks_Task)) ||
- ($v['display'] && ($k > $this->_ptr))) {
+ if (($v['task'] instanceof Horde_LoginTasks_Task) &&
+ (empty($options['runtasks']) ||
+ ($v['display'] && ($k >= $this->_ptr)))) {
break;
}
$tmp[] = $v['task'];
}
if (!empty($options['advance'])) {
- $this->_tasks = array_slice($this->_tasks, $this->_ptr);
+ $this->_tasks = array_slice($this->_tasks, count($tmp) + $this->_ptr);
$this->_ptr = 0;
}