本文整理汇总了PHP中Phpfox_Pager::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox_Pager::instance方法的具体用法?PHP Phpfox_Pager::instance怎么用?PHP Phpfox_Pager::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox_Pager
的用法示例。
在下文中一共展示了Phpfox_Pager::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Controller
*/
public function process()
{
if ($iId = $this->request()->getInt('view')) {
if ($sRedirect = Phpfox::getService('report')->getRedirect($iId)) {
$this->url()->forward($sRedirect);
}
}
if ($aIds = $this->request()->getArray('id')) {
if ($this->request()->get('ignore')) {
foreach ($aIds as $iId) {
if (!is_numeric($iId)) {
continue;
}
Phpfox::getService('report.data.process')->ignore($iId);
}
$this->url()->send('admincp.report', null, Phpfox::getPhrase('report.report_s_successfully_ignored'));
}
}
$iPage = $this->request()->getInt('page');
$aPages = array(5, 10, 15, 20);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
$aSorts = array('added' => Phpfox::getPhrase('core.time'));
$aFilters = array('search' => array('type' => 'input:text', 'search' => "AND c.name LIKE '%[VALUE]%'"), 'user' => array('type' => 'input:text', 'search' => "AND u.user_name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '10'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'added', 'alias' => 'rd'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
$oSearch = Phpfox_Search::instance()->set(array('type' => 'reports', 'filters' => $aFilters, 'search' => 'search'));
$iLimit = $oSearch->getDisplay();
list($iCnt, $aReports) = Phpfox::getService('report')->get($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
$this->template()->setTitle(Phpfox::getPhrase('report.reports'))->setBreadcrumb(Phpfox::getPhrase('report.reports'), $this->url()->makeUrl('admincp.report'))->assign(array('aReports' => $aReports));
}
示例2: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
if ($iInvite = $this->request()->getInt('del')) {
$bDel = Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
if ($bDel) {
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
}
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
} elseif ($aInvite = $this->request()->get('val')) {
$bDel = true;
foreach ($aInvite as $iInvite) {
$bDel = $bDel && Phpfox::getService('invite.process')->delete($iInvite, Phpfox::getUserId());
}
if ($bDel) {
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_deleted'));
}
$this->url()->send('invite.invitations', null, Phpfox::getPhrase('invite.invitation_not_found'));
}
$iPage = $this->request()->getInt('page');
$iPageSize = (int) Phpfox::getParam('invite.pendings_to_show_per_page');
list($iCnt, $aInvites) = Phpfox::getService('invite')->get(Phpfox::getUserId(), $iPage, $iPageSize);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
$this->setParam('global_moderation', array('name' => 'invitations', 'ajax' => 'invite.moderation', 'menu' => array(array('phrase' => 'Delete', 'action' => 'delete'))));
$this->template()->setTitle(Phpfox::getPhrase('invite.pending_invitations'))->setBreadcrumb(Phpfox::getPhrase('invite.pending_invitations'))->assign(array('aInvites' => $aInvites, 'iPage' => $iPage))->setHeader('cache', array('pager.css' => 'style_css', 'pending.js' => 'module_invite'));
}
示例3: process
/**
* Controller
*/
public function process()
{
Phpfox::getUserParam('comment.can_moderate_comments', true);
$iPage = $this->request()->getInt('page');
$aPages = array(20, 30, 40, 50);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
$aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'cmt'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
$oSearch = Phpfox_Search::instance()->set(array('type' => 'comments', 'filters' => $aFilters, 'search' => 'search'));
if ($this->request()->get('view') == 'approval') {
$oSearch->setCondition('AND cmt.view_id = 1');
} else {
$oSearch->setCondition('AND cmt.view_id = 9');
}
list($iCnt, $aComments) = Phpfox::getService('comment')->get('cmt.*', $oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay(), null, true);
foreach ($aComments as $iKey => $aComment) {
if (Phpfox::hasCallback($aComment['type_id'], 'getItemName')) {
$aComments[$iKey]['item_name'] = Phpfox::callback($aComment['type_id'] . '.getItemName', $aComment['comment_id'], $aComment['owner_full_name']);
}
}
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
$this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aComments' => $aComments, 'bIsCommentAdminPanel' => true));
}
示例4: process
/**
* Controller
*/
public function process()
{
($sPlugin = Phpfox_Plugin::get('ad.component_controller_admincp_process__start')) ? eval($sPlugin) : false;
$iPage = $this->request()->getInt('page');
if ($iId = $this->request()->getInt('approve')) {
if (Phpfox::getService('ad.process')->approve($iId)) {
$this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_successfully_approved'));
}
}
if ($iId = $this->request()->getInt('deny')) {
if (Phpfox::getService('ad.process')->deny($iId)) {
$this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_successfully_denied'));
}
}
if ($iId = $this->request()->getInt('delete')) {
if (Phpfox::getService('ad.process')->delete($iId)) {
$this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_successfully_deleted'));
}
}
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('ad.process')->updateActivity($aVals)) {
$this->url()->send('admincp.ad', null, Phpfox::getPhrase('ad.ad_s_successfully_updated'));
}
}
$aPages = array(5, 10, 15, 20);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
$aSorts = array('ad_id' => Phpfox::getPhrase('ad.recently_added'));
$aFilters = array('status' => array('type' => 'select', 'options' => array('1' => Phpfox::getPhrase('ad.pending_approval'), '2' => Phpfox::getPhrase('ad.pending_payment'), '4' => Phpfox::getPhrase('ad.denied')), 'add_any' => true), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '10'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'ad_id'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
$oSearch = Phpfox_Search::instance()->set(array('type' => 'campaigns', 'filters' => $aFilters, 'search' => 'search'));
$sStatus = $oSearch->get('status');
$sView = $this->request()->get('view');
$iLocation = $this->request()->getInt('location');
if ($sStatus == '1') {
$oSearch->setCondition('is_custom = 2');
} elseif ($sStatus == '2') {
$oSearch->setCondition('is_custom = 1');
} elseif ($sStatus == '4') {
$oSearch->setCondition('is_custom = 4');
} else {
switch ($sView) {
case 'pending':
$oSearch->setCondition('is_custom = 2');
break;
default:
// $oSearch->setCondition('is_custom IN(0,2,3)');
break;
}
}
if ($iLocation > 0) {
$oSearch->setCondition('AND location = ' . (int) $iLocation);
}
$iLimit = $oSearch->getDisplay();
list($iCnt, $aAds) = Ad_Service_Ad::instance()->get($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
$this->template()->setTitle(Phpfox::getPhrase('ad.manage_ad_campaigns'))->setBreadcrumb(Phpfox::getPhrase('ad.manage_ad_campaigns'), $this->url()->makeUrl('admincp.ad'))->assign(array('aAds' => $aAds, 'iPendingCount' => (int) Ad_Service_Ad::instance()->getPendingCount(), 'sPendingLink' => Phpfox_Url::instance()->makeUrl('admincp.ad', array('view' => 'pending')), 'bIsSearch' => $this->request()->get('search-id') ? true : false, 'sView' => $sView));
($sPlugin = Phpfox_Plugin::get('ad.component_controller_admincp_process__end')) ? eval($sPlugin) : false;
}
示例5: process
/**
* Controller
*/
public function process()
{
$aCond = array();
$iPage = $this->request()->getInt('page');
$iPageSize = 10;
$bIsSentbox = $this->request()->get('req2') == 'sent' ? true : false;
$bIsSearch = false;
if ($bIsSentbox) {
$aCond[] = 'm.owner_user_id = ' . Phpfox::getUserId() . ' AND m.owner_type_id = 0';
} else {
$aCond[] = 'm.viewer_folder_id = 0 AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 0';
}
if (($sSearch = $this->request()->get('search')) || $this->request()->get('search-query')) {
if ($this->request()->get('search-query')) {
$sSearch = Phpfox::getLib('session')->get('mfsearch');
}
$bIsSearch = true;
$aCond[] = "AND (m.subject LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%' OR m.preview LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%')";
$this->url()->setParam('search-query', 'true');
Phpfox::getLib('session')->set('mfsearch', $sSearch);
}
if ($bIsSearch == false) {
Phpfox::getLib('session')->remove('mfsearch');
}
list($iCnt, $aMessages, $aInputs) = Mail_Service_Mail::instance()->get($aCond, 'm.time_updated DESC', $iPage, $iPageSize, $bIsSentbox);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
$this->template()->assign(array('bMobileInboxIsActive' => true, 'aMessages' => $aMessages, 'bIsSearch' => $bIsSearch, 'bIsSentbox' => $bIsSentbox, 'aMobileSubMenus' => array($this->url()->makeUrl('mail') => Phpfox::getPhrase('mail.mobile_messages'), $this->url()->makeUrl('mail', 'sent') => Phpfox::getPhrase('mail.sent'), $this->url()->makeUrl('mail', 'compose') => Phpfox::getPhrase('mail.compose')), 'sActiveMobileSubMenu' => $this->url()->makeUrl('mail', $this->request()->get('req2') == '' ? null : $this->request()->get('req2'))));
}
示例6: process
/**
* Controller
*/
public function process()
{
$aParam = $this->getParam('rss');
$aLogs = Phpfox::getService('rss.log')->get($aParam);
$sNames = '';
$sCounts = '';
$iMaxLogDisplay = 5;
$iCnt = 0;
$iOtherCount = 0;
foreach ($aLogs as $aLog) {
$iCnt++;
if ($iCnt <= $iMaxLogDisplay) {
$sNames .= $aLog['user_agent_chart'] . '|';
$sCounts .= $aLog['total_agent_count'] . ',';
} else {
$iOtherCount += $aLog['total_agent_count'];
}
}
if ($iOtherCount > 0) {
$sNames .= Phpfox::getPhrase('rss.other') . '|';
$sCounts .= $iOtherCount . ',';
}
$aUsers = array();
if (isset($aParam['users'])) {
list($iCnt, $aUsers) = Phpfox::getService('rss.log')->getUsers($aParam, $this->request()->get('page'), 20);
Phpfox_Pager::instance()->set(array('page' => $this->request()->get('page'), 'size' => 20, 'count' => $iCnt));
}
$this->template()->assign(array('sNames' => rtrim($sNames, '|'), 'sCounts' => rtrim($sCounts, ','), 'aLogs' => $aLogs, 'aUsers' => $aUsers));
}
示例7: process
/**
* Controller
*/
public function process()
{
return Phpfox_Error::display('This section has been depreciated');
Phpfox::getUserParam('comment.can_moderate_comments', true);
if ($aIds = $this->request()->getArray('id')) {
if ($this->request()->get('approve')) {
foreach ($aIds as $iId) {
Phpfox::getService('feed.process')->approve($iId);
}
$this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_approved'));
} else {
foreach ($aIds as $iId) {
Phpfox::getService('feed.process')->deleteFeed($iId);
}
$this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_deleted'));
}
}
$iPage = $this->request()->getInt('page');
$aPages = array(20, 30, 40, 50);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
$aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'feed'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
$oSearch = Phpfox_Search::instance()->set(array('type' => 'feeds', 'filters' => $aFilters, 'search' => 'search'));
$oSearch->setCondition('AND feed.view_id = 1');
list($iCnt, $aFeeds) = Feed_Service_Feed::instance()->getForBrowse($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay());
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
$this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aFeeds' => $aFeeds, 'bIsCommentAdminPanel' => true));
}
示例8: process
/**
* Controller
*/
public function process()
{
$iRsvp = $this->request()->get('rsvp', 1);
$iPage = $this->request()->getInt('page');
$sModule = $this->request()->get('module', false);
$iItem = $this->request()->getInt('item', false);
$aCallback = $this->getParam('aCallback', false);
$iPageSize = 6;
if (PHPFOX_IS_AJAX) {
$aCallback = false;
if ($sModule && $iItem && Phpfox::hasCallback($sModule, 'getEventInvites')) {
$aCallback = Phpfox::callback($sModule . '.getEventInvites', $iItem);
}
$aEvent = Event_Service_Event::instance()->callback($aCallback)->getEvent($this->request()->get('id'), true);
$this->template()->assign('aEvent', $aEvent);
} else {
$aEvent = $this->getParam('aEvent');
$this->template()->assign('aEvent', $aEvent);
}
if ($aCallback !== false) {
$sModule = $aCallback['module'];
$iItem = $aCallback['item'];
}
list($iCnt, $aInvites) = Event_Service_Event::instance()->getInvites($aEvent['event_id'], $iRsvp, $iPage, $iPageSize);
Phpfox_Pager::instance()->set(array('ajax' => 'event.listGuests', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'aParams' => array('id' => $aEvent['event_id'], 'module' => $sModule, 'item' => $iItem, 'rsvp' => $iRsvp)));
$this->template()->assign(array('aInvites' => $aInvites, 'iRsvp' => $iRsvp));
if (!PHPFOX_IS_AJAX) {
$sExtra = '';
if ($aCallback !== false) {
$sExtra .= '&module=' . $aCallback['module'] . '&item=' . $aCallback['item'];
}
$this->template()->assign(array('sHeader' => '', 'aMenu' => array(Phpfox::getPhrase('event.attending') => '#event.listGuests?rsvp=1&id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.maybe') => '#event.listGuests?rsvp=2&id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.can_t_make_it') => '#event.listGuests?rsvp=3&id=' . $aEvent['event_id'] . $sExtra, Phpfox::getPhrase('event.not_responded') => '#event.listGuests?rsvp=0&id=' . $aEvent['event_id'] . $sExtra), 'sBoxJsId' => 'event_guests'));
return 'block';
}
}
示例9: process
/**
* Controller
*/
public function process()
{
$iPage = $this->getParam('sPage');
$iPageSize = 10;
list($iCnt, $aItems) = Phpfox::getService('attachment')->get(array("attachment.user_id = " . Phpfox::getUserId() . ""), 'attachment.time_stamp DESC', $iPage, $iPageSize);
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'attachment.browse'));
$aUser = Phpfox::getService('user')->get(Phpfox::getUserId(), true);
$this->template()->assign(array('aItems' => $aItems, 'sUrlPath' => Phpfox::getParam('core.url_attachment'), 'sThumbPath' => Phpfox::getParam('core.url_thumb'), 'sUsage' => $aUser['space_total'], 'bCanUseInline' => false, 'sAttachmentInput' => $this->request()->get('input')));
}
示例10: process
/**
* Controller
*/
public function process()
{
$iPage = $this->request()->getInt('page');
$iPageSize = 5;
$aCond = array();
$aCond[] = 'AND friend.user_id = ' . Phpfox::getUserId();
list($iCnt, $aFriends) = Friend_Service_Friend::instance()->get($aCond, 'friend.time_stamp DESC', $iPage, $iPageSize, true, false, false, $this->request()->getInt('user_id'));
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'friend.getMutualFriends'));
$this->template()->assign(array('aFriends' => $aFriends, 'iPage' => $iPage));
}
示例11: process
/**
* Controller
*/
public function process()
{
$iRsvp = $this->request()->get('rsvp', 1);
$iPage = $this->request()->getInt('page');
$iPageSize = 20;
$aEvent = Event_Service_Event::instance()->getEvent($this->request()->get('id'), true);
list($iCnt, $aInvites) = Event_Service_Event::instance()->getInvites($aEvent['event_id'], $iRsvp, $iPage, $iPageSize);
Phpfox_Pager::instance()->set(array('ajax' => 'event.browseList', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'aParams' => array('id' => $aEvent['event_id'], 'rsvp' => $iRsvp)));
$aLists = array(Phpfox::getPhrase('event.attending') => '1', Phpfox::getPhrase('event.maybe_attending') => '2', Phpfox::getPhrase('event.awaiting_reply') => '0', Phpfox::getPhrase('event.not_attending') => '3');
$this->template()->assign(array('aEvent' => $aEvent, 'aInvites' => $aInvites, 'bIsInBrowse' => $iPage > 0 ? true : false, 'aLists' => $aLists));
}
示例12: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
$iPage = $this->request()->getInt('page');
$iPageSize = 6;
$aConditions = array();
$aConditions[] = 'AND p.user_id = ' . Phpfox::getUserId();
list($iCnt, $aPhotos) = Phpfox::getService('photo')->get($aConditions, 'p.time_stamp DESC', $iPage, $iPageSize);
// Set the pager for the photos
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'photo.getForAttachment'));
$this->template()->assign(array('aPhotos' => $aPhotos, 'iCurrentPage' => $iPage, 'sAttachmentObjId' => $this->request()->get('obj-id'), 'sAttachmentInput' => $this->request()->get('input'), 'sCategoryId' => $this->request()->get('category'), 'sIsAttachmentInline' => $this->request()->get('attachment-inline')));
}
示例13: process
/**
* Controller
*/
public function process()
{
$iPage = $this->getParam('page', 0);
$iPageSize = 9;
$oDb = Phpfox_Database::instance();
$aConditions = array();
if ($sFind = $this->getParam('find')) {
$aConditions[] = 'AND (u.user_name LIKE \'%' . $oDb->escape($sFind) . '%\' OR u.full_name LIKE \'%' . $oDb->escape($sFind) . '%\' OR u.email LIKE \'%' . $oDb->escape($sFind) . '%\')';
}
list($iCnt, $aUsers) = Phpfox::getService('user.browse')->conditions($aConditions)->page($iPage)->limit($iPageSize)->sort('u.last_login DESC')->get();
Phpfox_Pager::instance()->set(array('ajax' => 'user.browseAjax', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
$this->template()->assign(array('aUsers' => $aUsers, 'sPrivacyInputName' => $this->getParam('input'), 'bIsAjaxSearch' => $this->getParam('is_search', false)));
}
示例14: process
/**
* Controller
*/
public function process()
{
// Get the current page. Zero if it's the first page
$iPage = $this->getParam('page', 1);
// Get the amount of pages to be shown by page
$iPageSize = 15;
// get the total pages, and the pages
list($iTotal, $aPages) = Phpfox::getService('pages')->getMyLoginPages($iPage, $iPageSize);
if ($iTotal > $iPageSize) {
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iTotal));
}
$this->template()->assign(array('aPages' => $aPages, 'sLink' => $this->url()->makeUrl('pages.add'), 'iCurrentPage' => $iPage, 'iTotalPages' => $iTotal / $iPageSize + 1, 'iTotal' => $iTotal));
}
示例15: process
/**
* Controller
*/
public function process()
{
$iPage = $this->request()->getInt('page');
$aPages = array(20, 30, 40, 50);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
$aFilters = array('search' => array('type' => 'input:text', 'search' => "ANDal.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('admincp.login_time_stamp'), 'ip_address ' => Phpfox::getPhrase('admincp.ip_address')), 'default' => 'time_stamp', 'alias' => 'al'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
$oSearch = Phpfox_Search::instance()->set(array('type' => 'onlineguests', 'filters' => $aFilters, 'search' => 'search'));
list($iCnt, $aUsers) = Phpfox::getService('core.admincp')->getAdminLogins($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay());
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
$this->template()->setTitle(Phpfox::getPhrase('admincp.admincp_logins'))->setBreadcrumb(Phpfox::getPhrase('admincp.admincp_logins'))->assign(array('aUsers' => $aUsers));
}