• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Key\Category类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getResults

 public function getResults(Request $request)
 {
     $category = Category::getByID($request->query->get('akCategoryID'));
     $items = array();
     if (is_object($category)) {
         $keys = Key::getAttributeKeyList($category->getAttributeKeyCategoryHandle());
         foreach ($keys as $key) {
             $item = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\AttributeKey();
             $item->setItemId($key->getAttributeKeyID());
             $items[] = $item;
         }
     }
     return $items;
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:14,代码来源:AttributeKey.php


示例17: import

 public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->attributekeys)) {
         foreach ($sx->attributekeys->attributekey as $ak) {
             $akc = \Concrete\Core\Attribute\Key\Category::getByHandle($ak['category']);
             $controller = $akc->getController();
             $attribute = $controller->getAttributeKeyByHandle((string) $ak['handle']);
             if (!$attribute) {
                 $pkg = static::getPackageObject($ak['package']);
                 $type = Type::getByHandle((string) $ak['type']);
                 $key = $controller->import($type, $ak, $pkg);
             }
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:15,代码来源:ImportAttributesRoutine.php


示例18: execute

 public function execute(Batch $batch)
 {
     $categories = $batch->getObjectCollection('attribute_key_category');
     if (!$categories) {
         return;
     }
     foreach ($categories->getCategories() as $category) {
         if (!$category->getPublisherValidator()->skipItem()) {
             $pkg = null;
             if ($category->getPackage()) {
                 $pkg = \Package::getByHandle($category->getPackage());
             }
             Category::add($category->getHandle(), $category->getAllowSets(), $pkg);
         }
     }
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:16,代码来源:CreateAttributeCategoriesRoutine.php


示例19: installAttributeKeys

 private function installAttributeKeys($pkg)
 {
     $dbTableDemoAT = AttributeType::getByHandle("db_table_demo");
     if (!$dbTableDemoAT) {
         $dbTableDemoAT = AttributeType::add("db_table_demo", "Database Table Demo", $pkg);
         $cakc = AttributeKeyCategory::getByHandle('collection');
         $cakc->associateAttributeKeyType($dbTableDemoAT);
         $uakc = AttributeKeyCategory::getByHandle('user');
         $uakc->associateAttributeKeyType($dbTableDemoAT);
         $fakc = AttributeKeyCategory::getByHandle('file');
         $fakc->associateAttributeKeyType($dbTableDemoAT);
     }
     $this->addPageAttributeKeys($pkg);
     $this->addUserAttributeKeys($pkg);
     $this->addFileAttributeKeys($pkg);
 }
开发者ID:herent,项目名称:c5_tutorials_database_attribute,代码行数:16,代码来源:controller.php


示例20: view

 public function view()
 {
     $pk = PermissionKey::getByHandle('edit_page_properties');
     $pk->setPermissionObject($this->page);
     $assignment = $pk->getMyAssignment();
     $allowed = $assignment->getAttributesAllowedArray();
     $category = AttributeKeyCategory::getByHandle('collection');
     $controller = $category->getController();
     $sets = $controller->getSetManager()->getAttributeSets();
     $leftovers = $controller->getSetManager()->getUnassignedAttributeKeys();
     $selectedAttributes = $this->page->getSetCollectionAttributes();
     $selectedAttributeIDs = array();
     foreach ($selectedAttributes as $ak) {
         $selectedAttributeIDs[] = $ak->getAttributeKeyID();
     }
     $data = array();
     foreach ($sets as $set) {
         $obj = new stdClass();
         $obj->title = $set->getAttributeSetDisplayName();
         $obj->attributes = array();
         foreach ($set->getAttributeKeys() as $ak) {
             if (in_array($ak->getAttributeKeyID(), $allowed)) {
                 $obj->attributes[] = $ak;
             }
         }
         if (count($obj->attributes)) {
             $data[] = $obj;
         }
     }
     if (count($leftovers)) {
         $obj = new stdClass();
         $obj->title = t('Other');
         $obj->attributes = array();
         foreach ($leftovers as $ak) {
             if (in_array($ak->getAttributeKeyID(), $allowed)) {
                 $obj->attributes[] = $ak;
             }
         }
         if (count($obj->attributes)) {
             $data[] = $obj;
         }
     }
     $this->set('selectedAttributeIDs', $selectedAttributeIDs);
     $this->set('assignment', $assignment);
     $this->set('attributes', $data);
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:46,代码来源:attributes.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Block\BlockController类代码示例发布时间:2022-05-23
下一篇:
PHP Attribute\Type类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap