当前位置: 首页>>代码示例>>PHP>>正文


PHP pager_load_array函数代码示例

本文整理汇总了PHP中pager_load_array函数的典型用法代码示例。如果您正苦于以下问题:PHP pager_load_array函数的具体用法?PHP pager_load_array怎么用?PHP pager_load_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pager_load_array函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bootstrap_psdpt_pager_link

/**
 * Overrides theme_pager().
 */
function bootstrap_psdpt_pager_link($variables)
{
    $text = $variables['text'];
    $page_new = $variables['page_new'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    $attributes = $variables['attributes'];
    $page = isset($_GET['page']) ? $_GET['page'] : '';
    if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
        $parameters['page'] = $new_page;
    }
    $query = array();
    if (count($parameters)) {
        $query = drupal_get_query_parameters($parameters, array());
    }
    if ($query_pager = pager_get_query_parameters()) {
        $query = array_merge($query, $query_pager);
    }
    // Set each pager link title
    if (!isset($attributes['title'])) {
        static $titles = NULL;
        if (!isset($titles)) {
            $titles = array(t('« first') => t('Go to first page'), t('‹ previous') => t('Go to previous page'), t('next ›') => t('Go to next page'), t('last »') => t('Go to last page'));
        }
        if (isset($titles[$text])) {
            $attributes['title'] = $titles[$text];
        } elseif (is_numeric($text)) {
            $attributes['title'] = t('Go to page @number', array('@number' => $text));
        }
    }
    // @todo l() cannot be used here, since it adds an 'active' class based on the
    //   path only (which is always the current path for pager links). Apparently,
    //   none of the pager links is active at any time - but it should still be
    //   possible to use l() here.
    // @see http://drupal.org/node/1410574
    $attributes['href'] = url($_GET['q'], array('query' => $query));
    $text = filter_xss($text, array('span', 'em', 'strong'));
    return '<a' . drupal_attributes($attributes) . '>' . $text . '</a>';
}
开发者ID:atssc-scdata,项目名称:bootstrap_psdpt,代码行数:42,代码来源:pager-link.func.php

示例2: macragecn_pager_link

function macragecn_pager_link($variables)
{
    $text = $variables['text'];
    $page_new = $variables['page_new'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    $attributes = $variables['attributes'];
    $page = isset($_GET['page']) ? $_GET['page'] : '';
    if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
        $parameters['page'] = $new_page;
    }
    $query = array();
    if (count($parameters)) {
        $query = drupal_get_query_parameters($parameters, array());
    }
    if ($query_pager = pager_get_query_parameters()) {
        $query = array_merge($query, $query_pager);
    }
    // Set each pager link title
    if (!isset($attributes['title'])) {
        static $titles = NULL;
        if (!isset($titles)) {
            $titles = array(t('« 第一 页') => t('前往首 页'), t('‹ 上一页') => t('前往上一 页'), t('下一页 ›') => t('前往下一页'), t('最后一 页 »') => t('前往尾 页'));
        }
        if (isset($titles[$text])) {
            $attributes['title'] = $titles[$text];
        } elseif (is_numeric($text)) {
            $attributes['title'] = t('前往第@number页', array('@number' => $text));
        }
    }
    // @todo l() cannot be used here, since it adds an 'active' class based on the
    //   path only (which is always the current path for pager links). Apparently,
    //   none of the pager links is active at any time - but it should still be
    //   possible to use l() here.
    // @see http://drupal.org/node/1410574
    $attributes['href'] = url($_GET['q'], array('query' => $query));
    return '<a' . drupal_attributes($attributes) . '>' . check_plain($text) . '</a>';
}
开发者ID:johnedelatorre,项目名称:fusion,代码行数:38,代码来源:template.php

示例3: agency_whitesite_pager_last__responsive

/**
 * Returns HTML for the "last page" link in query pager.
 */
function agency_whitesite_pager_last__responsive($variables)
{
    $text = $variables['text'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    global $pager_page_array, $pager_total;
    $output = '';
    $output = theme('pager_link__responsive', array('text' => $text, 'page_new' => pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters));
    return $output;
}
开发者ID:sz03,项目名称:dto_whitesite,代码行数:13,代码来源:template.php

示例4: tao_pager_link

/**
 * Return an array suitable for theme_links() rather than marked up HTML link.
 */
function tao_pager_link($text, $page_new, $element, $parameters = array(), $attributes = array())
{
    $page = isset($_GET['page']) ? $_GET['page'] : '';
    if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
        $parameters['page'] = $new_page;
    }
    $query = array();
    if (count($parameters)) {
        $query[] = drupal_query_string_encode($parameters, array());
    }
    $querystring = pager_get_querystring();
    if ($querystring != '') {
        $query[] = $querystring;
    }
    // Set each pager link title
    if (!isset($attributes['title'])) {
        static $titles = NULL;
        if (!isset($titles)) {
            $titles = array(t('« first') => t('Go to first page'), t('‹ previous') => t('Go to previous page'), t('next ›') => t('Go to next page'), t('last »') => t('Go to last page'));
        }
        if (isset($titles[$text])) {
            $attributes['title'] = $titles[$text];
        } else {
            if (is_numeric($text)) {
                $attributes['title'] = t('Go to page @number', array('@number' => $text));
            }
        }
    }
    return array('title' => $text, 'href' => $_GET['q'], 'attributes' => $attributes, 'query' => count($query) ? implode('&', $query) : NULL);
}
开发者ID:rmontero,项目名称:dla_ecommerce_site,代码行数:33,代码来源:template.php

