Пример #1
0
 public function submit()
 {
     if ($this->validateAction()) {
         $nvc = $this->page->getVersionToModify();
         if ($this->asl->allowEditPaths()) {
             $data = array('cHandle' => $_POST['cHandle']);
             $nvc->update($data);
         }
         if ($this->asl->allowEditName()) {
             $data = array('cName' => $_POST['cName']);
             $nvc->update($data);
         }
         $as = AttributeSet::getByHandle('seo');
         $attributes = $as->getAttributeKeys();
         foreach ($attributes as $ak) {
             $ak->saveAttributeForm($nvc);
         }
         if ($this->request->request->get('sitemap') && $this->permissions->canApprovePageVersions() && \Config::get('concrete.misc.sitemap_approve_immediately')) {
             $pkr = new ApprovePageRequest();
             $u = new User();
             $pkr->setRequestedPage($this->page);
             $v = Version::get($this->page, "RECENT");
             $pkr->setRequestedVersionID($v->getVersionID());
             $pkr->setRequesterUserID($u->getUserID());
             $response = $pkr->trigger();
             $u->unloadCollectionEdit();
         }
         $r = new PageEditResponse($e);
         $r->setPage($this->page);
         $r->setTitle(t('Page Updated'));
         $r->setMessage(t('The SEO information has been saved.'));
         $r->outputJSON();
     }
 }
 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);
                 }
             }
         }
     }
 }
 public function sortInSet()
 {
     $this->canAccess();
     $as = Set::getByID($_REQUEST['asID']);
     $uats = $_REQUEST['akID'];
     if (is_array($uats)) {
         $uats = array_filter($uats, 'is_numeric');
     }
     if (count($uats)) {
     }
 }
Пример #4
0
 function get_forum_attributes()
 {
     $atSet = AttributeSet::getByHandle('forums');
     $atKeys = $atSet->getAttributeKeys();
     $banAtt = array('Forum Post', 'Forum Category', 'Pin Forum Post', 'Forum Image', 'Forum Email Address', 'Forum Name', 'Forum Post Approved');
     foreach ($atKeys as $ak) {
         if (!in_array($ak->getAttributeKeyName(), $banAtt)) {
             $forumAttributes[$ak->getAttributeKeyID()] = $ak->getAttributeKeyName();
         }
     }
     return $forumAttributes;
 }
Пример #5
0
 public static function saveData($p)
 {
     $blocks = $p->getBlocks('Main');
     foreach ($blocks as $b) {
         if ($b->getBlockTypeHandle() == 'content' || $b->getBlockTypeHandle() == 'core_page_type_composer_control_output') {
             $b->deleteBlock();
         }
     }
     Loader::model("attribute/categories/collection");
     $cak = CollectionAttributeKey::getByHandle('tags');
     $cak->saveAttributeForm($p);
     $cck = CollectionAttributeKey::getByHandle('meta_title');
     $cck->saveAttributeForm($p);
     $cck = CollectionAttributeKey::getByHandle('meta_description');
     $cck->saveAttributeForm($p);
     $cck = CollectionAttributeKey::getByHandle('meta_keywords');
     $cck->saveAttributeForm($p);
     $cck = CollectionAttributeKey::getByHandle('blog_category');
     $cck->saveAttributeForm($p);
     //$cnv = CollectionAttributeKey::getByHandle('exclude_nav');
     //$cnv->saveAttributeForm($p);
     $ct = CollectionAttributeKey::getByHandle('thumbnail');
     $ct->saveAttributeForm($p);
     $ca = CollectionAttributeKey::getByHandle('blog_author');
     $ca->saveAttributeForm($p);
     $set = AttributeSet::getByHandle('problog_additional_attributes');
     $setAttribs = $set->getAttributeKeys();
     if ($setAttribs) {
         foreach ($setAttribs as $ak) {
             $aksv = CollectionAttributeKey::getByHandle($ak->akHandle);
             $aksv->saveAttributeForm($p);
         }
     }
     $bt = BlockType::getByHandle('content');
     if (empty($_POST['blogBody'])) {
         $content = ' ';
     } else {
         $content = $_POST['blogBody'];
     }
     $data = array('content' => $content);
     $b = $p->addBlock($bt, 'Main', $data);
     $b->setCustomTemplate('blog_post');
     $b->setAbsoluteBlockDisplayOrder('1');
     $db = Loader::db();
     $pTemplate = $db->getOne("SELECT ptComposerFormLayoutSetControlID FROM PageTypeComposerOutputControls WHERE pTemplateID = ? AND ptID = ?", array($p->getPageTemplateID(), $p->getPageTypeID()));
     if ($pTemplate) {
         $db->Replace('PageTypeComposerOutputBlocks', array('cID' => $p->getCollectionID(), 'arHandle' => 'Main', 'cbDisplayOrder' => 0, 'ptComposerFormLayoutSetControlID' => $pTemplate, 'bID' => $b->getBlockID()), 'cID', true);
     }
     Events::fire('on_problog_submit', $p);
     $ba = Loader::helper('blog_actions');
     $ba->doSubscription($p);
     $p->reindex();
 }
