/** * {@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'); } } } }
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'); }
/** * @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'); } } } } } }
<? 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"> <?
public static function exportList($xml) { $categories = AttributeKeyCategory::getList(); $axml = $xml->addChild('attributekeys'); foreach ($categories as $cat) { $attributes = AttributeKey::getList($cat->getAttributeKeyCategoryHandle()); foreach ($attributes as $at) { $at->export($axml); } } }
public function view() { $this->set('categories', AttributeKeyCategory::getList()); }