本文整理汇总了PHP中Pager::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Pager::setData方法的具体用法?PHP Pager::setData怎么用?PHP Pager::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pager
的用法示例。
在下文中一共展示了Pager::setData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: template_simple
$results[$key]['url'] .= '?highlight=' . $enc;
}
}
loader_import('saf.GUI.Pager');
$pg = new Pager($cgi->offset, appconf('limit'));
if ($parameters['multiple'] == 'yes') {
$t = '';
if (is_array($parameters['ctype'])) {
foreach ($parameters['ctype'] as $ct) {
$t .= '&ctype[]=' . urlencode($ct);
}
}
$d = '';
if (is_array($parameters['domains'])) {
foreach ($parameters['domains'] as $ds) {
$d .= '&domains[]=' . $ds;
}
}
} else {
$t = '&ctype=' . urlencode($parameters['ctype']);
$d = '&domains=' . urlencode($parameters['domains']);
}
$pg->setUrl(site_current() . '?query=%s' . $t . $d . '&show_types=%s&multiple=%s&show_domains=%s', $enc, $parameters['show_types'], $parameters['multiple'], $parameters['show_domains']);
$pg->total = $total;
$pg->setData($results);
$pg->update();
page_id('search');
page_title('SiteSearch - Results For "' . $cgi->query . '"');
template_simple_register('cgi', $cgi);
template_simple_register('pager', $pg);
echo template_simple('stats_search.spt', array('show_types' => $show_types, 'show_domains' => $show_domains, 'types' => $types, 'domains' => $domains, 'multiple' => $multiple, 'syntax' => $res['metadata']['syntax']));
示例2: pretty_date
$pg = new Pager($cgi->offset, $limit);
$pg->url = site_current() . '?collection=' . urlencode($cgi->collection);
$res = $rex->getDeleted($limit, $cgi->offset, $acl);
if (!$res) {
$res = array();
$rex->total = 0;
}
$pg->total = $rex->total;
$res2 = array();
foreach ($res as $k => $v) {
$res2[$v->{$rex->key}] = $v;
}
function pretty_date($date)
{
loader_import('saf.Date');
return Date::timestamp($date, 'M j, Y - g:ia');
}
$pg->setData($res2);
$pg->update();
//page_title (intl_get ('Browsing') . ': ' . $rex->info['Collection']['display']);
$data['collection_name'] = $rex->info['Collection']['display'];
$data['title_field'] = $rex->info['Collection']['title_field'];
if (!session_allowed('approved', 'w', 'status')) {
$data['restore'] = false;
} else {
$data['restore'] = true;
}
echo template_simple(CMS_JS_ALERT_MESSAGE, $GLOBALS['cgi']);
echo loader_box('cms/nav');
template_simple_register('pager', $pg);
echo template_simple('deleted_items.spt', $data);
示例3: template_simple
// -->
</script>
<?php
echo template_simple('<p><a href="{site/prefix}/index/usradm-add-user-action?_list={cgi/list}">{intl Add User}</a> <a href="{site/prefix}/index/usradm-export-user-action">Export Users</a></p>');
$snm =& session_get_manager();
$users = $snm->user->getList($cgi->offset, $limit, $cgi->orderBy, $cgi->sort, $cgi->_role, $cgi->_team, $cgi->_lastname, $cgi->_disabled, $cgi->_public, $cgi->_teams);
if (!$users) {
//die ($snm->error);
$users = array();
}
$total = $snm->user->total;
loader_import('saf.GUI.Pager');
$pg = new Pager($cgi->offset, $limit, $total);
$pg->url = site_prefix() . '/index/usradm-browse-action?list=users&orderBy=' . urlencode($cgi->orderBy) . '&sort=' . urlencode($cgi->sort) . '&_role=' . urlencode($cgi->_role) . '&_team=' . urlencode($cgi->_team) . '&_lastname=' . urlencode($cgi->_lastname) . '&_disabled=' . urlencode($cgi->_disabled) . '&_public=' . urlencode($cgi->_public) . '&_teams=' . urlencode($cgi->_teams);
$pg->setData($users);
$pg->update();
loader_import('saf.Misc.TableHeader');
$headers = array(new TableHeader('username', intl_get('Username')), new TableHeader('lastname', intl_get('Name')), new TableHeader('disabled', intl_get('Disabled')), new TableHeader('role', intl_get('Role')), new TableHeader('team', intl_get('Team')));
loader_import('cms.Versioning.Rex');
loader_import('cms.Versioning.Facets');
$rex = new Rex(false);
$rex->bookmark = true;
$rex->facets['lastname'] = new rTextFacet('lastname', array('display' => intl_get('Name'), 'type' => 'text'));
$rex->facets['lastname']->preserve = array('list', 'offset', 'orderBy', 'sort');
$list = array_keys($snm->role->getList());
foreach ($list as $k => $v) {
if ($v == 'anonymous' || $v == '') {
unset($list[$k]);
}
}
示例4: die
$sql .= $join . 'user = ?';
$bind[] = $cgi->_user;
$join = ' and ';
}
$sql .= ' order by ' . $cgi->orderBy . ' ' . $cgi->sort;
$q = db_query($sql);
if (!$q->execute($bind)) {
die($q->error());
}
$total = $q->rows();
$res = $q->fetch($cgi->offset, $limit);
$q->free();
loader_import('saf.GUI.Pager');
$pg = new Pager($cgi->offset, $limit, $total);
$pg->url = site_prefix() . '/index/usradm-browse-action?list=log&orderBy=' . urlencode($cgi->orderBy) . '&sort=' . urlencode($cgi->sort) . '&_type=' . urlencode($cgi->_type) . '&_user=' . urlencode($cgi->_user) . '&_range=' . urlencode($cgi->_range);
$pg->setData($res);
$pg->update();
loader_import('saf.Misc.TableHeader');
$headers = array(new TableHeader('ts', intl_get('Date/Time')), new TableHeader('type', intl_get('Type')), new TableHeader('user', intl_get('User')), new TableHeader('ip', intl_get('IP Address')), new TableHeader('message', intl_get('Message')));
loader_import('cms.Versioning.Rex');
loader_import('cms.Versioning.Facets');
$rex = new Rex(false);
$rex->bookmark = true;
$rex->facets['type'] = new rSelectFacet('type', array('display' => intl_get('Type'), 'type' => 'select'));
$rex->facets['type']->preserve = array('list', 'offset', 'orderBy', 'sort');
$rex->facets['type']->options = assocify(db_shift_array('select distinct type from sitellite_log where type != "" order by type asc'));
$rex->facets['type']->count = false;
$rex->facets['user'] = new rSelectFacet('user', array('display' => intl_get('User'), 'type' => 'select'));
$rex->facets['user']->preserve = array('list', 'offset', 'orderBy', 'sort');
$rex->facets['user']->options = assocify(db_shift_array('select distinct user from sitellite_log where user != "" order by user asc'));
$rex->facets['user']->count = false;
示例5: pretty_date
$cgi->offset = 0;
}
$rex = new Rex($cgi->_collection);
// default: database, database
if (!$rex->collection) {
header('Location: ' . site_prefix() . '/index/cms-cpanel-action');
exit;
}
$pg = new Pager($cgi->offset, $limit);
$history = $rex->getHistory($cgi->_key, false, $limit, $cgi->offset);
if (!$history) {
$history = array();
//die ($rex->error);
}
$pg->total = $rex->total;
$pg->setData($history);
$pg->update();
function pretty_date($date)
{
loader_import('saf.Date');
return Date::timestamp($date, 'M j, Y - g:ia');
}
$cur = $rex->getCurrent($cgi->_key);
if (!$cur) {
$title = $cgi->_key;
} else {
$title = $cur->{$rex->info['Collection']['title_field']};
}
if (!session_allowed('approved', 'w', 'status')) {
//isset ($cur->sitellite_access) && ! session_allowed ($cur->sitellite_access, 'w', 'access')) {
$editable = false;