Пример #6
0
 public function submit()
 {
     if ($this->validateAction()) {
         $nvc = $this->page->getVersionToModify();
         if ($this->asl->allowEditPaths()) {
             $data = array('cHandle' => $_POST['cHandle']);
             $nvc->update($data);
         }
         $as = AttributeSet::getByHandle('seo');
         $attributes = $as->getAttributeKeys();
         foreach ($attributes as $ak) {
             $ak->saveAttributeForm($nvc);
         }
         $r = new PageEditResponse($e);
         $r->setPage($this->page);
         $r->setTitle(t('Page Updated'));
         $r->setMessage(t('The SEO information has been saved.'));
         $r->outputJSON();
     }
     exit;
 }
 public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->attributesets)) {
         foreach ($sx->attributesets->attributeset as $as) {
             $set = \Concrete\Core\Attribute\Set::getByHandle((string) $as['handle']);
             $akc = \Concrete\Core\Attribute\Key\Category::getByHandle($as['category']);
             $controller = $akc->getController();
             $manager = $controller->getSetManager();
             if (!is_object($set)) {
                 $pkg = static::getPackageObject($as['package']);
                 $set = $manager->addSet((string) $as['handle'], (string) $as['name'], $pkg, $as['locked']);
             }
             foreach ($as->children() as $ask) {
                 $ak = $controller->getAttributeKeyByHandle((string) $ask['handle']);
                 if (is_object($ak)) {
                     $manager->addKey($set, $ak);
                 }
             }
         }
     }
 }
Пример #8
0
 public function getAttributeSets()
 {
     return \Concrete\Core\Attribute\Set::getByAttributeKey($this);
 }
Пример #9
0
 protected function importAttributeSets(\SimpleXMLElement $sx)
 {
     if (isset($sx->attributesets)) {
         foreach ($sx->attributesets->attributeset as $as) {
             $set = \Concrete\Core\Attribute\Set::getByHandle((string) $as['handle']);
             $akc = AttributeKeyCategory::getByHandle($as['category']);
             if (!is_object($set)) {
                 $pkg = static::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);
                 }
             }
         }
     }
 }
Пример #10
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Attribute\Set as AttributeSet;
$cp = new Permissions($c);
$pk = PermissionKey::getByHandle('edit_page_properties');
$pk->setPermissionObject($c);
$asl = $pk->getMyAssignment();
$seoSet = AttributeSet::getByHandle('seo');
?>
<section>
    <header><?php 
echo t('Page Settings');
?>
</header>
    <?php 