示例5: alim_pager_link

function alim_pager_link($text, $page_new, $element, $parameters = array(), $attributes = array()) {
	//if(arg(0) == 'alimsearch' || arg(0) == 'search' ) changed
	//if(arg(0) == 'alimsearch' || (arg(0) == 'search' && arg(1) == 'node'  && arg(2) != ''  ))
		  if(arg(0) == 'single' && arg(1) == 'view' )
				$attributes['class'] = 'popups';
  $page = isset($_GET['page']) ? $_GET['page'] : '';
  if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
    $parameters['page'] = $new_page;
  }

  $query = array();
  if (count($parameters)) {
    $query[] = drupal_query_string_encode($parameters, array());
  }
  $querystring = pager_get_querystring();
  if ($querystring != '') {
    $query[] = $querystring;
  }

  // Set each pager link title
  if (!isset($attributes['title'])) {
    static $titles = NULL;
    if (!isset($titles)) {
      $titles = array(
        t('« first') => t('Go to first page'),
        t('‹ previous') => t('Go to previous page'),
        t('next ›') => t('Go to next page'),
        t('last »') => t('Go to last page'),
      );
    }
    if (isset($titles[$text])) {
      $attributes['title'] = $titles[$text];
    }
    else if (is_numeric($text)) {
      $attributes['title'] = t('Go to page @number', array('@number' => $text));
    }
  }

  return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => count($query) ? implode('&', $query) : NULL));
}
开发者ID:ATouhou,项目名称:www.alim.org,代码行数:40,代码来源:template.php

示例6: stability_pager_link

function stability_pager_link($variables)
{
    $text = $variables['text'];
    $page_new = $variables['page_new'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    $attributes = $variables['attributes'];
    $page = isset($_GET['page']) ? $_GET['page'] : '';
    if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
        $parameters['page'] = $new_page;
    }
    $query = array();
    if (count($parameters)) {
        $query = drupal_get_query_parameters($parameters, array());
    }
    if ($query_pager = pager_get_query_parameters()) {
        $query = array_merge($query, $query_pager);
    }
    // Set each pager link title
    if (!isset($attributes['title'])) {
        static $titles = NULL;
        if (!isset($titles)) {
            $titles = array(t('« first') => t('Go to first page'), t('‹ previous') => t('Go to previous page'), t('next ›') => t('Go to next page'), t('last »') => t('Go to last page'));
        }
        if (isset($titles[$text])) {
            $attributes['title'] = $titles[$text];
        } elseif (is_numeric($text)) {
            $attributes['title'] = t('Go to page @number', array('@number' => $text));
        }
    }
    $replace_titles = array(t('‹ previous') => '«', t('next ›') => '»');
    $text = isset($replace_titles[$text]) ? $replace_titles[$text] : $text;
    if (!theme_get_setting('pager') || theme_get_setting('pager') == 1) {
        $attributes['class'] = array('btn', 'btn-sm', 'btn-default');
    }
    $attributes['href'] = url($_GET['q'], array('query' => $query));
    return '<a' . drupal_attributes($attributes) . '>' . check_plain($text) . '</a>';
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:38,代码来源:template.php

示例7: progressive_sub_pager_link

function progressive_sub_pager_link($variables)
{
    $text = $variables['text'];
    $page_new = $variables['page_new'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    $attributes = $variables['attributes'];
    $page = isset($_GET['page']) ? $_GET['page'] : '';
    if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
        $parameters['page'] = $new_page;
    }
    $query = array();
    if (count($parameters)) {
        $query = drupal_get_query_parameters($parameters, array());
    }
    if ($query_pager = pager_get_query_parameters()) {
        $query = array_merge($query, $query_pager);
    }
    // Set each pager link title
    if (!isset($attributes['title'])) {
        static $titles = NULL;
        if (!isset($titles)) {
            $titles = array(t('«') => t('Go to first page'), t('‹') => t('Go to previous page'), t('›') => t('Go to next page'), t('»') => t('Go to last page'));
        }
        if (isset($titles[$text])) {
            $attributes['title'] = $titles[$text];
        } elseif (is_numeric($text)) {
            $attributes['title'] = t('Go to page @number', array('@number' => $text));
        }
    }
    $replace_titles = array(t('« first') => '<i class="fa fa-angle-double-left"></i>', t('‹ previous') => '<i class="fa fa-angle-left"></i>', t('next ›') => '<i class="fa fa-angle-right"></i>', t('last »') => '<i class="fa fa-angle-double-right"></i>');
    $text = isset($replace_titles[$text]) ? $replace_titles[$text] : check_plain($text);
    $attributes['href'] = url($_GET['q'], array('query' => $query));
    return '<a' . drupal_attributes($attributes) . '>' . $text . '</a>';
}
开发者ID:ivanvincent,项目名称:imsv_fe,代码行数:35,代码来源:template.php

示例8: tao_pager_link

/**
 * Return an array suitable for theme_links() rather than marked up HTML link.
 */
function tao_pager_link($vars) {
  $text = $vars['text'];
  $page_new = $vars['page_new'];
  $element = $vars['element'];
  $parameters = $vars['parameters'];
  $attributes = $vars['attributes'];

  $page = isset($_GET['page']) ? $_GET['page'] : '';
  if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
    $parameters['page'] = $new_page;
  }

  $query = array();
  if (count($parameters)) {
    $query = drupal_get_query_parameters($parameters, array());
  }
  if ($query_pager = pager_get_query_parameters()) {
    $query = array_merge($query, $query_pager);
  }

  // Set each pager link title
  if (!isset($attributes['title'])) {
    static $titles = NULL;
    if (!isset($titles)) {
      $titles = array(
        t('« first') => t('Go to first page'),
        t('‹ previous') => t('Go to previous page'),
        t('next ›') => t('Go to next page'),
        t('last »') => t('Go to last page'),
      );
    }
    if (isset($titles[$text])) {
      $attributes['title'] = $titles[$text];
    }
    else if (is_numeric($text)) {
      $attributes['title'] = t('Go to page @number', array('@number' => $text));
    }
  }

  return array(
    'title' => $text,
    'href' => $_GET['q'],
    'attributes' => $attributes,
    'query' => count($query) ? $query : NULL,
  );
}
开发者ID:Jobsity,项目名称:pricetaghqpromotional,代码行数:49,代码来源:template.php

