本文整理汇总了PHP中PageType::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP PageType::getList方法的具体用法?PHP PageType::getList怎么用?PHP PageType::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageType
的用法示例。
在下文中一共展示了PageType::getList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderSearchField
public function renderSearchField()
{
$form = \Core::make('helper/form');
$html = $form->select('ptID', array_reduce(\PageType::getList(), function ($types, $type) {
$types[$type->getPageTypeID()] = $type->getPageTypeDisplayName();
return $types;
}), $this->data['ptID']);
return $html;
}
示例2: view
public function view()
{
$this->ptID = intval($this->request->query->get('ptID'));
$this->cParentID = intval($this->request->query->get('cParentID'));
$this->lastestversion = isset($_GET['lastestversion']) ? true : false;
$list = new PageList();
$list->sortByDisplayOrder();
if ($this->ptID > 0) {
$list->filterByPageTypeID(intval($this->ptID));
}
if ($this->cParentID != 0) {
$list->filterByPath(Page::getByID($this->cParentID)->getCollectionPath());
}
$page_result = $list->getResults();
$cv_list = array();
$nh = Core::make('helper/navigation');
foreach ($page_result as $res) {
$cp = new Permissions($res);
if ($cp->canViewPageVersions()) {
$cv = new VersionList($res);
if (is_object($cv)) {
if ($this->lastestversion == true) {
$cvcheck = $cv->getPage(-1);
if ($cvcheck[0]->cvIsApproved != 1) {
$cv_list[$res->getCollectionID()]['vObj'] = $cv->getPage(-1);
$cv_list[$res->getCollectionID()]['cName'] = $res->getCollectionName();
$cv_list[$res->getCollectionID()]['cID'] = $res->getCollectionID();
$cv_list[$res->getCollectionID()]['link'] = $nh->getLinkToCollection($res);
}
} else {
$cv_list[$res->getCollectionID()]['vObj'] = $cv->getPage(-1);
$cv_list[$res->getCollectionID()]['cName'] = $res->getCollectionName();
$cv_list[$res->getCollectionID()]['cID'] = $res->getCollectionID();
$cv_list[$res->getCollectionID()]['link'] = $nh->getLinkToCollection($res);
}
}
}
}
$cvl = new ItemList();
$cvl->setItems($cv_list);
$cvl->setItemsPerPage(10);
$showPagination = false;
if ($cvl->getSummary()->pages > 1) {
$showPagination = true;
$paginator = $cvl->getPagination();
}
$this->set('cParentID', $this->cParentID);
$this->set('paginator', $paginator);
$this->set('showPagination', $showPagination);
$this->set('lastestversion', $this->lastestversion);
$this->set('cvlresult', $cvl->getPage());
$this->set('ptID', $this->ptID);
$pagetypes = \PageType::getList();
$this->set('pts', $pagetypes);
}
示例3: t
echo t('Number of Pages to Display');
?>
</label>
<input type="text" name="num" value="<?php
echo $num;
?>
" class="form-control">
</div>
<div class="form-group">
<label class="control-label"><?php
echo t('Page Type');
?>
</label>
<?php
$ctArray = PageType::getList();
if (is_array($ctArray)) {
?>
<select class="form-control" name="ptID" id="selectPTID">
<option value="0">** <?php
echo t('All');
?>
**</option>
<?php
foreach ($ctArray as $ct) {
?>
<option
value="<?php
echo $ct->getPageTypeID();
?>
" <?php
示例4: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$pagetypes = PageType::getList();
$types = array();
foreach ($pagetypes as $pt) {
$types[$pt->getPageTypeID()] = $pt->getPageTypeName();
}
?>
<input type="hidden" name="tab[]" value="posting" />
<div class="form-horizontal">
<div class="control-group">
<label class="control-label"><?php
echo t('Enable New Topics');
?>
</label>
<div class="controls">
<div class="radio">
<label>
<?php
echo $form->radio('enablePostingFromGathering', 0, $enablePostingFromGathering);
?>
<span><?php
echo t('No, posting is disabled.');
?>
</span>
</label>
</div>
<div class="radio">
示例5: getField
protected function getField($field)
{
$r = new stdClass();
$r->field = $field;
$searchRequest = $this->searchRequest->getSearchRequest();
$form = Loader::helper('form');
$wdt = Loader::helper('form/date_time');
/* @var $wdt \Concrete\Core\Form\Service\Widget\DateTime */
$html = '';
switch ($field) {
case 'keywords':
$html .= $form->text('keywords', $searchRequest['keywords']);
break;
case 'date_public':
$html .= $wdt->datetime('date_public_from', $wdt->translate('date_public_from', $searchRequest)) . t('to') . $wdt->datetime('date_public_to', $wdt->translate('date_public_to', $searchRequest));
break;
case 'date_added':
$html .= $wdt->datetime('date_added_from', $wdt->translate('date_added_from', $searchRequest)) . t('to') . $wdt->datetime('date_added_to', $wdt->translate('date_added_to', $searchRequest));
break;
case 'last_modified':
$html .= $wdt->datetime('last_modified_from', $wdt->translate('last_modified_from', $searchRequest)) . t('to') . $wdt->datetime('last_modified_to', $wdt->translate('last_modified_to', $searchRequest));
break;
case 'owner':
$html .= $form->text('owner');
break;
case 'permissions_inheritance':
$html .= '<select name="cInheritPermissionsFrom" class="form-control">';
$html .= '<option value="PARENT"' . ($searchRequest['cInheritPermissionsFrom'] == 'PARENT' ? ' selected' : '') . '>' . t('Parent Page') . '</option>';
$html .= '<option value="TEMPLATE"' . ($searchRequest['cInheritPermissionsFrom'] == 'TEMPLATE' ? ' selected' : '') . '>' . t('Page Type') . '</option>';
$html .= '<option value="OVERRIDE"' . ($searchRequest['cInheritPermissionsFrom'] == 'OVERRIDE' ? ' selected' : '') . '>' . t('Itself (Override)') . '</option>';
$html .= '</select>';
break;
case 'type':
$html .= $form->select('ptID', array_reduce(\PageType::getList(), function ($types, $type) {
$types[$type->getPageTypeID()] = $type->getPageTypeDisplayName();
return $types;
}), $searchRequest['ptID']);
break;
case 'version_status':
$versionToRetrieve = \Concrete\Core\Page\PageList::PAGE_VERSION_RECENT;
if ($searchRequest['versionToRetrieve']) {
$versionToRetrieve = $searchRequest['versionToRetrieve'];
}
$html .= '<div class="radio"><label>' . $form->radio('versionToRetrieve', \Concrete\Core\Page\PageList::PAGE_VERSION_RECENT, $versionToRetrieve) . t('All') . '</label></div>';
$html .= '<div class="radio"><label>' . $form->radio('versionToRetrieve', \Concrete\Core\Page\PageList::PAGE_VERSION_ACTIVE, $versionToRetrieve) . t('Approved') . '</label></div>';
break;
case 'parent':
$ps = Loader::helper("form/page_selector");
$html .= $ps->selectPage('cParentIDSearchField');
$html .= '<div class="form-group">';
$html .= '<label class="control-label">' . t('Search All Children?') . '</label>';
$html .= '<div class="radio"><label>' . $form->radio('cParentAll', 0, false) . ' ' . t('No') . '</label></div>';
$html .= '<div class="radio"><label>' . $form->radio('cParentAll', 1, false) . ' ' . t('Yes') . '</label></div>';
$html .= '</div>';
break;
case 'num_children':
$html .= '<div class="form-inline"><select name="cChildrenSelect" class="form-control">';
$html .= '<option value="gt"' . ($searchRequest['cChildrenSelect'] == 'gt' ? ' selected' : '') . '>' . t('More Than') . '</option>';
$html .= '<option value="eq"' . ($searchRequest['cChildrenSelect'] == 'eq' ? ' selected' : '') . '>' . t('Equal To') . '</option>';
$html .= '<option value="lt"' . ($searchRequest['cChildrenSelect'] == 'lt' ? ' selected' : '') . '>' . t('Fewer Than') . '</option>';
$html .= '</select>';
$html .= ' <input type="text" name="cChildren" class="form-control" value="' . $searchRequest['cChildren'] . '" /></div>';
break;
case 'theme':
$html .= '<select name="pThemeID" class="form-control">';
$themes = PageTheme::getList();
foreach ($themes as $pt) {
$html .= '<option value="' . $pt->getThemeID() . '" ' . ($pt->getThemeID() == $searchRequest['pThemeID'] ? ' selected' : '') . '>' . $pt->getThemeName() . '</option>';
}
$html .= '</select>';
break;
default:
if (Loader::helper('validation/numbers')->integer($field)) {
$ak = CollectionAttributeKey::getByID($field);
$html .= $ak->render('search', null, true);
}
break;
}
$r->html = $html;
$ag = ResponseAssetGroup::get();
$r->assets = array();
foreach ($ag->getAssetsToOutput() as $position => $assets) {
foreach ($assets as $asset) {
if (is_object($asset)) {
// have to do a check here because we might be included a dumb javascript call like i18n_js
$r->assets[$asset->getAssetType()][] = $asset->getAssetURL();
}
}
}
return $r;
}
示例6: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$form = Loader::helper('form');
$ctArray = PageType::getList(false, $sitetype);
$pageSelector = Core::make('helper/form/page_selector');
$types = array('' => t('** Choose a page type'));
foreach ($ctArray as $cta) {
$types[$cta->getPageTypeID()] = $cta->getPageTypeDisplayName();
}
$ptID = 0;
$factors = array('' => t('Select Menu'), 'sitemap_in_page' => t('In-Page Sitemap'));
if (is_object($pagetype) && $pagetype->getPageTypePublishTargetTypeID() == $type->getPageTypePublishTargetTypeID()) {
$configuredTarget = $pagetype->getPageTypePublishTargetObject();
$ptID = $configuredTarget->getPageTypeID();
$startingPointPageID = $configuredTarget->getStartingPointPageID();
$selectorFormFactor = $configuredTarget->getSelectorFormFactor();
}
?>
<div class="form-group">
<?php
echo $form->label('ptID', t('Publish Beneath Pages of Type'));
?>
<?php
echo $form->select('ptID', $types, $ptID);
?>
</div>
<div class="form-group">
<?php
echo $form->label('selectorFormFactorPageType', t('Selector Form Factor'));