if ($cp->canEditPageContents() || $cp->canEditPageTheme() || $cp->canEditPageProperties() || $cp->canEditPageTemplate()) {
    ?>

    <menu class="ccm-panel-page-basics">
        <?php 
    $pagetype = PageType::getByID($c->getPageTypeID());
    if (is_object($pagetype) && $cp->canEditPageContents()) {
        ?>
            <li>
                <a href="#" data-launch-panel-detail="page-composer"
                   data-panel-detail-url="<?php 
        echo URL::to('/ccm/system/panels/details/page/composer');
        ?>
"
                   data-panel-transition="fade">
Пример #11
0
 public function getPackageItems(Package $package)
 {
     return Set::getListByPackage($package);
 }
Пример #12
0
 public function addSet($asHandle, $asName, $pkg = false, $asIsLocked = 1)
 {
     if ($this->akCategoryAllowSets > static::ASET_ALLOW_NONE) {
         $db = Loader::db();
         $pkgID = 0;
         if (is_object($pkg)) {
             $pkgID = $pkg->getPackageID();
         }
         $sets = $db->GetOne('select count(asID) from AttributeSets where akCategoryID = ?', array($this->akCategoryID));
         $asDisplayOrder = 0;
         if ($sets > 0) {
             $asDisplayOrder = $db->GetOne('select max(asDisplayOrder) from AttributeSets where akCategoryID = ?', array($this->akCategoryID));
             $asDisplayOrder++;
         }
         $db->Execute('insert into AttributeSets (asHandle, asName, akCategoryID, asIsLocked, asDisplayOrder, pkgID) values (?, ?, ?, ?, ?,?)', array($asHandle, $asName, $this->akCategoryID, $asIsLocked, $asDisplayOrder, $pkgID));
         $id = $db->Insert_ID();
         $as = AttributeSet::getByID($id);
         return $as;
     }
 }
 protected function assignToSetFromRequest(AttributeKeyInterface $key)
 {
     $request = $this->request;
     $entity = $this->getCategoryObject();
     $category = $entity->getAttributeKeyCategory();
     if ($category->getSetManager()->allowAttributeSets()) {
         $set = Set::getByID($request->request->get('asID'));
         $setKeys = Set::getByAttributeKey($key);
         if (in_array($set, $setKeys)) {
             return;
         }
         if ($category->getSetManager()->allowAttributeSets() == StandardSetManager::ASET_ALLOW_SINGLE || !is_object($set)) {
             $query = $this->entityManager->createQuery('delete from \\Concrete\\Core\\Entity\\Attribute\\SetKey sk where sk.attribute_key = :attribute_key');
             $query->setParameter('attribute_key', $key);
             $query->execute();
         }
         if (is_object($set)) {
             $this->entityManager->refresh($set);
             // Refresh display order just in case.
             $displayOrder = 0;
             foreach ($set->getAttributeKeyCollection() as $setKey) {
                 $setKey->setDisplayOrder($displayOrder);
                 $this->entityManager->persist($setKey);
                 ++$displayOrder;
             }
             $setKey = new SetKey();
             $setKey->setAttributeKey($key);
             $setKey->setAttributeSet($set);
             $setKey->setDisplayOrder($displayOrder);
             $this->entityManager->persist($setKey);
         }
     }
     $this->entityManager->flush();
 }
Пример #14
0
 /**
  * @param string $asHandle The unique attribute set handle
  * @param string $asName The attribute set name
  * @param bool|\Package $pkg The package object to associate the set with or false if it does not belong to a package
  * @param int $asIsLocked
  * @return null|AttributeSet Returns the AttribueSet object if it was created successfully, null if it could not be
  * created (usually due to the category not allowing sets)
  */
 public function addSet($asHandle, $asName, $pkg = false, $asIsLocked = 1)
 {
     if ($this->akCategoryAllowSets > static::ASET_ALLOW_NONE) {
         $pkgID = 0;
         if (is_object($pkg)) {
             $pkgID = $pkg->getPackageID();
         }
         $db = Database::connection();
         $sets = $db->fetchColumn('SELECT COUNT(asID) FROM AttributeSets WHERE akCategoryID = ?', array($this->akCategoryID));
         $asDisplayOrder = 0;
         if ($sets > 0) {
             $asDisplayOrder = $db->fetchColumn('SELECt MAX(asDisplayOrder) FROM AttributeSets WHERE akCategoryID = ?', array($this->akCategoryID));
             $asDisplayOrder++;
         }
         $db->executeQuery('INSERT INTO AttributeSets
             (asHandle, asName, akCategoryID, asIsLocked, asDisplayOrder, pkgID)
             VALUES (?, ?, ?, ?, ?,?)', array($asHandle, $asName, $this->akCategoryID, $asIsLocked, $asDisplayOrder, $pkgID));
         $id = $db->lastInsertId();
         $as = AttributeSet::getByID($id);
         return $as;
     }
     return null;
 }
Пример #15
0
 public function set($setHandle)
 {
     $set = AttributeSet::getByHandle($setHandle);
     $akc = AttributeKeyCategory::getByHandle($this->category);
     $ak = $akc->getAttributeKeyByHandle($this->handle);
     if (!is_object($ak)) {
         return false;
     }
     $set->addKey($ak);
     return true;
 }
 public function skipItem()
 {
     $set = \Concrete\Core\Attribute\Set::getByHandle($this->object->getHandle());
     return is_object($set);
 }
Пример #17
0
 public function setPropertiesFromArray($arr)
 {
     return parent::setPropertiesFromArray($arr);
 }
 public function run()
 {
     $this->x = new SimpleXMLElement("<concrete5-cif></concrete5-cif>");
     $this->x->addAttribute('version', '1.0');
     // 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
     $pages = $this->x->addChild("pages");
     $db = Loader::db();
     $r = $db->Execute('select Pages.cID from Pages where cIsTemplate = 0 and cFilename is null or cFilename = "" order by cID asc');
     while ($row = $r->FetchRow()) {
         $pc = Page::getByID($row['cID'], 'RECENT');
         if ($pc->getPageTypeHandle() == STACKS_PAGE_TYPE) {
             continue;
         }
         $pc->export($pages);
     }
     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);
     Config::exportList($this->x);
     Tree::exportList($this->x);
 }
Пример #19
0
 public function addAttributeKey($type, $args, $pkg = false)
 {
     if (!is_object($type)) {
         $type = \Concrete\Core\Attribute\Type::getByHandle($type);
     }
     $controller = $type->getController();
     $settings = $controller->saveKey($args);
     if (!is_object($settings)) {
         $settings = $controller->getAttributeKeySettings();
     }
     // $key is actually an array.
     $handle = $args['akHandle'];
     $name = $args['akName'];
     $key = new LegacyKey();
     $key->setAttributeKeyHandle($handle);
     $key->setAttributeKeyName($name);
     $key->setAttributeType($type);
     $this->entityManager->persist($key);
     $this->entityManager->flush();
     $settings->setAttributeKey($key);
     $this->entityManager->persist($settings);
     $this->entityManager->flush();
     $key->setAttributeKeySettings($settings);
     $key->setAttributeCategoryEntity($this->getCategoryEntity());
     if (is_object($pkg)) {
         $key->setPackage($pkg);
     }
     // Modify the category's search indexer.
     $indexer = $this->getSearchIndexer();
     if (is_object($indexer)) {
         $indexer->updateRepositoryColumns($this, $key);
     }
     $this->entityManager->persist($key);
     $this->entityManager->flush();
     $this->clearAttributeSet($key);
     if (isset($args['asID']) && $args['asID'] > 0) {
         $key->setAttributeSet(Set::getByID($args['asID']));
     }
     $this->entityManager->flush();
     return $key;
 }
Пример #20
0
 /**
  * Returns an array of package items (e.g. blocks, themes)
  */
 public function getPackageItems()
 {
     $items = array();
     $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this);
     $items['permission_categories'] = PermissionKeyCategory::getListByPackage($this);
     $items['permission_access_entity_types'] = PermissionAccessEntityType::getListByPackage($this);
     $items['attribute_keys'] = AttributeKey::getListByPackage($this);
     $items['attribute_sets'] = AttributeSet::getListByPackage($this);
     $items['group_sets'] = GroupSet::getListByPackage($this);
     $items['page_types'] = PageType::getListByPackage($this);
     $items['page_templates'] = PageTemplate::getListByPackage($this);
     $items['mail_importers'] = MailImporter::getListByPackage($this);
     $items['gathering_item_template_types'] = GatheringItemTemplateType::getListByPackage($this);
     $items['gathering_item_templates'] = GatheringItemTemplate::getListByPackage($this);
     $items['gathering_data_sources'] = GatheringDataSource::getListByPackage($this);
     $items['features'] = Feature::getListByPackage($this);
     $items['feature_categories'] = FeatureCategory::getListByPackage($this);
     $btl = new BlockTypeList();
     $btl->filterByPackage($this);
     $blocktypes = $btl->get();
     $items['block_types'] = $blocktypes;
     $items['block_type_sets'] = BlockTypeSet::getListByPackage($this);
     $items['page_themes'] = PageTheme::getListByPackage($this);
     $items['permissions'] = PermissionKey::getListByPackage($this);
     $items['single_pages'] = SinglePage::getListByPackage($this);
     $items['attribute_types'] = AttributeType::getListByPackage($this);
     $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this);
     $items['content_editor_snippets'] = SystemContentEditorSnippet::getListByPackage($this);
     $items['conversation_editors'] = ConversationEditor::getListByPackage($this);
     $items['conversation_rating_types'] = ConversationRatingType::getListByPackage($this);
     $items['page_type_publish_target_types'] = PageTypePublishTargetType::getListByPackage($this);
     $items['page_type_composer_control_types'] = PageTypeComposerControlType::getListByPackage($this);
     $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this);
     $items['community_point_actions'] = UserPointAction::getListByPackage($this);
     $items['jobs'] = Job::getListByPackage($this);
     $items['workflow_types'] = WorkflowType::getListByPackage($this);
     ksort($items);
     return $items;
 }
