本文整理汇总了PHP中Concrete\Core\Attribute\Type::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getList方法的具体用法?PHP Type::getList怎么用?PHP Type::getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Concrete\Core\Attribute\Type
的用法示例。
在下文中一共展示了Type::getList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_start
public function on_start()
{
parent::on_start();
$this->set('category', AttributeKeyCategory::getByHandle('user'));
$otypes = AttributeType::getList('user');
$types = array();
foreach ($otypes as $at) {
$types[$at->getAttributeTypeID()] = $at->getAttributeTypeDisplayName();
}
$this->set('types', $types);
}
示例2: view
public function view()
{
$this->set('category', AttributeKeyCategory::getByHandle('store_product'));
$attrTypes = AttributeType::getList('store_product');
$types = array();
foreach ($attrTypes as $at) {
$types[$at->getAttributeTypeID()] = $at->getAttributeTypeName();
}
$attrList = StoreProductKey::getList();
$this->set('attrList', $attrList);
$this->set('types', $types);
}
示例3: t
<?php
defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Attribute\Type as AttributeType;
use Concrete\Core\Attribute\Key\Category as AttributeKeyCategory;
use Concrete\Core\Attribute\PendingType as PendingAttributeType;
$types = AttributeType::getList();
$categories = AttributeKeyCategory::getList();
$txt = Loader::helper('text');
$form = Loader::helper('form');
$interface = Loader::helper('concrete/ui');
echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Attribute Type Associations'), false, 'span10 offset1');
?>
<form method="post" class="" id="attribute_type_associations_form" action="<?php
echo $view->action('save_attribute_type_associations');
?>
">
<table border="0" cellspacing="1" cellpadding="0" border="0" class="table">
<tr>
<th><?php
echo t('Name');
?>
</th>
<?php
foreach ($categories as $cat) {
?>
<th><?php
echo $txt->unhandle($cat->getAttributeKeyCategoryHandle());
?>
</th>
<?php
示例4: edit
public function edit()
{
$this->loadResultsFolderInformation();
$this->requireAsset('core/tree');
$this->clearSessionControls();
$list = Type::getList();
$attribute_fields = array();
foreach ($list as $type) {
$attribute_fields[] = ['id' => 'attribute_key|' . $type->getAttributeTypeID(), 'displayName' => $type->getAttributeTypeDisplayName()];
}
$select = array();
$select[0] = new \stdClass();
$select[0]->label = t('Input Field Types');
$select[0]->fields = $attribute_fields;
$other_fields = array();
$other_fields[] = ['id' => 'entity_property|text', 'displayName' => t('Display Text')];
$select[1] = new \stdClass();
$select[1]->label = t('Other Fields');
$select[1]->fields = $other_fields;
$controls = array();
$form = $this->getFormEntity();
if (is_object($form)) {
$entity = $form->getEntity();
$controls = $form->getControls();
$this->set('formName', $entity->getName());
$this->set('submitLabel', $this->submitLabel);
$node = Node::getByID($entity->getEntityResultsNodeId());
if (is_object($node)) {
$folder = $node->getTreeNodeParentObject();
$this->set('resultsFolder', $folder->getTreeNodeID());
}
}
$this->set('controls', $controls);
$this->set('types_select', $select);
$tree = ExpressEntryResults::get();
$this->set('tree', $tree);
}
示例5: installSite
protected function installSite()
{
$this->output(t('Installing Site object...'));
/**
* @var $service Service
*/
$service = \Core::make('site');
$site = $service->getDefault();
$em = $this->connection->getEntityManager();
$type_service = \Core::make('site/type');
$type = $type_service->getDefault();
if (!is_object($type)) {
$type = $type_service->installDefault();
}
if (!is_object($site) || $site->getSiteID() < 1) {
$locale = 'en_US';
if (\Config::get('concrete.multilingual.default_locale')) {
$locale = \Config::get('concrete.multilingual.default_locale');
}
$site = $service->installDefault($locale);
// migrate name
$site->setSiteName(\Config::get('concrete.site'));
// migrate theme
$c = \Page::getByID(HOME_CID);
$site->setThemeID($c->getCollectionThemeID());
$em->persist($site);
$em->flush();
}
$site = $service->getDefault();
$this->connection->executeQuery('update Pages set siteTreeID = ? where cIsSystemPage = 0', [$site->getSiteTreeID()]);
$this->connection->executeQuery('update Stacks set siteTreeID = ?', [$site->getSiteTreeID()]);
$this->connection->executeQuery('update PageTypes set siteTypeID = ? where ptIsInternal = 0', [$type->getSiteTypeID()]);
// migrate social links
$links = $em->getRepository('Concrete\\Core\\Entity\\Sharing\\SocialNetwork\\Link')->findAll();
foreach ($links as $link) {
$link->setSite($site);
$em->persist($link);
}
$em->flush();
$category = Category::getByHandle('site');
if (!is_object($category)) {
$category = Category::add('site');
} else {
$category = $category->getController();
}
$types = Type::getList();
foreach ($types as $type) {
$category->associateAttributeKeyType($type);
}
$siteConfig = $site->getConfigRepository();
// migrate bookmark icons
$favicon_fid = \Config::get('concrete.misc.favicon_fid');
if ($favicon_fid) {
$siteConfig->save('misc.favicon_fid', $favicon_fid);
}
$iphone_home_screen_thumbnail_fid = \Config::get('concrete.misc.iphone_home_screen_thumbnail_fid');
if ($iphone_home_screen_thumbnail_fid) {
$siteConfig->save('misc.iphone_home_screen_thumbnail_fid', $iphone_home_screen_thumbnail_fid);
}
$modern_tile_thumbnail_fid = \Config::get('concrete.misc.modern_tile_thumbnail_fid');
if ($modern_tile_thumbnail_fid) {
$siteConfig->save('misc.modern_tile_thumbnail_fid', $modern_tile_thumbnail_fid);
}
$modern_tile_thumbnail_bgcolor = \Config::get('concrete.misc.modern_tile_thumbnail_bgcolor');
if ($modern_tile_thumbnail_bgcolor) {
$siteConfig->save('misc.modern_tile_thumbnail_bgcolor', $modern_tile_thumbnail_bgcolor);
}
// migrate url
$canonical_url = \Config::get('seo.canonical_url');
if ($canonical_url) {
$siteConfig->save('seo.canonical_url', $canonical_url);
}
$canonical_ssl_url = \Config::get('seo.canonical_ssl_url');
if ($canonical_ssl_url) {
$siteConfig->save('seo.canonical_ssl_url', $canonical_ssl_url);
}
// migrate tracking code
$header = \Config::get('seo.tracking.code.header');
if ($header) {
$siteConfig->save('seo.tracking.code.header', $header);
}
$footer = \Config::get('seo.tracking.code.footer');
if ($footer) {
$siteConfig->save('seo.tracking.code.footer', $footer);
}
// migrate public profiles
$r = \Config::get('concrete.user.profiles_enabled');
if ($r) {
$siteConfig->save('user.profiles_enabled', $r);
}
$r = \Config::get('concrete.user.gravatar.enabled');
if ($r) {
$siteConfig->save('user.gravatar.enabled', $r);
}
$r = \Config::get('concrete.user.gravatar.max_level');
if ($r) {
$siteConfig->save('user.gravatar.max_level', $r);
}
$r = \Config::get('concrete.user.gravatar.image_set');
if ($r) {
//.........这里部分代码省略.........
示例6: getAttributeTypes
protected function getAttributeTypes()
{
$attributeFormTypes = AttributeType::getList('attribute_form');
$types = array();
foreach ($attributeFormTypes as $attributeFormType) {
$types[$attributeFormType->getAttributeTypeID()] = $attributeFormType->getAttributeTypeDisplayName();
}
return $types;
}