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


PHP PageList::includeInactivePages方法代码示例

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


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

示例1: 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

示例2: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$pk = PermissionKey::getByHandle('empty_trash');
if (!$pk->validate()) {
    die(t("Access Denied."));
}
$trash = Page::getByPath(Config::get('concrete.paths.trash'));
$i = 0;
if (is_object($trash) && !$trash->isError()) {
    $pl = new PageList();
    $pl->filterByParentID($trash->getCollectionID());
    $pl->includeInactivePages();
    $pl->setPageVersionToRetrieve(\Concrete\Core\Page\PageList::PAGE_VERSION_RECENT);
    $pages = $pl->getResults();
    foreach ($pages as $pc) {
        $cp = new Permissions($pc);
        if ($cp->canDeletePage()) {
            ++$i;
            $pc->delete();
        }
    }
}
$message = t2('%d page deleted.', '%d pages deleted.', $i, $i);
$obj = new stdClass();
$obj->message = $message;
echo Loader::helper('json')->encode($obj);
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:27,代码来源:sitemap_empty_trash.php

示例3: 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->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;
		return $obj;
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:46,代码来源:sitemap.php


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