public function uptoOffDynamic($upto = '~', $off = '/', $less = '-', $more = '+', $all = null, $glue = ' ', $args = null) { $argDefaults = array('upto' => '~', 'off' => '/', 'less' => '-', 'more' => '+', 'all' => null, 'glue' => ' '); $argNames = array_keys($argDefaults); $args = \MUtil_Ra::args(func_get_args(), $argNames, $argDefaults); foreach ($argNames as $name) { ${$name} = $args[$name]; unset($args[$name]); } $seq = new \MUtil_Html_Sequence(); $seq->setGlue($glue); if (null !== $upto) { $seq->if($this->pages->totalItemCount, $this->pages->firstItemNumber, 0); $seq[] = $upto; } if (null !== $less) { $cless = $this->toLazy()->getItemCountLess(); $seq[] = $this->createCountLink($cless, $cless, (array) $less + $args); } if (null !== $upto) { $seq[] = $this->pages->lastItemNumber; } if (null !== $more) { $cmore = $this->toLazy()->getItemCountMore(); $seq[] = $this->createCountLink($cmore, $cmore, (array) $more + $args); } if (null !== $all) { $seq[] = $this->createCountLink($this->toLazy()->getItemCountNotMax(), $this->toLazy()->getItemCountMax(), (array) $all + $args); } if (null !== $off) { if (null !== $upto) { $seq[] = $off; } $seq[] = $this->pages->totalItemCount; } return $seq; }