本文整理汇总了PHP中AttributeKeyCategory类的典型用法代码示例。如果您正苦于以下问题:PHP AttributeKeyCategory类的具体用法?PHP AttributeKeyCategory怎么用?PHP AttributeKeyCategory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AttributeKeyCategory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: installOrUpgrade
private function installOrUpgrade($pkg, $fromVersion)
{
$at = AttributeType::getByHandle('handle_https');
if (!is_object($at)) {
$at = AttributeType::add('handle_https', tc('AttributeTypeName', 'HTTPS handling'), $pkg);
}
$akc = AttributeKeyCategory::getByHandle('collection');
if (is_object($akc)) {
if (!$akc->hasAttributeKeyTypeAssociated($at)) {
$akc->associateAttributeKeyType($at);
}
}
if (empty($fromVersion)) {
$ak = CollectionAttributeKey::getByHandle('handle_https');
if (!is_object($ak)) {
$hhh = Loader::helper('https_handling', 'handle_https');
/* @var $hhh HttpsHandlingHelper */
$httpDomain = defined('BASE_URL') ? BASE_URL : Config::get('BASE_URL');
if (!$httpDomain) {
$httpDomain = 'http://' . $hhh->getRequestDomain();
}
$httpsDomain = defined('BASE_URL_SSL') ? BASE_URL_SSL : Config::get('BASE_URL_SSL');
if (!$httpsDomain) {
$httpsDomain = 'https://' . $hhh->getRequestDomain();
}
$ak = CollectionAttributeKey::add($at, array('akHandle' => 'handle_https', 'akName' => tc('AttributeKeyName', 'Page HTTP/HTTPS'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1, 'akIsAutoCreated' => 1, 'akIsEditable' => 1, 'akIsInternal' => 0, 'akEnabled' => 0, 'akDefaultRequirement' => HttpsHandlingHelper::SSLHANDLING_DOESNOT_MATTER, 'akCustomDomains' => 0, 'akHTTPDomain' => $httpDomain, 'akHTTPSDomain' => $httpsDomain), $pkg);
}
}
}
开发者ID:mlocati,项目名称:concrete5-handle_https,代码行数:29,代码来源:controller.php
示例2: install
public function install()
{
$pkg = parent::install();
$pkgh = Package::getByHandle('page_selector_attribute');
Loader::model('attribute/categories/collection');
$col = AttributeKeyCategory::getByHandle('collection');
$pageselector = AttributeType::add('page_selector', t('Page Selector'), $pkgh);
$col->associateAttributeKeyType(AttributeType::getByHandle('page_selector'));
}
开发者ID:WillemAnchor,项目名称:page_selector_attribute,代码行数:9,代码来源:controller.php
示例3: parseManual
/**
* {@inheritdoc}
*
* @see \C5TL\Parser\DynamicItem::parseManual()
*/
public function parseManual(\Gettext\Translations $translations, $concrete5version)
{
if (class_exists('\\AttributeKeyCategory', true) && class_exists('\\AttributeSet', true)) {
foreach (\AttributeKeyCategory::getList() as $akc) {
foreach ($akc->getAttributeSets() as $as) {
$this->addTranslation($translations, $as->getAttributeSetName(), 'AttributeSetName');
}
}
}
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:15,代码来源:AttributeSet.php
示例4: run
public function run()
{
$this->x = new SimpleXMLElement("<concrete5-cif></concrete5-cif>");
$this->x->addAttribute('version', '1.0');
// First, attribute categories
AttributeKeyCategory::exportList($this->x);
// attribute types
AttributeType::exportList($this->x);
// then block types
BlockTypeList::exportList($this->x);
// now attribute keys (including user)
AttributeKey::exportList($this->x);
// now attribute keys (including user)
AttributeSet::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
Loader::model('job');
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 page types
CollectionType::exportList($this->x);
// now stacks/global areas
Loader::model('stack/list');
StackList::export($this->x);
// now content pages
$pages = $this->x->addChild("pages");
$db = Loader::db();
$r = $db->Execute('select Pages.cID from Pages left join ComposerDrafts on Pages.cID = ComposerDrafts.cID where ComposerDrafts.cID is null and cIsTemplate = 0 and cFilename is null or cFilename = "" order by cID asc');
while ($row = $r->FetchRow()) {
$pc = Page::getByID($row['cID'], 'RECENT');
$pc->export($pages);
}
Loader::model("system/captcha/library");
SystemCaptchaLibrary::exportList($this->x);
Config::exportList($this->x);
}
开发者ID:Mihail9575,项目名称:concrete5,代码行数:52,代码来源:exporter.php
示例5: getAttributeKeys
public function getAttributeKeys() {
$db = Loader::db();
$r = $db->Execute('select akID from AttributeSetKeys where asID = ? order by displayOrder asc', $this->getAttributeSetID());
$keys = array();
$cat = AttributeKeyCategory::getByID($this->akCategoryID);
while ($row = $r->FetchRow()) {
$ak = $cat->getAttributeKeyByID($row['akID']);
if (is_object($ak)) {
$keys[] = $ak;
}
}
return $keys;
}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:13,代码来源:set.php
示例6: save_attribute_type_associations
public function save_attribute_type_associations()
{
$list = AttributeKeyCategory::getList();
foreach ($list as $cat) {
$cat->clearAttributeKeyCategoryTypes();
if (is_array($this->post($cat->getAttributeKeyCategoryHandle()))) {
foreach ($this->post($cat->getAttributeKeyCategoryHandle()) as $id) {
$type = AttributeType::getByID($id);
$cat->associateAttributeKeyType($type);
}
}
}
$this->redirect('dashboard/system/attributes/types', 'saved', 'associations_updated');
}
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:14,代码来源:types.php
示例7: parseManual
/**
* @see \C5TL\Parser\DynamicItem::parseManual()
*/
public function parseManual(\Gettext\Translations $translations, $concrete5version)
{
if (class_exists('\\AttributeKeyCategory', true) && class_exists('\\AttributeKey', true) && class_exists('\\AttributeType', true)) {
foreach (\AttributeKeyCategory::getList() as $akc) {
$akcHandle = $akc->getAttributeKeyCategoryHandle();
foreach (\AttributeKey::getList($akcHandle) as $ak) {
if ($ak->getAttributeType()->getAttributeTypeHandle() === 'select') {
foreach ($ak->getController()->getOptions() as $option) {
$this->addTranslation($translations, $option->getSelectAttributeOptionValue(false), 'SelectAttributeValue');
}
}
}
}
}
}
开发者ID:ngreimel,项目名称:kovent,代码行数:18,代码来源:SelectAttributeValue.php
示例8: exportAll
public function exportAll()
{
$this->x = $this->getXMLRoot();
// First, attribute categories
AttributeKeyCategory::exportList($this->x);
// attribute types
AttributeType::exportList($this->x);
// then block types
BlockTypeList::exportList($this->x);
// now attribute keys (including user)
AttributeKey::exportList($this->x);
// now attribute keys (including user)
AttributeSet::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
Loader::model('job');
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 page types
CollectionType::exportList($this->x);
// now stacks/global areas
Loader::model('stack/list');
StackList::export($this->x);
$this->exportPages($this->x);
Loader::model("system/captcha/library");
SystemCaptchaLibrary::exportList($this->x);
Config::exportList($this->x);
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:44,代码来源:exporter.php
示例9: installPageLinkAttribute
private function installPageLinkAttribute(&$pkg)
{
$at = AttributeType::getByHandle('page_selector');
if ($at && intval($at->getAttributeTypeID())) {
//Associate with "file" category (if not done alrady)
Loader::model('attribute/categories/collection');
$akc = AttributeKeyCategory::getByHandle('file');
$sql = 'SELECT COUNT(*) FROM AttributeTypeCategories WHERE atID = ? AND akCategoryID = ?';
$vals = array($at->getAttributeTypeID(), $akc->akCategoryID);
$existsInCategory = Loader::db()->GetOne($sql, $vals);
if (!$existsInCategory) {
$akc->associateAttributeKeyType($at);
}
//Install the link-to-page attribute (if not done already)
Loader::model('file_attributes');
$akHandle = 'gallery_link_to_cid';
$akGalleryLinkToCID = FileAttributeKey::getByHandle($akHandle);
if (!is_object($akGalleryLinkToCID) || !intval($akGalleryLinkToCID->getAttributeKeyID())) {
$akGalleryLinkToCID = FileAttributeKey::add($at, array('akHandle' => $akHandle, 'akName' => t('Gallery Link To Page')), $pkg);
}
}
}
开发者ID:robchenski,项目名称:ids,代码行数:22,代码来源:controller.php
示例10: on_start
public function on_start()
{
$this->set('disableThirdLevelNav', true);
$this->set('category', AttributeKeyCategory::getByHandle('collection'));
}
开发者ID:nveid,项目名称:concrete5,代码行数:5,代码来源:attributes.php
示例11: validateKey
public function validateKey($args = false) {
if ($args == false) {
$args = $this->post();
}
$val = Loader::helper('validation/form');
$valt = Loader::helper('validation/token');
$val->setData($args);
$val->addRequired("akHandle", t("Handle required."));
$val->addRequired("akName", t('Name required.'));
$val->addRequired("atID", t('Type required.'));
$val->test();
$error = $val->getError();
if (!$valt->validate('add_or_update_attribute')) {
$error->add($valt->getErrorMessage());
}
if(preg_match("/[^A-Za-z0-9\_]/", $args['akHandle'])) {
$error->add(t('Attribute handles may only contain letters, numbers and underscore "_" characters'));
}
$akc = AttributeKeyCategory::getByID($args['akCategoryID']);
if (is_object($akc)) {
if ($akc->handleExists($args['akHandle'])) {
if (is_object($this->attributeKey)) {
$ak2 = $akc->getAttributeKeyByHandle($args['akHandle']);
if ($ak2->getAttributeKeyID() != $this->attributeKey->getAttributeKeyID()) {
$error->add(t("An attribute with the handle %s already exists.", $akHandle));
}
} else {
$error->add(t("An attribute with the handle %s already exists.", $akHandle));
}
}
} else {
$error->add('Invalid attribute category.');
}
return $error;
}
开发者ID:ronlobo,项目名称:concrete5,代码行数:39,代码来源:controller.php
示例12: importAttributeSets
protected function importAttributeSets(SimpleXMLElement $sx) {
if (isset($sx->attributesets)) {
foreach($sx->attributesets->attributeset as $as) {
$akc = AttributeKeyCategory::getByHandle($as['category']);
$pkg = ContentImporter::getPackageObject($as['package']);
$set = $akc->addSet((string) $as['handle'], (string) $as['name'], $pkg, $as['locked']);
foreach($as->children() as $ask) {
$ak = $akc->getAttributeKeyByHandle((string) $ask['handle']);
if (is_object($ak)) {
$set->addKey($ak);
}
}
}
}
}
开发者ID:nveid,项目名称:concrete5,代码行数:15,代码来源:importer.php
示例13: getItemName
public static function getItemName($item) {
$txt = Loader::helper('text');
Loader::model('single_page');
Loader::model('dashboard/homepage');
if ($item instanceof BlockType) {
return $item->getBlockTypeName();
} else if ($item instanceof PageTheme) {
return $item->getThemeName();
} else if ($item instanceof CollectionType) {
return $item->getCollectionTypeName();
} else if ($item instanceof MailImporter) {
return $item->getMailImporterName();
} else if ($item instanceof SinglePage) {
return $item->getCollectionPath();
} else if ($item instanceof AttributeType) {
return $item->getAttributeTypeName();
} else if ($item instanceof AttributeKeyCategory) {
return $txt->unhandle($item->getAttributeKeyCategoryHandle());
} else if ($item instanceof AttributeSet) {
$at = AttributeKeyCategory::getByID($item->getAttributeSetKeyCategoryID());
return t('%s (%s)', $item->getAttributeSetName(), $txt->unhandle($at->getAttributeKeyCategoryHandle()));
} else if (is_a($item, 'AttributeKey')) {
$akc = AttributeKeyCategory::getByID($item->getAttributeKeyCategoryID());
return t(' %s (%s)', $txt->unhandle($item->getAttributeKeyHandle()), $txt->unhandle($akc->getAttributeKeyCategoryHandle()));
} else if ($item instanceof ConfigValue) {
return ucwords(strtolower($txt->unhandle($item->key)));
} else if ($item instanceof DashboardHomepage) {
return t('%s (%s)', $item->dbhDisplayName, $txt->unhandle($item->dbhModule));
} else if (is_a($item, 'TaskPermission')) {
return $item->getTaskPermissionName();
} else if (is_a($item, 'Job')) {
return $item->getJobName();
}
}
开发者ID:remkoj,项目名称:concrete5,代码行数:34,代码来源:package.php
示例14: installCoreAttributeItems
protected function installCoreAttributeItems() {
$cakc = AttributeKeyCategory::getByHandle('collection');
if (is_object($cakc)) {
return false;
}
$cakc = AttributeKeyCategory::add('collection');
$uakc = AttributeKeyCategory::add('user');
$fakc = AttributeKeyCategory::add('file');
$tt = AttributeType::add('text', t('Text'));
$textareat = AttributeType::add('textarea', t('Text Area'));
$boolt = AttributeType::add('boolean', t('Checkbox'));
$dtt = AttributeType::add('date_time', t('Date/Time'));
$ift = AttributeType::add('image_file', t('Image/File'));
$nt = AttributeType::add('number', t('Number'));
$rt = AttributeType::add('rating', t('Rating'));
$st = AttributeType::add('select', t('Select'));
$addresst = AttributeType::add('address', t('Address'));
// assign collection attributes
$cakc->associateAttributeKeyType($tt);
$cakc->associateAttributeKeyType($textareat);
$cakc->associateAttributeKeyType($boolt);
$cakc->associateAttributeKeyType($dtt);
$cakc->associateAttributeKeyType($ift);
$cakc->associateAttributeKeyType($nt);
$cakc->associateAttributeKeyType($rt);
$cakc->associateAttributeKeyType($st);
// assign user attributes
$uakc->associateAttributeKeyType($tt);
$uakc->associateAttributeKeyType($textareat);
$uakc->associateAttributeKeyType($boolt);
$uakc->associateAttributeKeyType($dtt);
$uakc->associateAttributeKeyType($nt);
$uakc->associateAttributeKeyType($st);
$uakc->associateAttributeKeyType($addresst);
// assign file attributes
$fakc->associateAttributeKeyType($tt);
$fakc->associateAttributeKeyType($textareat);
$fakc->associateAttributeKeyType($boolt);
$fakc->associateAttributeKeyType($dtt);
$fakc->associateAttributeKeyType($nt);
$fakc->associateAttributeKeyType($rt);
$fakc->associateAttributeKeyType($st);
}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:48,代码来源:version_532.php
示例15: foreach
</h3>
<form class="" method="post" action="<?php
echo $this->action('update_set_attributes');
?>
">
<input type="hidden" name="asID" value="<?php
echo $set->getAttributeSetID();
?>
" />
<?php
echo Loader::helper('validation/token')->output('update_set_attributes');
?>
<?php
$cat = AttributeKeyCategory::getByID($set->getAttributeSetKeyCategoryID());
$list = AttributeKey::getList($cat->getAttributeKeyCategoryHandle());
$unassigned = $cat->getUnassignedAttributeKeys();
if (count($list) > 0) {
?>
<div class="clearfix">
<ul class="inputs-list">
<?php
foreach ($list as $ak) {
$disabled = '';
if (!in_array($ak, $unassigned) && !$ak->inAttributeSet($set)) {
$disabled = array('disabled' => 'disabled');
}
?>
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:31,代码来源:sets.php
示例16: defined
<? defined('C5_EXECUTE') or die("Access Denied.");
$types = AttributeType::getList();
$categories = AttributeKeyCategory::getList();
$txt = Loader::helper('text');
$form = Loader::helper('form');
$interface = Loader::helper('concrete/interface');
echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Attribute Type Associations'), false, 'span12 offset2');?>
<form method="post" class="" id="attribute_type_associations_form" action="<?=$this->action('save_attribute_type_associations')?>">
<table border="0" cellspacing="1" cellpadding="0" border="0" class="zebra-striped">
<tr>
<th><?=t('Name')?></th>
<? foreach($categories as $cat) { ?>
<th><?=$txt->unhandle($cat->getAttributeKeyCategoryHandle())?></th>
<? } ?>
</tr>
<?php foreach($types as $at) { ?>
<tr>
<td><?=$at->getAttributeTypeName()?></td>
<? foreach($categories as $cat) { ?>
<td style="width: 1px; text-align: center"><?=$form->checkbox($cat->getAttributeKeyCategoryHandle() . '[]', $at->getAttributeTypeID(), $at->isAssociatedWithCategory($cat))?></td>
<? } ?>
</tr>
<? } ?>
</table>
<div class="well clearfix">
<?
开发者ID:nbourguig,项目名称:concrete5,代码行数:31,代码来源:types.php
示例17: update
/**
* Updates an attribute key.
*/
public function update($args)
{
$prevHandle = $this->getAttributeKeyHandle();
extract($args);
if (!$akIsSearchable) {
$akIsSearchable = 0;
}
if (!$akIsSearchableIndexed) {
$akIsSearchableIndexed = 0;
}
$db = Loader::db();
$akCategoryHandle = $db->GetOne("select akCategoryHandle from AttributeKeyCategories inner join AttributeKeys on AttributeKeys.akCategoryID = AttributeKeyCategories.akCategoryID where akID = ?", $this->getAttributeKeyID());
$a = array($akHandle, $akName, $akIsSearchable, $akIsSearchableIndexed, $this->getAttributeKeyID());
$r = $db->query("update AttributeKeys set akHandle = ?, akName = ?, akIsSearchable = ?, akIsSearchableIndexed = ? where akID = ?", $a);
$category = AttributeKeyCategory::getByID($this->akCategoryID);
switch ($category->allowAttributeSets()) {
case AttributeKeyCategory::ASET_ALLOW_SINGLE:
if ($asID > 0) {
$as = AttributeSet::getByID($asID);
if (!$this->inAttributeSet($as) && is_object($as)) {
$this->clearAttributeSets();
$this->setAttributeSet($as);
}
} else {
// clear set
$this->clearAttributeSets();
}
break;
}
if ($r) {
$txt = Loader::helper('text');
$className = $txt->camelcase($akCategoryHandle) . 'AttributeKey';
$ak = new $className();
$ak->load($this->getAttributeKeyID());
$at = $ak->getAttributeType();
$cnt = $at->getController();
$cnt->setAttributeKey($ak);
$cnt->saveKey($args);
$ak->updateSearchIndex($prevHandle);
return $ak;
}
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:45,代码来源:key.php
示例18: defined
defined('C5_EXECUTE') or die("Access Denied.");
Loader::model('user_attributes');
$form = Loader::helper('form');
$tp = new TaskPermission();
if (!$tp->canAccessUserSearch()) {
die(t("Access Denied."));
}
$selectedAKIDs = array();
$slist = UserAttributeKey::getColumnHeaderList();
foreach ($slist as $sk) {
$selectedAKIDs[] = $sk->getAttributeKeyID();
}
if ($_POST['task'] == 'update_columns') {
Loader::model('attribute/category');
$sc = AttributeKeyCategory::getByHandle('user');
$sc->clearAttributeKeyCategoryColumnHeaders();
if (is_array($_POST['akID'])) {
foreach ($_POST['akID'] as $akID) {
$ak = UserAttributeKey::getByID($akID);
$ak->setAttributeKeyColumnHeader(1);
}
}
exit;
}
$list = UserAttributeKey::getList();
?>
<form method="post" id="ccm-user-customize-search-columns-form" action="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:30,代码来源:customize_search_columns.php
示例19: installUserAttributes
private function installUserAttributes($pkg)
{
$uakc = AttributeKeyCategory::getByHandle('user');
// Multiple means an attribute can be in more than one set, but you
// can't choose what set they show up in for the gui
// $uakc->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_MULTIPLE);
// $uakc->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_NONE);
$uakc->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_SINGLE);
$bua = $uakc->addSet('c5_boilerplate_user_attributes', t('Boilerplate User Attributes'), $pkg);
//add boolean attributes
$bp_boolean = UserAttributeKey::getByHandle('bp_boolean');
if (!$bp_boolean instanceof UserAttributeKey) {
$bp_boolean = UserAttributeKey::add('boolean', array('akHandle' => 'bp_boolean', 'akName' => t('Boolean Name'), 'akIsSearchable' => true, 'akIsSearchableIndexed' => true), $pkg)->setAttributeSet($bua);
}
//add text attributes
$bp_text = UserAttributeKey::getByHandle('bp_text');
if (!$bp_text instanceof UserAttributeKey) {
$bp_text = UserAttributeKey::add('text', array('akHandle' => 'bp_text', 'akName' => t('Text Name'), 'akIsSearchable' => true, 'akIsSearchableIndexed' => true), $pkg)->setAttributeSet($bua);
}
}
开发者ID:janzenz,项目名称:c5_boilerplate,代码行数:20,代码来源:controller.php
示例20: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$canRead = false;
$ch = Page::getByPath('/dashboard/settings/attributes/sets');
$cp = new Permissions($ch);
if ($cp->canViewPage()) {
$canRead = true;
}
if (!$canRead) {
die(t("Access Denied."));
}
$db = Loader::db();
$akc = AttributeKeyCategory::getByID($_POST['categoryID']);
$uats = $_REQUEST['asID'];
if (is_array($uats)) {
$akc->updateAttributeSetDisplayOrder($uats);
}
开发者ID:Zyqsempai,项目名称:amanet,代码行数:18,代码来源:attribute_set_order_update.php
注:本文中的AttributeKeyCategory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论