Пример #21
0
    echo t('Add Attributes to Set');
    ?>
</legend>

                    <?php 
    $cat = AttributeKeyCategory::getByID($set->getAttributeSetKeyCategoryID());
    $cat = $cat->getAttributeKeyCategory();
    $list = $cat->getList();
    $unassigned = $cat->getSetManager()->getUnassignedAttributeKeys();
    if (count($list) > 0) {
        ?>

                        <div class="form-group">
                            <?php 
        foreach ($list as $key) {
            $keySets = \Concrete\Core\Attribute\Set::getByAttributeKey($key);
            $disabled = '';
            if (!$key->inAttributeSet($set) && count($keySets)) {
                $disabled = array('disabled' => 'disabled');
            }
            ?>
                                <div class="checkbox">
                                    <label>
                                        <?php 
            echo $form->checkbox('akID[]', $key->getAttributeKeyID(), $key->inAttributeSet($set), $disabled);
            ?>
                                        <span><?php 
            echo $key->getAttributeKeyDisplayName();
            ?>
</span>
                                        <span class="help-inline"><?php 
<?php

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Attribute\Set as AttributeSet;
$canRead = false;
$ch = Page::getByID($_REQUEST['cID']);
$path = $ch->getCollectionPath();
if (strpos($path, '/dashboard') === 0) {
    $cp = new Permissions($ch);
    if ($cp->canViewPage()) {
        $canRead = true;
    }
}
if (!$canRead) {
    die(t("Access Denied."));
}
// this should be cleaned up.... yeah
$db = Loader::db();
// update order of collections
$uats = $_REQUEST['akID_' . $_REQUEST['asID']];
if (is_array($uats)) {
    $as = AttributeSet::getByID($_REQUEST['asID']);
    $as->updateAttributesDisplayOrder($uats);
}
Пример #23
0
 public function install_pb_attributes($pkg)
 {
     $eaku = AttributeKeyCategory::getByHandle('collection');
     $eaku->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_SINGLE);
     $evset = $eaku->addSet('problog', t('ProBlog'), $pkg);
     $bset = AttributeSet::getByHandle('problog_additional_attributes');
     if (!is_object($bset)) {
         $bset = $eaku->addSet('problog_additional_attributes', t('ProBlog Additional Attributes'), $pkg);
     }
     $userpicker = AttributeType::getByHandle('user_picker');
     if (!is_object($userpicker) || !intval($userpicker->getAttributeTypeID())) {
         $userpicker = AttributeType::add('user_picker', tc('AttributeTypeName', 'User Picker'), $pkg);
         $eaku->associateAttributeKeyType($userpicker);
     }
     $multiuserpicker = AttributeType::getByHandle('multi_user_picker');
     if (!is_object($multiuserpicker) || !intval($multiuserpicker->getAttributeTypeID())) {
         $multiuserpicker = AttributeType::add('multi_user_picker', tc('AttributeTypeName', 'Multi User Picker'), $pkg);
         $eaku->associateAttributeKeyType($multiuserpicker);
     }
     $posttotwitter = AttributeType::getByHandle('post_to_twitter');
     if (!is_object($posttotwitter) || !intval($posttotwitter->getAttributeTypeID())) {
         $posttotwitter = AttributeType::add('post_to_twitter', tc('AttributeTypeName', 'Post To Twitter'), $pkg);
         $eaku->associateAttributeKeyType($posttotwitter);
     }
     $subscribe = AttributeType::getByHandle('subscribe');
     if (!is_object($subscribe) || !intval($subscribe->getAttributeTypeID())) {
         $subscribe = AttributeType::add('subscribe', tc('AttributeTypeName', 'Subscribe'), $pkg);
         $eaku->associateAttributeKeyType($subscribe);
     }
     $composeroptmizer = AttributeType::getByHandle('composer_optimizer');
     if (!is_object($composeroptmizer) || !intval($composeroptmizer->getAttributeTypeID())) {
         $composeroptmizer = AttributeType::add('composer_optimizer', tc('AttributeTypeName', 'ProBlog Optimizer'), $pkg);
         $eaku->associateAttributeKeyType($composeroptmizer);
     }
     $blogauth = CollectionAttributeKey::getByHandle('blog_author');
     if (!is_object($blogauth)) {
         CollectionAttributeKey::add($userpicker, array('akHandle' => 'blog_author', 'akName' => t('Blog Author')), $pkg)->setAttributeSet($evset);
     }
     $checkn = AttributeType::getByHandle('boolean');
     $blogsec = CollectionAttributeKey::getByHandle('blog_section');
     if (!is_object($blogsec)) {
         CollectionAttributeKey::add($checkn, array('akHandle' => 'blog_section', 'akName' => t('Blog Section'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1), $pkg)->setAttributeSet($evset);
     }
     $checkn = AttributeType::getByHandle('boolean');
     $cannonpage = CollectionAttributeKey::getByHandle('is_canonical_page');
     if (!is_object($cannonpage)) {
         CollectionAttributeKey::add($checkn, array('akHandle' => 'is_canonical_page', 'akName' => t('Is Canonical Page'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1), $pkg)->setAttributeSet($evset);
     }
     $pulln = AttributeType::getByHandle('select');
     $blogcat = CollectionAttributeKey::getByHandle('blog_category');
     if (!is_object($blogcat)) {
         CollectionAttributeKey::add($pulln, array('akHandle' => 'blog_category', 'akName' => t('Blog Category'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1, 'akSelectAllowOtherValues' => true), $pkg)->setAttributeSet($evset);
     }
     $blogtag = CollectionAttributeKey::getByHandle('tags');
     if (!is_object($blogtag)) {
         CollectionAttributeKey::add($pulln, array('akHandle' => 'tags', 'akName' => t('Tags'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1, 'akSelectAllowMultipleValues' => true, 'akSelectAllowOtherValues' => true), $pkg)->setAttributeSet($evset);
     } else {
         $blogtag->update(array('akHandle' => 'tags', 'akName' => t('Tags'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1, 'akSelectAllowMultipleValues' => true, 'akSelectAllowOtherValues' => true));
     }
     $imagen = AttributeType::getByHandle('image_file');
     $blogthum = CollectionAttributeKey::getByHandle('thumbnail');
     if (!is_object($blogthum)) {
         CollectionAttributeKey::add($imagen, array('akHandle' => 'thumbnail', 'akName' => t('Thumbnail Image')), $pkg)->setAttributeSet($evset);
     }
     $send_subscribe = CollectionAttributeKey::getByHandle('send_subscription');
     if (!is_object($send_subscribe)) {
         CollectionAttributeKey::add($subscribe, array('akHandle' => 'send_subscription', 'akName' => t('Send To Subscribers')), $pkg)->setAttributeSet($evset);
     }
     $postBlogToTwitter = CollectionAttributeKey::getByHandle('post_to_twitter');
     if (!is_object($postBlogToTwitter)) {
         CollectionAttributeKey::add($posttotwitter, array('akHandle' => 'post_to_twitter', 'akName' => t('Post To Twitter')), $pkg)->setAttributeSet($evset);
     }
     $composerBlogOptimizer = CollectionAttributeKey::getByHandle('composer_optimizer');
     if (!is_object($composerBlogOptimizer)) {
         CollectionAttributeKey::add($composeroptmizer, array('akHandle' => 'composer_optimizer', 'akName' => t('ProBlog Optimizer')), $pkg)->setAttributeSet($evset);
     }
     $users = CollectionAttributeKey::getByHandle('subscription');
     if (!is_object($users)) {
         $users = array('akHandle' => 'subscription', 'akName' => 'Subscribed Members', 'akIsSearchable' => 0, 'akIsSearchableIndexed' => 0, 'akIsAutoCreated' => 1, 'akIsEditable' => 1);
         $users = CollectionAttributeKey::add($multiuserpicker, $users, $pkg);
     }
 }