Файл: concrete5.7.5.6/concrete/src/Page/Type/Composer/Control/Type/CollectionAttributeType.php
Строк: 53
<?php
namespace ConcreteCorePageTypeComposerControlType;
use Loader;
use ConcreteCoreFoundationObject;
use CollectionAttributeKey;
use ConcreteCorePageTypeComposerControlCollectionAttributeControl;
use ConcreteCoreAttributeKeyKey as AttributeKey;
class CollectionAttributeType extends Type
{
public function getPageTypeComposerControlObjects()
{
$objects = array();
$keys = AttributeKey::getAttributeKeyList('collection');
foreach ($keys as $ak) {
$ac = new CollectionAttributeControl();
$ac->setAttributeKeyID($ak->getAttributeKeyID());
$ac->setPageTypeComposerControlIconSRC($ak->getAttributeKeyIconSRC());
$ac->setPageTypeComposerControlName($ak->getAttributeKeyDisplayName());
$objects[] = $ac;
}
return $objects;
}
public function getPageTypeComposerControlByIdentifier($identifier)
{
$ak = CollectionAttributeKey::getByID($identifier);
$ax = new CollectionAttributeControl();
$ax->setAttributeKeyID($ak->getAttributeKeyID());
$ax->setPageTypeComposerControlIconSRC($ak->getAttributeKeyIconSRC($ak));
$ax->setPageTypeComposerControlName($ak->getAttributeKeyDisplayName());
return $ax;
}
public function configureFromImportHandle($handle)
{
$ak = CollectionAttributeKey::getByHandle($handle);
return static::getPageTypeComposerControlByIdentifier($ak->getAttributeKeyID());
}
}