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


PHP PageList::getPage方法代码示例

本文整理汇总了PHP中PageList::getPage方法的典型用法代码示例。如果您正苦于以下问题:PHP PageList::getPage方法的具体用法?PHP PageList::getPage怎么用?PHP PageList::getPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PageList的用法示例。


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

示例1: 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));
 }
开发者ID:ronlobo,项目名称:concrete5,代码行数:34,代码来源:remove_old_page_versions.php

示例2: 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 . ")";
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:57,代码来源:remove_old_page_versions.php

示例3: 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;
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:56,代码来源:date_nav.php

示例4: getPage

	public function getPage() {
		if ($this->indexModeSimple) {
			$this->sortBy('cDatePublic', 'desc');
		} else {
			$this->sortByMultiple('cIndexScore desc', 'cDatePublic desc');
		}
		$r = parent::getPage();
		$results = array();
		foreach($r as $c) {
			$results[] = array('cID' => $c->getCollectionID(), 'cName' => $c->getCollectionName(), 'cDescription' => $c->getCollectionDescription(), 'score' => $c->getPageIndexScore(), 'cPath' => $c->getCollectionPath(), 'content' => $c->getPageIndexContent());
		}
		return $results;
	}
开发者ID:nveid,项目名称:concrete5,代码行数:13,代码来源:indexed_page_list.php

示例5: show

 /**
  * Gets a list of all pages of the collection type
  * specified by $ctID
  * 
  * @param int $ctID ID of collection type
  */
 public function show($ctID)
 {
     $hh = Loader::helper('html');
     $th = Loader::helper('text');
     $emptyList = false;
     $this->view(false);
     Loader::model('page_list');
     $pl = new PageList();
     $pl->filterByCollectionTypeID($ctID);
     if (array_key_exists('cvName', $_REQUEST)) {
         $cvName = $th->sanitize($_REQUEST['cvName']);
         $this->set('cvName', $cvName);
         $pl->filterByName($cvName);
         if (count($pl->getPage()) <= 0) {
             $pl = new PageList();
             $emptyList = true;
         }
     }
     if (!$emptyList) {
         $pl->addtoQuery('left join Pages parent ON(p1.cParentID = parent.cID)');
         $pl->sortByMultiple('parent.cDisplayOrder asc', 'p1.cDisplayOrder asc');
         $pages = $pl->getPage();
     } else {
         $pages = '';
         $this->set('emptyList', t('No entries found'));
     }
     $ct = CollectionType::getByID($ctID);
     // add all necessary header items like JavaScript and CSS files
     if (!array_key_exists('cvName', $_REQUEST) || $cvName == '') {
         $this->addHeaderItem($hh->css('composer.sort.css', 'remo_composer_list'));
         $this->addHeaderItem($hh->javascript('composer.sort.js', 'remo_composer_list'));
     }
     $this->addHeaderItem($hh->javascript('composer.overview.js', 'remo_composer_list'));
     // add variables used by view
     $this->set('customColumns', $this->loadCustomColumns($ctID));
     $this->set('ctID', $ctID);
     $this->set('ctPublishMethod', $ct->getCollectionTypeComposerPublishMethod());
     $this->set('pages', $pages);
     $this->set('displaySearchBox', $this->displaySearchBox());
     $this->set('composerListTitel', $ct->getCollectionTypeName());
     $this->set('pagesPagination', $pl->displayPaging(false, true));
 }
开发者ID:haeflimi,项目名称:concrete5-composer-list,代码行数:48,代码来源:list.php

