本文整理汇总了PHP中PageList::ignoreAliases方法的典型用法代码示例。如果您正苦于以下问题:PHP PageList::ignoreAliases方法的具体用法?PHP PageList::ignoreAliases怎么用?PHP PageList::ignoreAliases使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageList
的用法示例。
在下文中一共展示了PageList::ignoreAliases方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRequestedSearchResults
public function getRequestedSearchResults()
{
$dh = Loader::helper('concrete/dashboard/sitemap');
if (!$dh->canRead()) {
return false;
}
$pageList = new PageList();
$pageList->ignoreAliases();
$pageList->enableStickySearchRequest();
if ($_REQUEST['submit_search']) {
$pageList->resetSearchRequest();
}
$req = $pageList->getSearchRequest();
$pageList->displayUnapprovedPages();
$pageList->sortBy('cDateModified', 'desc');
$columns = PageSearchColumnSet::getCurrent();
$this->set('columns', $columns);
$cvName = htmlentities($req['cvName'], ENT_QUOTES, APP_CHARSET);
if ($cvName != '') {
$pageList->filterByName($cvName);
}
if ($req['cParentIDSearchField'] > 0) {
if ($req['cParentAll'] == 1) {
$pc = Page::getByID($req['cParentIDSearchField']);
$cPath = $pc->getCollectionPath();
$pageList->filterByPath($cPath);
} else {
$pageList->filterByParentID($req['cParentIDSearchField']);
}
$parentDialogOpen = 1;
}
$keywords = htmlentities($req['keywords'], ENT_QUOTES, APP_CHARSET);
$pageList->filterByKeywords($keywords);
if ($req['numResults']) {
$pageList->setItemsPerPage($req['numResults']);
}
if ($req['ctID']) {
$pageList->filterByCollectionTypeID($req['ctID']);
}
if ($_REQUEST['noKeywords'] == 1) {
$pageList->filter('CollectionSearchIndexAttributes.ak_meta_keywords', NULL, '=');
$this->set('keywordCheck', true);
$parentDialogOpen = 1;
}
if ($_REQUEST['noDescription'] == 1) {
$pageList->filter('CollectionSearchIndexAttributes.ak_meta_description', NULL, '=');
$this->set('descCheck', true);
$parentDialogOpen = 1;
}
$this->set('searchRequest', $req);
$this->set('parentDialogOpen', $parentDialogOpen);
return $pageList;
}
示例2: createGatheringItems
public function createGatheringItems(GatheringDataSourceConfiguration $configuration)
{
$pl = new PageList();
$pl->ignoreAliases();
$pl->ignorePermissions();
$gathering = $configuration->getGatheringObject();
if ($gathering->getGatheringDateLastUpdated()) {
$pl->filterByPublicDate($gathering->getGatheringDateLastUpdated(), '>');
}
$ptID = $configuration->getPageTypeID();
if ($ptID > 0) {
$pl->filterByPageTypeID($ptID);
}
$pages = $pl->get();
$items = array();
foreach ($pages as $c) {
$item = PageGatheringItem::add($configuration, $c);
if (is_object($item)) {
$items[] = $item;
}
}
return $items;
}
示例3: getPages
public function getPages()
{
// returns an array of pages of this type. Does not check permissions
// since this can get pretty long it actually returns a limited amount of data;
$pl = new PageList();
$pl->filterByCollectionTypeID($this->getCollectionTypeID());
$pl->ignorePermissions();
$pl->ignoreAliases();
$pages = $pl->get();
return $pages;
}
示例4: getRequestedSearchResults
public function getRequestedSearchResults()
{
$dh = Loader::helper('concrete/dashboard/sitemap');
if (!$dh->canRead()) {
return false;
}
$pageList = new PageList();
$pageList->ignoreAliases();
$pageList->enableStickySearchRequest();
if ($_REQUEST['submit_search']) {
$pageList->resetSearchRequest();
}
$req = $pageList->getSearchRequest();
$pageList->displayUnapprovedPages();
$columns = PageSearchColumnSet::getCurrent();
$this->set('columns', $columns);
$cvName = h($req['cvName']);
if ($cvName != '') {
$pageList->filterByName($cvName);
}
if ($req['numResults'] && Loader::helper('validation/numbers')->integer($req['numResults'])) {
$pageList->setItemsPerPage($req['numResults']);
}
if ($req['ctID']) {
$pageList->filterByCollectionTypeID($req['ctID']);
}
if (is_array($req['selectedSearchField'])) {
foreach ($req['selectedSearchField'] as $i => $item) {
// due to the way the form is setup, index will always be one more than the arrays
if ($item != '') {
switch ($item) {
case 'keywords':
$keywords = htmlentities($req['keywords'], ENT_QUOTES, APP_CHARSET);
$pageList->filterByKeywords($keywords);
break;
case 'num_children':
$symbol = '=';
if ($req['cChildrenSelect'] == 'gt') {
$symbol = '>';
} else {
if ($req['cChildrenSelect'] == 'lt') {
$symbol = '<';
}
}
$pageList->filterByNumberOfChildren($req['cChildren'], $symbol);
break;
case 'owner':
$ui = UserInfo::getByUserName($req['owner']);
if (is_object($ui)) {
$pageList->filterByUserID($ui->getUserID());
} else {
$pageList->filterByUserID(-1);
}
break;
case 'theme':
$pageList->filter('ptID', $_REQUEST['ptID']);
break;
case 'parent':
if (isset($req['_cParentAll'])) {
$req['cParentAll'] = $req['_cParentAll'];
}
if ($req['cParentIDSearchField'] > 0) {
if ($req['cParentAll'] == 1) {
$pc = Page::getByID($req['cParentIDSearchField']);
$cPath = $pc->getCollectionPath();
$pageList->filterByPath($cPath);
} else {
$pageList->filterByParentID($req['cParentIDSearchField']);
}
}
break;
case 'version_status':
if (isset($req['_cvIsApproved'])) {
$req['cvIsApproved'] = $req['_cvIsApproved'];
}
$pageList->filterByIsApproved($req['cvIsApproved']);
break;
case 'permissions_inheritance':
$pageList->filter('cInheritPermissionsFrom', $req['cInheritPermissionsFrom']);
break;
case "date_public":
$dateFrom = $req['date_public_from'];
$dateTo = $req['date_public_to'];
if ($dateFrom != '') {
$dateFrom = date('Y-m-d', strtotime($dateFrom));
$pageList->filterByPublicDate($dateFrom, '>=');
$dateFrom .= ' 00:00:00';
}
if ($dateTo != '') {
$dateTo = date('Y-m-d', strtotime($dateTo));
$dateTo .= ' 23:59:59';
$pageList->filterByPublicDate($dateTo, '<=');
}
break;
case "last_modified":
$dateFrom = $req['last_modified_from'];
$dateTo = $req['last_modified_to'];
if ($dateFrom != '') {
$dateFrom = date('Y-m-d', strtotime($dateFrom));
$pageList->filterByDateLastModified($dateFrom, '>=');
//.........这里部分代码省略.........
示例5: 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;
}
示例6: reindexAll
/**
* Reindexes the search engine.
*/
public function reindexAll($fullReindex = false)
{
Cache::disableLocalCache();
$db = Loader::db();
Loader::model('collection_attributes');
if ($fullReindex) {
$db->Execute("truncate table PageSearchIndex");
}
$pl = new PageList();
$pl->ignoreAliases();
$pl->ignorePermissions();
$pl->sortByCollectionIDAscending();
$pl->filter(false, '(c.cDateModified > psi.cDateLastIndexed or UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(psi.cDateLastIndexed) > ' . $this->searchReindexTimeout . ' or psi.cID is null or psi.cDateLastIndexed is null)');
$pl->filter(false, '(ak_exclude_search_index is null or ak_exclude_search_index = 0)');
$pages = $pl->get($this->searchBatchSize);
$num = 0;
foreach ($pages as $c) {
// make sure something is approved
$cv = $c->getVersionObject();
if (!$cv->cvIsApproved) {
continue;
}
$c->reindex($this, true);
$num++;
unset($c);
}
$pnum = Collection::reindexPendingPages();
$num = $num + $pnum;
Cache::enableLocalCache();
$result = new stdClass();
$result->count = $num;
return $result;
}
示例7: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$sh = Loader::helper('concrete/dashboard/sitemap');
if (!$sh->canRead()) {
die(t('Access Denied'));
}
session_write_close();
$keywords = $_REQUEST['q'];
Loader::model('page_list');
$pl = new PageList();
$pl->filterByName($keywords);
if (PERMISSIONS_MODEL != 'simple') {
$pl->setViewPagePermissionKeyHandle('view_page_in_sitemap');
}
$pl->ignoreAliases();
$pl->sortBy('cID', 'asc');
$pl->setItemsPerPage(5);
$pages = $pl->getPage();
$results = array();
$nh = Loader::helper('navigation');
foreach ($pages as $c) {
$obj = new stdClass();
$obj->href = $nh->getLinkToCollection($c);
$obj->cID = $c->getCollectionID();
$obj->name = $c->getCollectionName();
$results[] = $obj;
}
print Loader::helper("json")->encode($results);
示例8: exportPages
public function exportPages($xml = null, PageList $pl = null)
{
if (!$xml) {
$this->x = $this->getXMLRoot();
}
$node = $this->x->addChild("pages");
if (!$pl) {
$pl = new PageList();
}
$pl->ignorePermissions();
$pl->ignoreAliases();
$pl->filter(false, 'cFilename is null or cFilename = \'\'');
$pages = $pl->get();
foreach ($pages as $pc) {
$pc->export($node);
}
}
示例9: view
//.........这里部分代码省略.........
return ['walkImagePath' => $walkImage, 'countryName' => $countryName, 'cityName' => $_city->getCollectionName(), 'walkTitle' => $page->getCollectionName(), 'walkPath' => $nh->getLinkToCollection($page)];
}, (array) $pl->get(3));
// Whether the city has any walks posted to it
// Whether the city has a blog page set up for it
$pl = new PageList();
$pl->filterByCollectionTypeHandle('walk');
$pl->filterByParentID($userHomeCity->getCollectionID());
$pl->filterByAttribute('exclude_page_list', false);
$cityWalks = $pl->get();
// Export to view
$this->set('cityWalks', $cityWalks);
$this->set('cityHasWalks', !empty($cityWalks));
$this->set('city', $city);
$this->set('featuredWalkData', $featuredWalkData);
// If the user is a city organizer
if ($userIsCityOrganizer === true) {
// Whether the city organizer's city has its header info set
$cityHeaderInfo = $userHomeCity->getCollectionDescription();
$cityHeaderInfoIsEmpty = !trim($cityHeaderInfo);
if ($cityHeaderInfoIsEmpty === false) {
$cityHeaderInfo = $th->shorten($cityHeaderInfo, 150);
}
$this->set('cityHeaderInfoIsEmpty', $cityHeaderInfoIsEmpty);
$this->set('cityHeaderInfo', $cityHeaderInfo);
// Whether the city organizer's city has its short description
// set
$cityDescription = $userHomeCity->getAttribute('longdescription');
$cityDescriptionIsEmpty = !trim($cityDescription);
if ($cityDescriptionIsEmpty === false) {
$cityDescription = $th->shorten($cityDescription, 150);
}
$this->set('cityDescriptionIsEmpty', $cityDescriptionIsEmpty);
$this->set('cityDescription', $cityDescription);
// Whether the city organizer's city has its background photo
// set
$cityBackgroundPhotoAttribute = $userHomeCity->getAttribute('full_bg');
$cityBackgroundPhotoIsEmpty = !$cityBackgroundPhotoAttribute;
$this->set('cityBackgroundPhotoIsEmpty', $cityBackgroundPhotoIsEmpty);
if (!$cityBackgroundPhotoIsEmpty) {
$this->set('cityBackgroundPhoto', $cityBackgroundPhotoAttribute->getURL());
}
// Whether the header, description and photo are set for the
// city organizer's home city
$cityHasFullDetails = !($cityHeaderInfoIsEmpty || $cityDescriptionIsEmpty || $cityBackgroundPhotoIsEmpty);
$this->set('cityHasFullDetails', $cityHasFullDetails);
// Load the cities this CO organizes
$pl = new PageList();
$pl->filterByCollectionTypeHandle('city');
$pl->ignoreAliases();
$pl->filterByUserID($u->getUserID());
$cityUsers = [];
foreach ($pl->get() as $city) {
// Load the user list for this city
$ul = new UserList();
$ul->filterByHomeCity($city->getCollectionID());
foreach ($ul->get(65535) as $user) {
$cityUsers[] = ['id' => $user->getUserID(), 'firstName' => $user->getAttribute('first_name'), 'lastName' => $user->getAttribute('last_name')];
}
}
// Sort the users -- needed here for multi-city COs
usort($cityUsers, function ($a, $b) {
return strcmp(strtoupper($a['first-name']), strtoupper($b['first-name']));
});
$this->set('cityUsers', $cityUsers);
// Link to city-editor
$this->set('cityComposerURL', View::url('/dashboard/composer/write/-/edit/' . $city->getCollectionID()));
}
}
// Resources
$resources = ['showCityOrganizers' => false, 'showGlobalWalks' => true, 'showTips' => true, 'showFiles' => false];
if ($userIsCityOrganizer === true) {
$resources['showCityOrganizers'] = true;
$resources['showFiles'] = true;
// List of basic details for three city organizers that can be
// recommended to other city organizers
// TODO add an attribute to select 'featured' cities, so we
// don't simply grab all cities. Expand this out into a
// smart way to recommend other cities.
$pl = new PageList();
$pl->filterByCollectionTypeHandle('city');
$pl->filter(false, 'p1.uID !=' . $u->getUserID());
$pl->filterByAttribute('exclude_page_list', false);
$pl->sortBy('RAND()');
$recommendedCities = $pl->get(3);
$cityOrganizerData = array_map(function ($page) use($ah) {
$_co = UserInfo::getByID($page->getCollectionUserID());
return ['cityName' => $page->getCollectionName(), 'organizerImagePath' => $ah->getImagePath($_co), 'organizerName' => trim($_co->getAttribute('first_name') . ' ' . $_co->getAttribute('last_name')), 'organizerEmail' => $_co->getUserEmail()];
}, $pl->get(3));
$this->set('cityOrganizerData', $cityOrganizerData);
}
$this->set('resources', $resources);
}
$this->set('nh', $nh);
$this->set('u', $u);
$this->set('newWalkForm', Page::getByPath('/walk/form'));
$this->set('userIsCityOrganizer', $userIsCityOrganizer);
$this->set('userIsViewingSelf', $userIsViewingSelf);
// Validation helper for form tokens
$this->set('valt', Loader::helper('validation/token'));
}
示例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->ignoreAliases();
$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;
}