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


PHP Key\Category类代码示例

本文整理汇总了PHP中Concrete\Core\Attribute\Key\Category的典型用法代码示例。如果您正苦于以下问题:PHP Category类的具体用法?PHP Category怎么用?PHP Category使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: update

 public function update($akID = null)
 {
     $this->edit($akID);
     $key = CollectionKey::getByID($akID);
     $category = Category::getByHandle('collection');
     $this->executeUpdate($key, \URL::to('/dashboard/pages/attributes', 'view'));
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:7,代码来源:attributes.php

示例2: installAttributeType

 protected function installAttributeType($pkg)
 {
     $attributeHandle = 'related_pages';
     \Loader::model('attribute/categories/collection');
     AttributeType::add($attributeHandle, t('Related Pages'), \Package::getByHandle($this->pkgHandle));
     AttributeKeyCategory::getByHandle('collection')->associateAttributeKeyType(AttributeType::getByHandle($attributeHandle));
 }
开发者ID:YumpDigital,项目名称:concrete5-package-related-pages,代码行数:7,代码来源:controller.php

示例3: execute

 public function execute(Batch $batch)
 {
     $sets = $batch->getObjectCollection('attribute_set');
     if (!$sets) {
         return;
     }
     foreach ($sets->getSets() as $set) {
         $akc = Category::getByHandle($set->getCategory());
         if (!$set->getPublisherValidator()->skipItem()) {
             $pkg = null;
             if ($set->getPackage()) {
                 $pkg = \Package::getByHandle($set->getPackage());
             }
             $setObject = $akc->addSet($set->getHandle(), $set->getName(), $pkg, intval($set->getIsLocked()));
         } else {
             $setObject = \Concrete\Core\Attribute\Set::getByHandle($set->getHandle());
         }
         if (is_object($setObject)) {
             $attributes = $set->getAttributes();
             foreach ($attributes as $handle) {
                 $ak = $akc->getAttributeKeyByHandle($handle);
                 if (is_object($ak)) {
                     $setObject->addKey($ak);
                 }
             }
         }
     }
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:28,代码来源:CreateAttributeSetsRoutine.php

示例4: install

 public function install()
 {
     $pkg = parent::install();
     \Loader::model('attribute/categories/collection');
     $col = AttributeKeyCategory::getByHandle('collection');
     $at = AttributeType::add('icon_selector', t('Icon Selector'), $pkg);
     $col->associateAttributeKeyType($at);
 }
开发者ID:Bloodb0ne,项目名称:Concrete5_DevRepo,代码行数:8,代码来源:controller.php

示例5: setUp

 protected function setUp()
 {
     parent::setUp();
     Category::add('collection');
     Page::addHomePage();
     PageTemplate::add('full', 'Full');
     PageType::add(array('handle' => 'basic', 'name' => 'Basic'));
 }
开发者ID:masteramuk,项目名称:concrete5,代码行数:8,代码来源:PageTestCase.php

示例6: exportAll

 public function exportAll()
 {
     $this->x = $this->getXMLRoot();
     // First, attribute categories
     AttributeKeyCategory::exportList($this->x);
     // Features
     Feature::exportList($this->x);
     FeatureCategory::exportList($this->x);
     ConversationEditor::exportList($this->x);
     ConversationRatingType::exportList($this->x);
     // composer
     PageTypePublishTargetType::exportList($this->x);
     PageTypeComposerControlType::exportList($this->x);
     PageType::exportList($this->x);
     // attribute types
     AttributeType::exportList($this->x);
     // then block types
     BlockTypeList::exportList($this->x);
     // now block type sets (including user)
     BlockTypeSet::exportList($this->x);
     // gathering
     GatheringDataSource::exportList($this->x);
     GatheringItemTemplate::exportList($this->x);
     // now attribute keys (including user)
     AttributeKey::exportList($this->x);
     // now attribute keys (including user)
     AttributeSet::exportList($this->x);
     PageTemplate::exportList($this->x);
     // now theme
     PageTheme::exportList($this->x);
     // now packages
     PackageList::export($this->x);
     // permission access entity types
     PermissionAccessEntityType::exportList($this->x);
     // now task permissions
     PermissionKey::exportList($this->x);
     // workflow types
     WorkflowType::exportList($this->x);
     // now jobs
     Job::exportList($this->x);
     // now single pages
     $singlepages = $this->x->addChild("singlepages");
     $db = Loader::db();
     $r = $db->Execute('select cID from Pages where cFilename is not null and cFilename <> "" and cID not in (select cID from Stacks) order by cID asc');
     while ($row = $r->FetchRow()) {
         $pc = Page::getByID($row['cID'], 'RECENT');
         $pc->export($singlepages);
     }
     // now stacks/global areas
     StackList::export($this->x);
     // now content pages
     $this->exportPages($this->x);
     SystemCaptchaLibrary::exportList($this->x);
     \Concrete\Core\Sharing\SocialNetwork\Link::exportList($this->x);
     \Concrete\Core\Page\Feed::exportList($this->x);
     \Concrete\Core\File\Image\Thumbnail\Type\Type::exportList($this->x);
     Tree::exportList($this->x);
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:58,代码来源:ContentExporter.php

示例7: view

 public function view($ptID = false)
 {
     $this->setupPageType($ptID);
     $this->requireAsset('core/app/editable-fields');
     $this->set('pagetype', $this->pagetype);
     $this->set('defaultPage', $this->defaultPage);
     $category = AttributeKeyCategory::getByHandle('collection');
     $this->set('category', $category);
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:9,代码来源:attributes.php

示例8: getList

 public function getList($akCategoryHandle = false)
 {
     $r = $this->entityManager->getRepository('\\Concrete\\Core\\Entity\\Attribute\\Type');
     if ($akCategoryHandle == false) {
         return $r->findAll();
     } else {
         $category = Category::getByHandle($akCategoryHandle);
         return $category->getAttributeTypes();
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:10,代码来源:TypeFactory.php

示例9: addAttributes

 private function addAttributes($pkg)
 {
     \Loader::model('attribute/categories/collection');
     $col = AttributeKeyCategory::getByHandle('collection');
     $fileSelector = AttributeType::add('multifile_picker', t('Multiple File Picker'), $pkg);
     $col->associateAttributeKeyType($fileSelector);
     $userSelector = AttributeType::add('multiuser_picker', t('Multiple User Picker'), $pkg);
     $col->associateAttributeKeyType($userSelector);
     $pageSelector = AttributeType::add('multipage_picker', t('Multiple Page Picker'), $pkg);
     $col->associateAttributeKeyType($pageSelector);
 }
开发者ID:Bloodb0ne,项目名称:Concrete5_DevRepo,代码行数:11,代码来源:controller.php

示例10: setUp

 protected function setUp()
 {
     $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'FileImageThumbnailTypes', 'FilePermissionAssignments', 'AttributeKeyCategories', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'AttributeValues', 'atNumber', 'Logs', 'FileVersionLog'));
     parent::setUp();
     Config::set('concrete.upload.extensions', '*.txt;*.jpg;*.jpeg;*.png');
     $category = Category::add('file');
     $number = AttributeType::add('number', 'Number');
     FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
     FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
     CacheLocal::flush();
 }
开发者ID:masteramuk,项目名称:concrete5,代码行数:11,代码来源:ImporterTest.php

示例11: setUp

 protected function setUp()
 {
     $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'FileImageThumbnailTypes', 'FilePermissionAssignments', 'AttributeKeyCategories', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'SystemContentEditorSnippets', 'AttributeValues', 'atNumber', 'FileVersionLog'));
     parent::setUp();
     define('UPLOAD_FILE_EXTENSIONS_ALLOWED', '*.txt;*.jpg;*.jpeg;*.png');
     Category::add('file');
     $number = AttributeType::add('number', 'Number');
     FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
     FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
     CacheLocal::flush();
 }
开发者ID:JeRoNZ,项目名称:concrete5-1,代码行数:11,代码来源:ContentFileTranslateTest.php

示例12: 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);
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:11,代码来源:attributes.php

示例13: getResults

 public function getResults(Request $request)
 {
     $list = Category::getList();
     $items = array();
     foreach ($list as $t) {
         $item = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\AttributeKeyCategory();
         $item->setItemId($t->getAttributeKeyCategoryID());
         $items[] = $item;
     }
     return $items;
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:11,代码来源:AttributeKeyCategory.php

示例14: import

 public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->attributecategories)) {
         foreach ($sx->attributecategories->category as $akc) {
             $pkg = static::getPackageObject($akc['package']);
             $akx = \Concrete\Core\Attribute\Key\Category::getByHandle($akc['handle']);
             if (!is_object($akx)) {
                 $akx = \Concrete\Core\Attribute\Key\Category::add((string) $akc['handle'], (string) $akc['allow-sets'], $pkg);
             }
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:12,代码来源:ImportAttributeCategoriesRoutine.php

示例15: save_attribute_type_associations

 public function save_attribute_type_associations()
 {
     $list = Category::getList();
     foreach ($list as $cat) {
         $cat->clearAttributeKeyCategoryTypes();
         if (is_array($this->post($cat->getAttributeKeyCategoryHandle()))) {
             foreach ($this->post($cat->getAttributeKeyCategoryHandle()) as $id) {
                 $type = Type::getByID($id);
                 $cat->associateAttributeKeyType($type);
             }
         }
     }
     $this->redirect('dashboard/system/attributes/types', 'saved', 'associations_updated');
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:14,代码来源:types.php


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