本文整理汇总了PHP中PageList类的典型用法代码示例。如果您正苦于以下问题:PHP PageList类的具体用法?PHP PageList怎么用?PHP PageList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
$result->AddGroup($this->RenderText('Default'));
if (GetCurrentUserGrantForDataSource('dbo.EtatConnexion')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.EtatConnexion'), 'dbo.EtatConnexion.php', $this->RenderText('Dbo.EtatConnexion'), $currentPageCaption == $this->RenderText('Dbo.EtatConnexion'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.EvenementSysteme')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.EvenementSysteme'), 'dbo.EvenementSysteme.php', $this->RenderText('Dbo.EvenementSysteme'), $currentPageCaption == $this->RenderText('Dbo.EvenementSysteme'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.InfosFichiers')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.InfosFichiers'), 'dbo.InfosFichiers.php', $this->RenderText('Dbo.InfosFichiers'), $currentPageCaption == $this->RenderText('Dbo.InfosFichiers'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.IPClients')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.IPClients'), 'dbo.IPClients.php', $this->RenderText('Dbo.IPClients'), $currentPageCaption == $this->RenderText('Dbo.IPClients'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.MachinesClientes')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.MachinesClientes'), 'dbo.MachinesClientes.php', $this->RenderText('Dbo.MachinesClientes'), $currentPageCaption == $this->RenderText('Dbo.MachinesClientes'), false, $this->RenderText('Default')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddGroup('Admin area');
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, false, 'Admin area'));
}
return $result;
}
示例2: populate
function populate()
{
$tickets = new TicketCollection(new Ticket());
$pl = new PageList('current_tickets');
$ticket_sh = new SearchHandler($tickets, false);
$ticket_sh->setLimit(10);
$ticket_sh->setOrderBy('created', 'ASC');
$user = new User();
$user->loadBy('username', EGS_USERNAME);
$ticket_sh->addConstraint(new Constraint('originator_person_id', '=', $user->username));
$ticket_sh->addConstraint(new Constraint('usercompanyid', '=', EGS_COMPANY_ID));
// Find open statuses
$statuses = new TicketStatusCollection(new TicketStatus());
$status_sh = new SearchHandler($statuses);
$status_sh->addConstraint(new Constraint('usercompanyid', '=', EGS_COMPANY_ID));
$status_sh->addConstraint(new Constraint('status_code', '=', 'NEW'), 'OR');
$status_sh->addConstraint(new Constraint('status_code', '=', 'OPEN'), 'OR');
$statuses->load($status_sh);
foreach ($statuses->getContents() as $status) {
$ticket_sh->addConstraint(new Constraint('client_ticket_status_id', '=', $status->id), 'OR');
}
$tickets->load($ticket_sh);
$pl->addFromCollection($tickets, array('module' => 'ticketing', 'controller' => 'tickets', 'action' => 'view'), array('id'), 'ticket', 'summary');
$this->contents = $pl->getPages()->toArray();
}
示例3: run
public function run()
{
$cfg = new Config();
$pNum = (int) $cfg->get('OLD_VERSION_JOB_PAGE_NUM');
$pNum = $pNum < 0 ? 1 : $pNum + 1;
$pl = new PageList();
$pl->setItemsPerPage(3);
/* probably want to keep a record of pages that have been gone through
* so you don't start from the beginning each time..
*/
$pages = $pl->getPage($pNum);
if (!count($pages)) {
$cfg->save('OLD_VERSION_JOB_PAGE_NUM', 0);
return t("All pages have been processed, starting from beginning on next run.");
}
$versionCount = 0;
$pagesAffected = array();
foreach ($pages as $page) {
if ($page instanceof Page) {
$pvl = new VersionList($page);
$pagesAffected[] = $page->getCollectionID();
foreach (array_slice(array_reverse($pvl->getVersionListArray()), 10) as $v) {
if ($v instanceof CollectionVersion && !$v->isApproved() && !$v->isMostRecent()) {
@$v->delete();
$versionCount++;
}
}
}
}
$pageCount = count($pagesAffected);
$cfg->save('OLD_VERSION_JOB_PAGE_NUM', $pNum);
//i18n: %1$d is the number of versions deleted, %2$d is the number of affected pages, %3$d is the number of times that the Remove Old Page Versions job has been executed.
return t2('%1$d versions deleted from %2$d page (%3$d)', '%1$d versions deleted from %2$d pages (%3$s)', $pageCount, $versionCount, $pageCount, implode(',', $pagesAffected));
}
示例4: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
if (GetCurrentUserGrantForDataSource('public.office_holder')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Office Holders'), 'public.office_holder.php', $this->RenderText('Office Holders'), $currentPageCaption == $this->RenderText('Office Holders')));
}
if (GetCurrentUserGrantForDataSource('public.office')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Offices'), 'public.office.php', $this->RenderText('Political Offices'), $currentPageCaption == $this->RenderText('Political Offices')));
}
if (GetCurrentUserGrantForDataSource('public.office_docs')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Office Filing Documents'), 'public.office_docs.php', $this->RenderText('Political Office Filing Documents'), $currentPageCaption == $this->RenderText('Political Office Filing Documents')));
}
if (GetCurrentUserGrantForDataSource('public.election_div')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Election Divisions'), 'public.election_div.php', $this->RenderText('Election Divisions'), $currentPageCaption == $this->RenderText('Election Divisions')));
}
if (GetCurrentUserGrantForDataSource('public.election_div_docs')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Election Division Filing Documents'), 'public.election_div_docs.php', $this->RenderText('Election Division Filing Documents'), $currentPageCaption == $this->RenderText('Election Division Filing Documents')));
}
if (GetCurrentUserGrantForDataSource('public.district')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Districts'), 'public.district.php', $this->RenderText('Political Districts'), $currentPageCaption == $this->RenderText('Political Districts')));
}
if (GetCurrentUserGrantForDataSource('public.office_position')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Office Positions'), 'public.office_position.php', $this->RenderText('Political Office Positions'), $currentPageCaption == $this->RenderText('Political Office Positions')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, true));
}
return $result;
}
示例5: form
public function form()
{
Loader::model('page_list');
$pl = new PageList();
$lastParent = '';
$selected = $_REQUEST['akID'][$this->getAttributeKey()->getAttributeKeyID()]['value'];
if (!$selected && $this->getAttributeValueID() > 0) {
$selected = $this->getValue()->cID;
}
$selectString = "<select id='{$this->field('value')}' name='{$this->field('value')}' ><option value=''>--</option>";
$pl->filterByCollectionTypeHandle('city');
$pages = $pl->get();
uasort($pages, function ($a, $b) {
$ap = $a->getCollectionParentID();
$bp = $b->getCollectionParentID();
return $ap === $bp ? 0 : strcmp(Page::getByID($ap)->getCollectionName(), Page::getByID($bp)->getCollectionName());
});
foreach ($pages as $page) {
$parent = Page::getByID($page->getCollectionParentID())->getCollectionName();
if ($lastParent != $parent) {
if ($lastParent !== '') {
$selectString .= '</optgroup>';
}
$selectString .= "<optgroup label='{$parent}'>";
$lastParent = $parent;
}
$selectedAttributeVal = '';
if ($selected === $page->cID) {
$selectedAttributeVal = ' selected="selected"';
}
$selectString .= "<option value=\"{$page->getCollectionID()}\"" . $selectedAttributeVal . ">{$page->getCollectionName()}</option>";
}
$selectString .= '</select>';
echo $selectString;
}
示例6: view
public function view()
{
parent::view();
$bg = $this->city->fullbg;
if ($bg) {
$this->bodyData['bg'] = $bg->getURL();
}
$this->bodyData['classes'][] = 'city-page';
$this->bodyData['pageViewName'] = 'CityPageView';
$this->set('bodyData', $this->bodyData);
$this->set('pageType', 'city-page');
$this->set('isCityOrganizer', (new User())->getUserID() === $this->city->cityOrganizer->getUserID());
$this->set('isLoggedIn', (bool) Loader::helper('concrete/dashboard')->canRead());
$this->set('isCampaignActive', false);
// Is the donations campaign running?
$this->set('canEdit', is_object(ComposerPage::getByID($this->c->getCollectionID())));
$this->set('city', $this->city);
// Make JSON available
$this->addToJanesWalk(['city' => $this->city]);
// Are there blog entries for this city?
$blog = new PageList();
$blog->filterByCollectionTypeHandle('city_blog');
$blog->filterByParentID($this->c->getCollectionID());
$this->set('blog', $blog->get(1)[0]);
}
示例7: run
public function run()
{
$js = Loader::helper('json');
$pl = new PageList();
$pl->filterByCollectionTypeHandle('city');
$pages = $pl->get();
$updated = 0;
$not = 0;
echo "Loading city coordinates.. \n";
foreach ($pages as $page) {
if (!trim($page->getAttribute('latlng')) || trim($page->getAttribute('latlng')) === ',') {
$parent = Page::getByID($page->getCollectionParentID());
$city = "{$page->getCollectionName()}, {$parent->getCollectionName()}";
$cityLocation = file_get_contents("https://maps.google.com/maps/api/geocode/json?address=" . urlencode($city) . "&sensor=false&key=AIzaSyAvsH_wiFHJCuMPPuVifJ7QgaRCStKTdZM");
$responseObj = $js->decode($cityLocation);
if ($responseObj->status != 'ZERO_RESULTS') {
$page->setAttribute('latlng', $responseObj->results[0]->geometry->location->lat . "," . $responseObj->results[0]->geometry->location->lng);
$updated++;
} else {
$not++;
}
}
}
return t("{$updated} cities geocoded, {$not} cities failed lookup.");
}
示例8: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
$result->AddGroup($this->RenderText('Maestras'));
$result->AddGroup($this->RenderText('Paramétricas'));
if (GetCurrentUserGrantForDataSource('public.sga_accion')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Acción (Espacio / Bien)'), 'accion.php', $this->RenderText('Acción'), $currentPageCaption == $this->RenderText('Acción (Espacio / Bien)'), false, $this->RenderText('Maestras')));
if (GetCurrentUserGrantForDataSource('public.sga_tarea_plan')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Tarea Planificada'), 'tarea_plan.php', $this->RenderText('Tarea Planificada'), $currentPageCaption == $this->RenderText('Tarea Planificada'), false, $this->RenderText('Maestras')));
if (GetCurrentUserGrantForDataSource('public.sga_espacio')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Espacio'), 'espacio.php', $this->RenderText('Espacio'), $currentPageCaption == $this->RenderText('Espacio'), false, $this->RenderText('Maestras')));
if (GetCurrentUserGrantForDataSource('public.sga_bien')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Bien'), 'bien.php', $this->RenderText('Bien'), $currentPageCaption == $this->RenderText('Bien'), false, $this->RenderText('Maestras')));
if (GetCurrentUserGrantForDataSource('public.sga_metodologia')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Metodologia de Acción'), 'metodologia.php', $this->RenderText('Metodologia'), $currentPageCaption == $this->RenderText('Metodologia de Acción'), false, $this->RenderText('Paramétricas')));
if (GetCurrentUserGrantForDataSource('public.sga_tipo_accion')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Tipo Accion'), 'tipo_accion.php', $this->RenderText('Tipo Accion'), $currentPageCaption == $this->RenderText('Tipo Accion'), false, $this->RenderText('Paramétricas')));
if (GetCurrentUserGrantForDataSource('public.sga_tipo_bien')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Tipo Bien'), 'tipo_bien.php', $this->RenderText('Tipo Bien'), $currentPageCaption == $this->RenderText('Tipo Bien'), false, $this->RenderText('Paramétricas')));
if (GetCurrentUserGrantForDataSource('public.sga_periodicidad')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Periodicidad'), 'periodicidad.php', $this->RenderText('Periodicidad'), $currentPageCaption == $this->RenderText('Periodicidad'), false, $this->RenderText('Paramétricas')));
if (GetCurrentUserGrantForDataSource('public.sga_planta')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Planta'), 'planta.php', $this->RenderText('Planta'), $currentPageCaption == $this->RenderText('Planta'), false, $this->RenderText('Paramétricas')));
if (GetCurrentUserGrantForDataSource('public.sga_origen')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Origen'), 'origen.php', $this->RenderText('Origen'), $currentPageCaption == $this->RenderText('Origen'), false, $this->RenderText('Paramétricas')));
if (GetCurrentUserGrantForDataSource('public.sga_tipo_espacio')->HasViewGrant())
$result->AddPage(new PageLink($this->RenderText('Tipo Espacio'), 'tipo_espacio.php', $this->RenderText('Tipo Espacio'), $currentPageCaption == $this->RenderText('Tipo Espacio'), false, $this->RenderText('Paramétricas')));
if ( HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser() ) {
$result->AddGroup('Admin area');
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, false, 'Admin area'));
}
return $result;
}
示例9: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
if (empty($args['s'])) {
return '';
}
extract($args);
$query = new TextSearchQuery($s, $case_exact, $regex);
$pages = $dbi->fullSearch($query, $sortby, $limit, $exclude);
$lines = array();
$hilight_re = $hilight ? $query->getHighlightRegexp() : false;
$count = 0;
$found = 0;
if ($quiet) {
// see how easy it is with PageList...
$list = new PageList(false, $exclude, $args);
while ($page = $pages->next() and (!$limit or $count < $limit)) {
$list->addPage($page);
}
return $list;
}
// Todo: we should better define a new PageListDL class for dl/dt/dd lists
// But the new column types must have a callback then. (showhits)
// See e.g. WikiAdminSearchReplace for custom pagelist columns
$list = HTML::dl();
if (!$limit or !is_int($limit)) {
$limit = 0;
}
// expand all page wildcards to a list of pages which should be ignored
if ($exclude) {
$exclude = explodePageList($exclude);
}
while ($page = $pages->next() and (!$limit or $count < $limit)) {
$name = $page->getName();
if ($exclude and in_array($name, $exclude)) {
continue;
}
$count++;
$list->pushContent(HTML::dt(WikiLink($name)));
if ($hilight_re) {
$list->pushContent($this->showhits($page, $hilight_re));
}
unset($page);
}
if ($limit and $count >= $limit) {
//todo: pager link to list of next matches
$list->pushContent(HTML::dd(fmt("only %d pages displayed", $limit)));
}
if (!$list->getContent()) {
$list->pushContent(HTML::dd(_("<no matches>")));
}
if (!empty($pages->stoplisted)) {
$list = HTML(HTML::p(fmt(_("Ignored stoplist words '%s'"), join(', ', $pages->stoplisted))), $list);
}
if ($noheader) {
return $list;
}
return HTML(HTML::p(fmt("Full text search results for '%s'", $s)), $list);
}
示例10: run
public function run()
{
//$u = new User();
//if(!$u->isSuperUser()) { die(t("Access Denied."));} // cheap security check...
$cfg = new Config();
Loader::model('page_list');
$pl = new PageList();
//$pl->ignorePermissions();
$pNum = $cfg->get('OLD_VERSION_JOB_PAGE_NUM');
if ($pNum <= 0) {
$cfg->save('OLD_VERSION_JOB_PAGE_NUM', 0);
}
$pl->setItemsPerPage(3);
/* probably want to keep a record of pages that have been gone through
* so you don't start from the beginning each time..
*/
$pNum = $pNum + 1;
$pages = $pl->getPage($pNum);
$cfg->save('OLD_VERSION_JOB_PAGE_NUM', $pNum);
$pageCount = 0;
$versionCount = 0;
if (count($pages) == 0) {
$cfg->save('OLD_VERSION_JOB_PAGE_NUM', 0);
return t("All pages have been processes, starting from beginning on next run.");
}
foreach ($pages as $page) {
if ($page instanceof Page) {
$pvl = new VersionList($page);
$versions = $pvl->getVersionListArray();
$versions = array_reverse($versions);
$vCount = count($versions);
if ($vCount <= 10) {
continue;
}
$pageCount++;
$stopAt = $vCount - 10;
$i = 0;
foreach ($versions as $v) {
if ($v instanceof CollectionVersion) {
if ($v->isApproved() || $v->isMostRecent()) {
// may want to add a date check here too
continue;
} else {
@$v->delete();
$versionCount++;
}
}
$i++;
if ($i >= $stopAt) {
break;
}
}
}
}
$pages = $pageCount == 1 ? t("Page") : t("Pages");
return $versionCount . " " . t("versions deleted from") . " " . $pageCount . " " . $pages . " (" . $pNum . ")";
}
示例11: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
$pagelist = new PageList($info, $exclude, $args);
// should attributes be listed as pagename here?
$pagelist->addPageList($dbi->listRelations($mode == 'all', $mode == 'attributes', !empty($sortby)));
return $pagelist;
}
示例12: getPages
function getPages($query = null)
{
Loader::model('page_list');
$db = Loader::db();
$bID = $this->bID;
if ($this->bID) {
$q = "select * from btDateNav where bID = '{$bID}'";
$r = $db->query($q);
if ($r) {
$row = $r->fetchRow();
}
} else {
$row['num'] = $this->num;
$row['cParentID'] = $this->cParentID;
$row['cThis'] = $this->cThis;
$row['orderBy'] = $this->orderBy;
$row['ctID'] = $this->ctID;
$row['rss'] = $this->rss;
}
$pl = new PageList();
$pl->setNameSpace('b' . $this->bID);
$cArray = array();
//$pl->sortByPublicDate();
$pl->sortByPublicDateDescending();
$num = (int) $row['num'];
if ($num > 0) {
$pl->setItemsPerPage($num);
}
$c = $this->getCollectionObject();
if (is_object($c)) {
$this->cID = $c->getCollectionID();
}
$cParentID = $row['cThis'] ? $this->cID : $row['cParentID'];
if ($this->displayFeaturedOnly == 1) {
Loader::model('attribute/categories/collection');
$cak = CollectionAttributeKey::getByHandle('is_featured');
if (is_object($cak)) {
$pl->filterByIsFeatured(1);
}
}
$pl->filter('cvName', '', '!=');
if ($row['ctID']) {
$pl->filterByCollectionTypeID($row['ctID']);
}
$pl->filterByAttribute('exclude_nav', false);
if ($row['cParentID'] != 0) {
$pl->filterByParentID($cParentID);
}
if ($num > 0) {
$pages = $pl->getPage();
} else {
$pages = $pl->get();
}
$this->set('pl', $pl);
return $pages;
}
示例13: sitemap
public function sitemap()
{
global $varChecker;
$drag = $varChecker->getValue('drag');
$noDrag = $drag == 'false' ? 'true' : 'false';
$site = $this->INK_User->getCustomer()->getSite();
$menu = new PageList(array('id' => 'sitemap'), array('noDrag' => $noDrag));
$this->pixelcms->siteName = $site->getName();
$this->pixelcms->sitemap = $menu->getList();
}
示例14: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
if (GetCurrentUserGrantForDataSource('hometext')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Home Page Text'), 'HomePageText.php', $this->RenderText('Home Page Text'), $currentPageCaption == $this->RenderText('Home Page Text')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, true));
}
return $result;
}
示例15: run
public function run()
{
$pl = new PageList();
$pl->filterByCollectionTypeHandle('walk');
$pl->filterByName('', true);
$pages = $pl->get();
$pagecount = count($pages);
foreach ($pages as $page) {
$page->moveToTrash();
}
return $pagecount . ' ' . t2('page', 'pages', $pagecount) . ' moved to the trash';
}