示例6: getPages

 function getPages($query = null)
 {
     Loader::model('page_list');
     $db = Loader::db();
     $bID = $this->bID;
     if ($this->bID) {
         $q = "select num, cParentID, cThis, orderBy, ctID, displayAliases, rss from btEasyNewsList 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();
     switch ($row['orderBy']) {
         case 'public_desc':
             $pl->sortBy('cvDatePublic', 'desc');
             break;
         case 'public_asc':
             $pl->sortBy('cvDatePublic', 'asc');
             break;
         case 'display_asc':
             $pl->sortByDisplayOrder();
             break;
         case 'display_desc':
             $pl->sortByDisplayOrderDescending();
             break;
         case 'chrono_asc':
             $pl->sortByPublicDate();
             break;
         case 'alpha_asc':
             $pl->sortByName();
             break;
         case 'alpha_desc':
             $pl->sortByNameDescending();
             break;
         default:
             $pl->sortByPublicDateDescending();
             break;
     }
     $num = (int) $row['num'];
     if ($num > 0) {
         $pl->setItemsPerPage($num);
     }
     $c = Page::getCurrentPage();
     if (is_object($c)) {
         $this->cID = $c->getCollectionID();
     }
     $cParentID = $row['cThis'] ? $this->cID : $row['cParentID'];
     Loader::model('attribute/categories/collection');
     if ($this->displayFeaturedOnly == 1) {
         $cak = CollectionAttributeKey::getByHandle('is_featured');
         if (is_object($cak)) {
             $pl->filterByIsFeatured(1);
         }
     }
     if (!$row['displayAliases']) {
         $pl->filterByIsAlias(0);
     }
     $pl->filter('cvName', '', '!=');
     if ($row['ctID']) {
         $pl->filterByCollectionTypeID($row['ctID']);
     }
     $columns = $db->MetaColumns(CollectionAttributeKey::getIndexedSearchTable());
     if (isset($columns['AK_EXCLUDE_PAGE_LIST'])) {
         $pl->filter(false, '(ak_exclude_page_list = 0 or ak_exclude_page_list is null)');
     }
     if (intval($row['cParentID']) != 0) {
         $pl->filterByParentID($cParentID);
     }
     //Publish Date Filter
     $dt = Loader::helper('date');
     $pl->filter('cvDatePublic', $dt->getLocalDateTime(), '<');
     if ($num > 0) {
         $pages = $pl->getPage();
     } else {
         $pages = $pl->get();
     }
     $this->set('pl', $pl);
     return $pages;
 }
开发者ID:vipkailiai,项目名称:FCVOVA,代码行数:89,代码来源:controller.php

示例7: PageList

Loader::library('controller', $pkgHandle);
//Get info about category
$cat = (int) $_GET['c'];
Loader::model('page_list');
Loader::model("collection_types");
$ct = Collection::getByID($cat);
//$a=$ct->getAttribute('easynews_section');
//if(empty($a)||(!$a)){
//	die();
//}
$cvID = CollectionVersion::getNumericalVersionID($ct->getCollectionID(), 'ACTIVE');
$vObj = CollectionVersion::get($ct, $cvID);
$newsList = new PageList();
$newsList->filterByParentID($cat);
$newsList->sortBy('cvDatePublic', 'desc');
$newsPage = $newsList->getPage();
//Start creation
Loader::library('3rdparty/feedcreator/include/feedcreator.class', $pkgHandle);
//define channel
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = SITE . ' - ' . $vObj->cvName;
$rss->description = $vObj->cvName . ' updates';
$rss->link = SITE_URL;
$rss->syndicationURL = EasyNewsController::getRssPagePath() . '?c=' . $cat;
//channel items/entries
foreach ($newsPage as $page) {
    $item = new FeedItem();
    $item->title = $page->getCollectionName();
    $item->link = BASE_URL . Loader::helper('navigation')->getLinkToCollection($page);
    $item->description = $page->getCollectionDescription();
开发者ID:vipkailiai,项目名称:FCVOVA,代码行数:31,代码来源:rss.php

示例8: getSubNodes

 function getSubNodes($cID, $level = 0, $keywords = '', $autoOpenNodes = true)
 {
     $db = Loader::db();
     $obj = new stdClass();
     if (isset($cID) && (Loader::helper('validation/numbers')->integer($cID) || $cID == 0)) {
         if ($keywords != '' && $keywords != false) {
             $nc = Page::getByID($cID, 'RECENT');
             $pl = new PageList();
             if (PERMISSIONS_MODEL != 'simple') {
                 $pl->setViewPagePermissionKeyHandle('view_page_in_sitemap');
             }
             $obj->keywords = $keywords;
             $pl->filterByName($keywords);
             $pl->ignoreAliases();
             $pl->filterByPath($nc->getCollectionPath());
             $pl->displayUnapprovedPages();
             $pl->sortByDisplayOrder();
             $results = $pl->get(SITEMAP_PAGES_LIMIT);
             $total = $pl->getTotal();
         } else {
             $pl = new PageList();
             if (PERMISSIONS_MODEL != 'simple') {
                 $pl->setViewPagePermissionKeyHandle('view_page_in_sitemap');
             }
             $pl->sortByDisplayOrder();
             if (ConcreteDashboardSitemapHelper::showSystemPages()) {
                 $pl->includeSystemPages();
                 $pl->includeInactivePages();
             }
             $pl->filterByParentID($cID);
             $pl->displayUnapprovedPages();
             $total = $pl->getTotal();
             if ($cID == 1) {
                 $results = $pl->get();
             } else {
                 $pl->setItemsPerPage(SITEMAP_PAGES_LIMIT);
                 $results = $pl->getPage();
             }
         }
         $nodes = array();
         foreach ($results as $c) {
             $n = ConcreteDashboardSitemapHelper::getNode($c, $level + 1, $autoOpenNodes);
             if ($n != false) {
                 $nodes[] = $n;
             }
         }
         $obj->total = $total;
         $obj->nodeID = $cID;
         $obj->pageList = $pl;
         $obj->results = $nodes;
     } else {
         $obj->total = 0;
         $obj->nodeID = 0;
         $obj->pageList = null;
         $obj->results = null;
     }
     return $obj;
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:58,代码来源:sitemap.php

示例9: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$valt = Loader::helper('validation/token');
if ($valt->validate('quick_page_select_' . $_REQUEST['key'], $_REQUEST['token'])) {
    $u = new User();
    Loader::model('page_list');
    $db = Loader::db();
    $pl = new PageList();
    if ($_GET['term'] != '') {
        $pl->filterByName($_GET['term']);
    }
    $pages = $pl->getPage();
    $pageNames = array();
    foreach ($pages as $c) {
        $obj = new stdClass();
        $obj->label = $c->getCollectionName();
        $obj->value = $c->getCollectionID();
        $pageNames[] = $obj;
    }
    $jh = Loader::helper('json');
    echo $jh->encode($pageNames);
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:23,代码来源:autocomplete.php

示例10: getSubNodes

	function getSubNodes($cID, $level = 0, $keywords = '', $autoOpenNodes = true) {
		$db = Loader::db();
		
		$obj = new stdClass;
		if ($keywords != '' && $keywords != false) {
			$nc = Page::getByID($cID, 'RECENT');
			$pl = new PageList();
			$obj->keywords = $keywords;
			$pl->filterByName($keywords);
			$pl->filterByPath($nc->getCollectionPath());
			$pl->displayUnapprovedPages();
			$pl->sortByDisplayOrder();
			$results = $pl->get(SITEMAP_PAGES_LIMIT);
			$total = $pl->getTotal();
		} else {			
			$pl = new PageList();
			$pl->sortByDisplayOrder();
			if (ConcreteDashboardSitemapHelper::showSystemPages()) {
				$pl->includeSystemPages();
			}
			$pl->filterByParentID($cID);
			$pl->displayUnapprovedPages();
			$total = $pl->getTotal();
			if ($cID == 1) {
				$results = $pl->get();			
			} else {
				$pl->setItemsPerPage(SITEMAP_PAGES_LIMIT);
				$results = $pl->getPage();
			}
		}
		
		$nodes = array();
		foreach($results as $c) {
			$n = ConcreteDashboardSitemapHelper::getNode($c, $level+1, $autoOpenNodes);
			if ($n != false) {
				$nodes[] = $n;
			}
		}
		
		$obj->total = $total;
		$obj->nodeID = $cID;
		$obj->pageList = $pl;
		$obj->results = $nodes;
		return $obj;
	}
开发者ID:remkoj,项目名称:concrete5,代码行数:45,代码来源:sitemap.php

示例11: intval

        }
    }
}
/*
 *  Set up pagination and retrieve pages
 */
$paginate_list = $row['paginate'];
$num = (int) $row['num'];
$pl->setItemsPerPage($num);
if ($paginate_list == 1) {
    $current_page_get_var = 'ccm_paging_p_b' . $bID;
    $current_page = intval($_GET[$current_page_get_var]);
    // Page of results requested in query string
    $current_page = empty($current_page) ? 1 : $current_page;
    // PageList object returns this page of results
    $pages = $pl->getPage($current_page);
} else {
    $pages = $pl->getPage(1);
}
// Display attribute filter links
if (count($row['displayAttributes']) > 0) {
    Loader::model('attribute/categories/collection');
    $satc = new SelectAttributeTypeController(AttributeType::getByHandle('select'));
    // Get existing query string to pass through filtering parameters
    $request = $_SERVER['REQUEST_URI'];
    $url_parts = parse_url($request);
    $url_params = array();
    parse_str($url_parts['query'], $url_params);
    $query_string = http_build_query($url_params);
    // Display select attributes (and their options) specified in ajax_page_list.php as lists of links
    echo '<div class="page-list-filters">';
开发者ID:cewhiting,项目名称:concrete5_ajax_page_list,代码行数:31,代码来源:ajax_request.php


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