本文整理汇总了PHP中CollectionType::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CollectionType::getList方法的具体用法?PHP CollectionType::getList怎么用?PHP CollectionType::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CollectionType
的用法示例。
在下文中一共展示了CollectionType::getList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_start
function on_start()
{
$cts = array();
Loader::model('collection_types');
$list = CollectionType::getList();
//this just lists out the page_types in concrete5, nothing hard
foreach ($list as $ct) {
$cts[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
}
$this->set('collectiontypes', $cts);
}
示例2: setupForm
protected function setupForm()
{
$this->loadNewsSections();
Loader::model("collection_types");
$ctArray = CollectionType::getList('');
$pageTypes = array();
foreach ($ctArray as $ct) {
$pageTypes[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
}
$this->set('pageTypes', $pageTypes);
$this->addHeaderItem(Loader::helper('html')->javascript('tiny_mce/tiny_mce.js'));
}
示例3: swapContent
public function swapContent($options)
{
if ($this->validateClearSiteContents($options)) {
Loader::model("page_list");
Loader::model("file_list");
Loader::model("stack/list");
$pl = new PageList();
$pages = $pl->get();
foreach ($pages as $c) {
$c->delete();
}
$fl = new FileList();
$files = $fl->get();
foreach ($files as $f) {
$f->delete();
}
// clear stacks
$sl = new StackList();
foreach ($sl->get() as $c) {
$c->delete();
}
$home = Page::getByID(HOME_CID);
$blocks = $home->getBlocks();
foreach ($blocks as $b) {
$b->deleteBlock();
}
$pageTypes = CollectionType::getList();
foreach ($pageTypes as $ct) {
$ct->delete();
}
// now we add in any files that this package has
if (is_dir($this->getPackagePath() . '/content_files')) {
Loader::library('file/importer');
$fh = new FileImporter();
$contents = Loader::helper('file')->getDirectoryContents($this->getPackagePath() . '/content_files');
foreach ($contents as $filename) {
$f = $fh->import($this->getPackagePath() . '/content_files/' . $filename, $filename);
}
}
// now we parse the content.xml if it exists.
Loader::library('content/importer');
$ci = new ContentImporter();
$ci->importContentFile($this->getPackagePath() . '/content.xml');
}
}
示例4: array
?>
<div class="controls">
<?php
echo $form->text('cvName', $searchRequest['cvName'], array('style' => 'width: 120px'));
?>
</div>
</div>
<div class="span3">
<?php
echo $form->label('ctID', t('Page Type'));
?>
<div class="controls">
<?
Loader::model('collection_types');
$ctl = CollectionType::getList();
$ctypes = array('' => t('** All'));
foreach($ctl as $ct) {
$ctypes[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
}
print $form->select('ctID', $ctypes, $searchRequest['ctID'], array('style' => 'width:120px'))?>
</div>
</div>
<div class="span3">
<?php
echo $form->label('numResults', t('# Per Page'));
?>
<div class="controls">
示例5: defined
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<?php $c = Page::getCurrentPage(); ?>
<ul id="ccm-pagelist-tabs" class="ccm-dialog-tabs">
<li class="ccm-nav-active"><a id="ccm-pagelist-tab-add" href="javascript:void(0);"><?php echo ($bID>0)? t('Edit') : t('Add') ?></a></li>
<li class=""><a id="ccm-pagelist-tab-preview" href="javascript:void(0);"><?php echo t('Preview')?></a></li>
</ul>
<input type="hidden" name="pageListToolsDir" value="<?php echo $uh->getBlockTypeToolsURL($bt)?>/" />
<div id="ccm-pagelistPane-add" class="ccm-pagelistPane">
<div class="ccm-block-field-group">
<h2><?php echo t('Number and Type of Pages')?></h2>
<?php echo t('Display')?>
<input type="text" name="num" value="<?php echo $num?>" style="width: 30px">
<?php echo t('pages of type')?>
<?php
$ctArray = CollectionType::getList();
if (is_array($ctArray)) { ?>
<select name="ctID" id="selectCTID">
<option value="0">** <?php echo t('All')?> **</option>
<?php foreach ($ctArray as $ct) { ?>
<option value="<?php echo $ct->getCollectionTypeID()?>" <?php if ($ctID == $ct->getCollectionTypeID()) { ?> selected <?php } ?>>
<?php echo $ct->getCollectionTypeName()?>
</option>
<?php } ?>
</select>
<?php } ?>
<h2><?php echo t('Filter')?></h2>
<?php
示例6: getFilesInTheme
public function getFilesInTheme() {
Loader::model('collection_types');
Loader::model('single_page');
$dh = Loader::helper('file');
$ctlist = CollectionType::getList();
$cts = array();
foreach($ctlist as $ct) {
$cts[] = $ct->getCollectionTypeHandle();
}
$filesTmp = $dh->getDirectoryContents($this->ptDirectory);
foreach($filesTmp as $f) {
if (strrchr($f, '.') == PageTheme::THEME_EXTENSION) {
$fHandle = substr($f, 0, strpos($f, '.'));
if ($f == FILENAME_THEMES_VIEW) {
$type = PageThemeFile::TFTYPE_VIEW;
} else if ($f == FILENAME_THEMES_DEFAULT) {
$type = PageThemeFile::TFTYPE_DEFAULT;
} else if (in_array($f, SinglePage::getThemeableCorePages())) {
$type = PageThemeFile::TFTYPE_SINGLE_PAGE;
} else if (in_array($fHandle, $cts)) {
$type = PageThemeFile::TFTYPE_PAGE_TYPE_EXISTING;
} else {
$type = PageThemeFile::TFTYPE_PAGE_TYPE_NEW;
}
$pf = new PageThemeFile();
$pf->setFilename($f);
$pf->setType($type);
$files[] = $pf;
}
}
return $files;
}
示例7: defined
<?
defined('C5_EXECUTE') or die("Access Denied.");
Loader::model('collection_types');
$stringHelper=Loader::helper('text');
$tArray = PageTheme::getGlobalList();
$tArray2 = PageTheme::getLocalList();
$tArray = array_merge($tArray, $tArray2);
$ctArray = CollectionType::getList($c->getAllowedSubCollections());
$cp = new Permissions($c);
if ($c->getCollectionID() > 1) {
$parent = Page::getByID($c->getCollectionParentID());
$parentCP = new Permissions($parent);
}
if (!$cp->canAdminPage()) {
die(t('Access Denied'));
}
$cnt = 0;
for ($i = 0; $i < count($ctArray); $i++) {
$ct = $ctArray[$i];
if ($c->getCollectionID() == 1 || $parentCP->canAddSubCollection($ct)) {
$cnt++;
}
}
$plID = $c->getCollectionThemeID();
$ctID = $c->getCollectionTypeID();
if ($plID == 0) {
$pl = PageTheme::getSiteTheme();
示例8: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>
<?php
$included = $permissionAccess->getAccessListItems();
$excluded = $permissionAccess->getAccessListItems(PermissionKey::ACCESS_TYPE_EXCLUDE);
$pageTypes = CollectionType::getList();
$form = Loader::helper('form');
?>
<?php
if (count($included) > 0 || count($excluded) > 0) {
?>
<?php
if (count($included) > 0) {
?>
<h3><?php
echo t('Who can add what?');
?>
</h3>
<?php
foreach ($included as $assignment) {
$entity = $assignment->getAccessEntityObject();
?>