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


PHP PageList::sortByDisplayOrder方法代码示例

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


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

示例1: loadOtherCollections

 protected function loadOtherCollections()
 {
     global $c;
     $pl = new PageList();
     if ($this->orderBy == 'chrono_desc') {
         $pl->sortByPublicDateDescending();
     } else {
         $pl->sortByDisplayOrder();
     }
     $pl->filterByParentID($c->cParentID);
     if ($this->excludeSystemPages) {
         $this->excludeSystemPages($pl);
     }
     $this->otherCollections = $pl->get();
     $this->otherCollectionsLoaded = 1;
 }
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:16,代码来源:controller.php

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

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

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

示例5: getPageList

 public function getPageList()
 {
     Loader::model('page_list');
     $db = Loader::db();
     $bID = $this->bID;
     if ($this->bID) {
         $q = 'select num, cParentID, cThis, orderBy, ctID, displayAliases, rss from btPageList 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;
         $row['displayAliases'] = $this->displayAliases;
     }
     $pl = new PageList();
     $pl->setNameSpace('b' . $this->bID);
     $cArray = array();
     switch ($row['orderBy']) {
         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;
         case 'random':
             $pl->sortBy('RAND()');
             break;
         default:
             $pl->sortByPublicDateDescending();
             break;
     }
     $num = (int) $row['num'];
     $pl->setItemsPerPage($num);
     $c = Page::getCurrentPage();
     if (is_object($c)) {
         $this->cID = $c->getCollectionID();
     }
     Loader::model('attribute/categories/collection');
     if ((int) $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) {
         $cParentID = $row['cThis'] ? $this->cID : $row['cParentID'];
         if ($this->includeAllDescendents) {
             $pl->filterByPath(Page::getByID($cParentID)->getCollectionPath());
         } else {
             $pl->filterByParentID($cParentID);
         }
     }
     return $pl;
 }
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:80,代码来源:controller.php

示例6: view

 public function view()
 {
     $fields_template_relative_path = "/view_form_fields/{$this->form_key}.php";
     $fields_template_absolute_path = dirname(__FILE__) . $fields_template_relative_path;
     if (!file_exists($fields_template_absolute_path)) {
         throw new Exception(t('Custom Contact Form Error: Missing form fields template file %s', $fields_template_absolute_path));
     }
     $this->set('fields_template', $fields_template_relative_path);
     $has_files = CustomContactForm::hasFileFields($this->form_key);
     $this->set('has_files', $has_files);
     $this->set('show_thanks', !empty($_GET['thanks']) && $_GET['thanks'] == $this->bID);
     $this->set('honeypot_blank_field_name', CustomContactForm::$honeypot_blank_field_name);
     $this->set('honeypot_blank_field_label', CustomContactForm::$honeypot_blank_field_label);
     $this->set('honeypot_retained_field_name', CustomContactForm::$honeypot_retained_field_name);
     $this->set('honeypot_retained_field_value', CustomContactForm::$honeypot_retained_field_value);
     // get the product pages children pID 130
     $pl = new PageList();
     $pl->filterByParentID('130');
     $pl->sortByDisplayOrder();
     $productpages = $pl->get();
     $this->set('productpages', $productpages);
     // Bi fold doors
     // get the Aluminium - bi fold pages pID 154
     $pl = new PageList();
     $pl->filterByParentID('154');
     $pl->sortByDisplayOrder();
     $aluminium_productpages = $pl->get();
     $this->set('aluminium_productpages', $aluminium_productpages);
     // get page name
     $p = Page::getByID(154);
     $p_name = $p->getCollectionName();
     $this->set('aluminium_productpage_name', $p_name);
     // get the Timber - bi fold pages pID 155
     $pl = new PageList();
     $pl->filterByParentID('155');
     $pl->sortByDisplayOrder();
     $timber_productpages = $pl->get();
     $this->set('timber_productpages', $timber_productpages);
     // get page name
     $p = Page::getByID(155);
     $p_name = $p->getCollectionName();
     $this->set('timber_productpage_name', $p_name);
     // get the Composite - bi fold pages pID 156
     $pl = new PageList();
     $pl->filterByParentID('156');
     $pl->sortByDisplayOrder();
     $composite_productpages = $pl->get();
     $this->set('composite_productpages', $composite_productpages);
     // get page name
     $p = Page::getByID(156);
     $p_name = $p->getCollectionName();
     $this->set('composite_productpage_name', $p_name);
     // Sliding doors
     // get Sliding doors pages pID 132
     $pl = new PageList();
     $pl->filterByParentID('132');
     $pl->sortByDisplayOrder();
     $sliding_doors_productpages = $pl->get();
     $this->set('sliding_doors_productpages', $sliding_doors_productpages);
     // get page name
     $p = Page::getByID(132);
     $p_name = $p->getCollectionName();
     $this->set('sliding_doors_productpage_name', $p_name);
     // Sliding turn systems
     // get Sliding Sliding turn systems pages pID 133
     $pl = new PageList();
     $pl->filterByParentID('133');
     $pl->sortByDisplayOrder();
     $sliding_turn_systems_productpages = $pl->get();
     $this->set('sliding_turn_systems_productpages', $sliding_turn_systems_productpages);
     // get page name
     $p = Page::getByID(133);
     $p_name = $p->getCollectionName();
     $this->set('sliding_turn_systems_productpage_name', $p_name);
     // Sliding Horizontal walls
     // get Sliding Horizontal walls pages pID 138
     $pl = new PageList();
     $pl->filterByParentID('138');
     $pl->sortByDisplayOrder();
     $moveable_walls_productpages = $pl->get();
     $this->set('moveable_walls_productpages', $moveable_walls_productpages);
     // get page name
     $p = Page::getByID(138);
     $p_name = $p->getCollectionName();
     $this->set('moveable_walls_productpage_name', $p_name);
     // Windows
     //  pID 139
     //$pl = new PageList;
     //$pl->filterByParentID('138');
     //$pl->sortByDisplayOrder();
     //$moveable_walls_productpages = $pl->get();
     //$this->set('moveable_walls_productpages', $moveable_walls_productpages);
     // get page name
     $p = Page::getByID(139);
     $p_name = $p->getCollectionName();
     $this->set('windows_productpage_name', $p_name);
 }
开发者ID:robchenski,项目名称:ids,代码行数:97,代码来源:controller.php

示例7: PageList

    }
    $row['cID'] = $_GET['cID'];
    $row['displayAttributes'] = $_GET['displayAttributes'];
    $row['filterAttributes'] = $_GET['filterAttributes'];
} else {
    $row = $_GET;
}
$pl = new PageList();
$pl->setNameSpace('b' . $bID);
/*
 *  Apply filters
 */
// Sort results
switch ($row['orderBy']) {
    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();
开发者ID:cewhiting,项目名称:concrete5_ajax_page_list,代码行数:31,代码来源:ajax_request.php


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