コード例 #1
0
 public function next($title = '›', $options = [], $disabledTitle = null, $disabledOptions = [])
 {
     $defaults = ['tag' => 'li'];
     $disabledOptions = ['class' => 'next disabled', 'tag' => 'li', 'disabledTag' => 'a'];
     $options = Hash::merge($defaults, $options);
     return parent::next($title, $options, $disabledTitle, $disabledOptions);
 }
コード例 #2
0
ファイル: MyPaginatorHelper.php プロジェクト: mathg/skinsound
 /**
  * Changes output for a Bootstrap-styled list item
  * @param string $title
  * @param array $options
  * @param null $disabledTitle
  * @param array $disabledOptions
  * @return mixed|string
  */
 public function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array())
 {
     $output = parent::next($title, $options, $disabledTitle, $disabledOptions);
     if (preg_match('/disabled/', $output)) {
         $output = preg_replace('/<li class="next disabled">(.*)<\\/li>/', '<li class="next disabled"><a href="#">$1</a></li>', $output);
     }
     return $output;
 }
コード例 #3
0
ファイル: r_paginator.php プロジェクト: radig/r_search
 /**
  * Prepara e retorna/imprime os controles de navegação
  *
  * O primeiro parâmetro corresponde a uma referência a classe PaginatorHelper
  * instanciada pelo controlador, enquanto o segundo parâmetro é um array com as opções
  * de saída.
  *
  *
  * @param PaginatorHelper $paginator
  * @param array $options Possui dois índices reconhecidos:
  *  - 'return' do tipo bool, se true faz o método retornar o resultado ao invés de imprimir.
  *  Valor padrão é false
  *  - 'filters' do tipo array que contém as condições para a paginação, acrescido de todos
  *  os parâmetros passados via url
  */
 public function controls(&$paginator, $options = array())
 {
     $this->_paginator =& $paginator;
     if (!empty($options['filters']) && is_array($options['filters'])) {
         $filters['url'] = array_merge($options['filters'], $this->params['pass']);
     } else {
         $filters['url'] = $this->params['pass'];
     }
     $options = Set::merge($filters, $this->_paginator->options);
     $this->_paginator->options($options);
     $out = $this->_paginator->first('<< ' . __d('r_search', 'first', true), array(), null, array('class' => 'disabled')) . $this->_paginator->prev(__d('r_search', 'previous', true), array(), null, array('class' => 'disabled')) . $this->_paginator->numbers(array('separator' => '')) . $this->_paginator->next(__d('r_search', 'next', true), array(), null, array('class' => 'disabled')) . $this->_paginator->last(__d('r_search', 'last', true) . ' >>', array(), null, array('class' => 'disabled'));
     if (isset($options['return']) && $options['return'] === true) {
         return $out;
     } else {
         echo $out;
     }
 }
コード例 #4
0
 public function next($title = null, $options = array(), $disabledTitle = null, $disabledOptions = array())
 {
     $default = array('title' => '>', 'tag' => 'li', 'model' => $this->defaultModel(), 'class' => null, 'disabled' => 'disabled');
     $options += $default;
     if (empty($title)) {
         $title = $options['title'];
     }
     unset($options['title']);
     $disabled = $options['disabled'];
     $params = (array) $this->params($options['model']);
     if ($disabled === 'hide' && !$params['nextPage']) {
         return null;
     }
     unset($options['disabled']);
     return parent::next($title, $options, $this->link($title), array_merge($options, array('escape' => false, 'class' => $disabled)));
 }
コード例 #5
0
 public function next($title = null, $options = array(), $disabledTitle = null, $disabledOptions = array())
 {
     $default = array('title' => '', 'tag' => 'li', 'model' => $this->defaultModel(), 'class' => 'next', 'disabled' => 'disabled');
     $options = array_merge($default, $options);
     if (empty($title)) {
         $title = $options['title'];
     }
     unset($options['title']);
     $disabled = $options['disabled'];
     $params = (array) $this->params($options['model']);
     if ($disabled === 'hide' && !$params['nextPage']) {
         return null;
     }
     unset($options['disabled']);
     $return = parent::next($title, $options, $this->link($title), array_merge($options, array('escape' => false, 'class' => 'next ' . $disabled)));
     return str_replace('href="', 'class="fui-arrow-right" href="', $return);
 }
コード例 #6
0
 function next($title = 'Next »', $options = array(), $disabledTitle = null, $disabledOptions = array())
 {
     $disabledOptions = array_merge($options, $disabledOptions);
     return parent::next($title, $options, $disabledTitle, $disabledOptions);
 }
 public function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array())
 {
     $options = array_merge(array('tag' => 'li'), $options);
     $disabledOptions = array_merge(array('tag' => 'li', 'disabledTag' => 'a', 'class' => 'disabled'), $disabledOptions);
     return parent::next($title, $options, $disabledTitle, $disabledOptions);
 }
コード例 #8
0
 public function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array())
 {
     $options = $this->_defaultOptions($options, false);
     return parent::next($title, $options, $this->link($title), $disabledOptions);
 }
コード例 #9
0
 /**
  * Get link to the next pagination page.
  * 
  * @param $title The link text
  * @param $options Options for link
  * @param $disabledtitle Title when link is disabled
  * @param $disabledOptions Options for link when it's disabled
  */
 public function next($title = '>', $options = [], $disabledTitle = null, $disabledOptions = [])
 {
     $options = array_merge(['tag' => 'li'], $options);
     $disabledOptions = array_merge(['tag' => 'li', 'class' => GA_DISABLED, 'disabledTag' => 'a'], $disabledOptions);
     return parent::next($title, $options, $disabledTitle, $disabledOptions);
 }
コード例 #10
0
 /**
  * 次へリンク
  * @param PaginatorHelper $paginator
  * @return string
  */
 private static function getPaginatorLinkNext(PaginatorHelper $paginator)
 {
     $title = __('次へ') . ' >';
     $options = array();
     $disabledTitle = null;
     $disabledOptions = array('class' => 'next disabled');
     return $paginator->next($title, $options, $disabledTitle, $disabledOptions);
 }