示例9: europa_pager_last

/**
 * Implements theme_pager_last().
 */
function europa_pager_last($variables)
{
    $text = $variables['text'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    $attributes = isset($variables['attributes']) ? $variables['attributes'] : array();
    global $pager_page_array, $pager_total;
    $output = '';
    // If we are anywhere but the last page.
    if ($pager_page_array[$element] < $pager_total[$element] - 1) {
        $output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters, 'attributes' => $attributes));
    }
    return $output;
}
开发者ID:ec-europa,项目名称:platform-theme,代码行数:17,代码来源:template.php

示例10: spanjestrijders_pager_last

function spanjestrijders_pager_last($variables)
{
    $text = $variables['text'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    global $pager_page_array, $pager_total;
    $output = '';
    // If we are anywhere but the last page
    if ($pager_page_array[$element] < $pager_total[$element] - 1) {
        $output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters));
    } else {
        $output = theme('image', array('path' => path_to_theme() . '/images/last-nolink.png', 'alt' => t('Last')));
    }
    return $output;
}
开发者ID:IISH,项目名称:drupal-theme-spanjestrijders,代码行数:15,代码来源:template.php

示例11: busy_pager_link

/**
 * Format pager link.
 */
function busy_pager_link($variables)
{
    $text = $variables['text'];
    $page_new = $variables['page_new'];
    $element = $variables['element'];
    $parameters = $variables['parameters'];
    $wrap_title = isset($parameters['wrap']) ? $parameters['wrap'] : FALSE;
    $attributes = $variables['attributes'];
    unset($parameters['wrap']);
    $page = isset($_GET['page']) ? $_GET['page'] : '';
    if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
        $parameters['page'] = $new_page;
    }
    $query = array();
    if (count($parameters)) {
        $query = drupal_get_query_parameters($parameters, array());
    }
    if ($query_pager = pager_get_query_parameters()) {
        $query = array_merge($query, $query_pager);
    }
    // Set each pager link title
    if (!isset($attributes['title'])) {
        static $titles = NULL;
        if (!isset($titles)) {
            $titles = array(t('« first') => t('Go to first page'), t('‹ previous') => t('Go to previous page'), t('next ›') => t('Go to next page'), t('last »') => t('Go to last page'));
        }
        if (isset($titles[$text])) {
            $attributes['title'] = $titles[$text];
        } elseif (is_numeric($text)) {
            $attributes['title'] = t('Go to page @number', array('@number' => $text));
        }
    }
    if ($wrap_title) {
        $text = '<span>' . $text . '</span>';
    }
    return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => $query, 'html' => $wrap_title));
}
开发者ID:justinepocock,项目名称:by-justine,代码行数:40,代码来源:template.php


注:本文中的pager_load_array函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。