private function addPageAttributeKeys($pkg)
 {
     $att = CollectionAttributeKey::getByHandle("db_table_demo");
     if (!$att) {
         CollectionAttributeKey::add('db_table_demo', array('akHandle' => 'db_table_demo', 'akName' => t('Database Table Tutorial Demo'), 'akIsSearchable' => true), $pkg);
     }
 }
Beispiel #2
0
    public function install()
    {
        $pkg = parent::install();
        // Dashboard Page
        $sp = SinglePage::add('/dashboard/forums', $pkg);
        if (is_object($sp)) {
            $sp->update(array('cName' => t('Forums'), 'cDescription' => t('Forums Dashboard')));
        }
        // Add Sidebar block set
        BlockTypeSet::add('forums', 'Forums', $pkg);
        // Add forum moderator user group
        $forumGroup = Group::getByName('Forum Moderators');
        if (!is_object($authorGroup)) {
            Group::add('Forum Moderators', t('Forum Moderators, delete, edit, approve'));
        }
        // install blocks
        BlockType::installBlockTypeFromPackage('webli_forum_post', $pkg);
        BlockType::installBlockTypeFromPackage('webli_forum_list', $pkg);
        BlockType::installBlockTypeFromPackage('webli_forum_search', $pkg);
        BlockType::installBlockTypeFromPackage('webli_forum_archive', $pkg);
        BlockType::installBlockTypeFromPackage('webli_forum_tags', $pkg);
        // Add Collection Attribute Set
        $akCat = AttributeKeyCategory::getByHandle('collection');
        $akCat->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_SINGLE);
        $akCatSet = $akCat->addSet('forums', t('Forums'), $pkg);
        // Add Collection Attributes
        $attribute = CollectionAttributeKey::getByHandle('forum_post');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('textarea');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_post', 'akName' => t('Forum Post'), 'akIsSearchableIndexed' => true, 'akTextareaDisplayMode' => 'rich_text'), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('forum_category');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('boolean');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_category', 'akName' => t('Forum Category')), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('forum_email');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('text');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_email', 'akName' => t('Forum Email Address'), 'akIsSearchableIndexed' => true), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('forum_name');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('text');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_name', 'akName' => t('Forum Name'), 'akIsSearchableIndexed' => true), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('forum_pin');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('boolean');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_pin', 'akName' => t('Pin Forum Post')), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('forum_post_approved');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('boolean');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_post_approved', 'akName' => t('Forum Post Approved')), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('tags');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('select');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'tags', 'akName' => t('Tags'), 'akIsSearchableIndexed' => true), $pkg)->setAttributeSet($akCatSet);
        }
        $attribute = CollectionAttributeKey::getByHandle('forum_image');
        if (!is_object($attribute)) {
            $att = AttributeType::getByHandle('image_file');
            // add to attribute set
            CollectionAttributeKey::add($att, array('akHandle' => 'forum_image', 'akName' => t('Forum Image')), $pkg)->setAttributeSet($akCatSet);
            $addAttribute = CollectionAttributeKey::getByHandle('forum_image');
        }
        // Add top level Forums Page
        $forumPage = \Page::getByPath('/forums');
        if (!is_object($forumPage) || $forumPage->cID == null) {
            $parentPage = \Page::getByID(1);
            $pageType = \PageType::getByHandle('right_sidebar');
            $template = \PageTemplate::getByHandle('right_sidebar');
            $forumsPage = $parentPage->add($pageType, array('cName' => t('Forums'), 'cDescription' => t('Top Level Forums Page'), 'cHandle ' => 'forums'), $template);
            //Add forum_category page attribute
            $forumsPage->setAttribute('forum_category', 1);
        }
        // Add top Forum Search Results Page
        $forumSearchPage = \Page::getByPath('/forum-search');
        if (!is_object($forumSearchPage) || $forumSearch->cID == null) {
            $parentPage = \Page::getByID(1);
            $pageType = \PageType::getByHandle('right_sidebar');
            $template = \PageTemplate::getByHandle('right_sidebar');
            $forumSearchPage = $parentPage->add($pageType, array('cName' => t('Forum Search'), 'cDescription' => t('Forum Search Page'), 'cHandle ' => 'forum-search'), $template);
            $forumSearchPage->setAttribute('exclude_nav', 1);
        }
        // Add Forum Post Page Template
        if (!is_object(PageTemplate::getByHandle('forum_post'))) {
            $pageTemplate = PageTemplate::add('forum_post', 'Forum Post', 'landing.png', $pkg);
        }
        // Add Forum Post Page Type
        if (!is_object(PageType::getByHandle('forum_post'))) {
            $data = array('handle' => 'forum_post', 'name' => 'Forum Post', 'ptLaunchInComposer' => true, 'ptIsFrequentlyAdded' => true, 'defaultTemplate' => PageTemplate::getByHandle('forum_post'), 'allowedTemplates' => 'C', 'templates' => array(PageTemplate::getByHandle('forum_post')));
            $pt = PageType::add($data, $pkg);
        }
        /* Get blog_post page template */
        $pageType = \PageType::getByHandle('forum_post');
        $ctTemplate = $pageType->getPageTypeDefaultPageTemplateObject();
        $forumPostTemplate = $pageType->getPageTypePageTemplateDefaultPageObject($ctTemplate);
        /* Add Composer Layouts */
        $basics = $pageType->addPageTypeComposerFormLayoutSet('Basics', 'Basic Info');
        $post = $pageType->addPageTypeComposerFormLayoutSet('Forum Post', 'Forum Post');
        /* Add Built in Properties */
        $cct = ComposerControlType::getByHandle('core_page_property');
        /* Post Title */
        $control = $cct->getPageTypeComposerControlByIdentifier('name');
        $control->addToPageTypeComposerFormLayoutSet($basics);
        /* Post Slug */
        $control = $cct->getPageTypeComposerControlByIdentifier('url_slug');
        $control->addToPageTypeComposerFormLayoutSet($basics);
        /* Post Publish Location */
        $control = $cct->getPageTypeComposerControlByIdentifier('publish_target');
        $control->addToPageTypeComposerFormLayoutSet($basics);
        /* Post Date */
        $control = $cct->getPageTypeComposerControlByIdentifier('date_time');
        $control->addToPageTypeComposerFormLayoutSet($basics);
        /* Post Author */
        $control = $cct->getPageTypeComposerControlByIdentifier('user');
        $control->addToPageTypeComposerFormLayoutSet($basics);
        /* Add Attributes */
        $cct = ComposerControlType::getByHandle('collection_attribute');
        /* Forum Pin */
        $attributeId = CollectionAttributeKey::getByHandle('forum_pin')->getAttributeKeyID();
        $control = $cct->getPageTypeComposerControlByIdentifier($attributeId);
        $control->addToPageTypeComposerFormLayoutSet($post);
        /* Forum Post Approved */
        $attributeId = CollectionAttributeKey::getByHandle('forum_post_approved')->getAttributeKeyID();
        $control = $cct->getPageTypeComposerControlByIdentifier($attributeId);
        $control->addToPageTypeComposerFormLayoutSet($post);
        /* Forum Post */
        $attributeId = CollectionAttributeKey::getByHandle('forum_post')->getAttributeKeyID();
        $control = $cct->getPageTypeComposerControlByIdentifier($attributeId);
        $control->addToPageTypeComposerFormLayoutSet($post);
        /* Forum Image */
        $attributeId = CollectionAttributeKey::getByHandle('forum_image')->getAttributeKeyID();
        $control = $cct->getPageTypeComposerControlByIdentifier($attributeId);
        $control->addToPageTypeComposerFormLayoutSet($post);
        /* Forum Tags */
        $attributeId = CollectionAttributeKey::getByHandle('tags')->getAttributeKeyID();
        $control = $cct->getPageTypeComposerControlByIdentifier($attributeId);
        $control->addToPageTypeComposerFormLayoutSet($post);
        /* Add default Blocks to page template */
        $ctTemplate = $pageType->getPageTypeDefaultPageTemplateObject();
        $forumPostTemplate = $pageType->getPageTypePageTemplateDefaultPageObject($ctTemplate);
        //Add exclude_nav page attributeto Forum Post Template
        $forumPostTemplate->setAttribute('exclude_nav', 1);
        // Get Forum Category Page
        $forumCategoryPage = Page::getByPath('/forums');
        //Add forum_category page attribute
        $forumCategoryPage->setAttribute('forum_category', 1);
        // Get Forum Search Page
        $forumSearchPage = Page::getByPath('/forum-search');
        //Add exclude_nav page attribute
        $forumSearchPage->setAttribute('exclude_nav', 1);
        // Install Blocks
        //install Forum Post Block
        $forumPost = BlockType::getByHandle('webli_forum_post');
        $forumPostData = array();
        $forumCategoryPage->addBlock($forumPost, 'Main', $forumPostData);
        //install forum post block to forum_post template
        $forumPostTemplate->addBlock($forumPost, 'Forum Post', $forumPostData);
        //install Forum List Block on Forums top level page
        $forumList = BlockType::getByHandle('webli_forum_list');
        $forumListData = array();
        $forumListData['num'] = 25;
        $forumListData['paginate'] = 1;
        $forumListData['cParentID'] = $forumCategoryPage->getCollectionID();
        $forumListData['orderBy'] = 'chrono_desc';
        $forumListData['use_content'] = 1;
        $forumListData['truncateSummaries'] = 1;
        $forumListData['truncateChars'] = 200;
        $forumListData['display_author'] = 1;
        $forumListData['includeDate'] = 1;
        $forumListData['includeName'] = 1;
        $forumListData['includeDescription'] = 1;
        $forumListData['date_format'] = 'l F j, Y g:ia';
        $forumListData['forum_pin'] = 1;
        $forumListData['forumReplies'] = 3;
        $forumListData['thumb_width'] = 250;
        $forumListData['thumb_height'] = 150;
        $forumListData['crop'] = 1;
        $forumListData['noResultsMessage'] = 'No Forum Posts available to view.';
        $forumCategoryPage->addBlock($forumList, 'Main', $forumListData);
        // Install Forum Search Block on forum_post Page template
        $forumSearch = BlockType::getByHandle('webli_forum_search');
        $forumSearchData = array();
        $forumSearchData['title'] = 'Forum Search';
        $forumSearchData['postTo_cID'] = $forumSearchPage->getCollectionID();
        $forumSearchData['baseSearchPath'] = 'PARENT';
        $forumPostTemplate->addBlock($forumSearch, 'Sidebar', $forumSearchData);
        //install Forum Search Block Forums forum_category Page
        $forumSearchData = array();
        $forumSearchData['title'] = 'Forum Search';
        $forumSearchData['postTo_cID'] = $forumSearchPage->getCollectionID();
        $forumSearchData['baseSearchPath'] = $forumCategoryPage->getCollectionPath();
        $forumCategoryPage->addBlock($forumSearch, 'Sidebar', $forumSearchData);
        //install Forum Search Block on Forum Search Page
        $forumSearchData = array();
        $forumSearchData['title'] = 'Forum Search';
        $forumSearchData['buttonText'] = 'Search';
        $forumSearchData['baseSearchPath'] = $forumCategoryPage->getCollectionPath();
        $forumSearchPage->addBlock($forumSearch, 'Main', $forumSearchData);
        //install Forum Archive Block on forum_post template
        $forumArchive = BlockType::getByHandle('webli_forum_archive');
        $forumArchiveData = array();
        $forumArchiveData['title'] = 'Forum Archive';
        $forumArchiveData['cParentID'] = 'PARENT';
        $forumPostTemplate->addBlock($forumArchive, 'Sidebar', $forumArchiveData);
        //install Forum Archive Block
        $forumArchiveData = array();
        $forumArchiveData['title'] = 'Forum Archive';
        $forumArchiveData['cParentID'] = $forumCategoryPage->getCollectionID();
        $forumCategoryPage->addBlock($forumArchive, 'Sidebar', $forumArchiveData);
        $forumSearchPage->addBlock($forumArchive, 'Sidebar', $forumArchiveData);
        //install Forum Tags Block on forum_post template
        $forumTags = BlockType::getByHandle('webli_forum_tags');
        $forumTagsData = array();
        $forumTagsData['title'] = 'Forum Tags';
        $forumTagsData['cParentID'] = 'PARENT';
        $forumTagsData['postTo_cID'] = $forumSearchPage->getCollectionID();
        $forumTagsData['baseSearchPath'] = $forumCategoryPage->getCollectionPath();
        $forumTagsData['min_height'] = 15;
        $forumTagsData['max_height'] = 30;
        $forumPostTemplate->addBlock($forumTags, 'Sidebar', $forumTagsData);
        //install Forum Tags Block
        $forumTagsData = array();
        $forumTagsData['title'] = 'Forum Tags';
        $forumTagsData['cParentID'] = $forumCategoryPage->getCollectionID();
        $forumTagsData['postTo_cID'] = $forumSearchPage->getCollectionID();
        $forumTagsData['baseSearchPath'] = $forumCategoryPage->getCollectionPath();
        $forumTagsData['min_height'] = 15;
        $forumTagsData['max_height'] = 30;
        $forumCategoryPage->addBlock($forumTags, 'Sidebar', $forumTagsData);
        $forumSearchPage->addBlock($forumTags, 'Sidebar', $forumTagsData);
        //install Conversations block to forum_post template
        $conversations = BlockType::getByHandle('core_conversation');
        $conversationsData = array();
        $conversationsData['attachmentsEnabled'] = 0;
        $conversationsData['addMessageLabel'] = t('Add a Comment');
        $conversationsData['itemsPerPage'] = 25;
        $conversationsData['enablePosting'] = 1;
        $conversationsData['enableCommentRating'] = 1;
        $conversationsData['paginate'] = 1;
        $conversationsData['displayMode'] = 'threaded';
        $conversationsData['displayPostingForm'] = 'bottom';
        $forumPostTemplate->addBlock($conversations, 'Forum Replies', $conversationsData);
        $db = Loader::db();
        // insert default page category values
        $db->Execute('insert into btWebliForums (
				cID,
				display_title,
				display_author,
				display_date,
				date_format,
				display_tags,
				enable_comments,
				enable_breadcrumb,
				crop_image,
				display_image,
				image_height,
				image_width,
				display_avatars,
				forum_search_block,
				forum_archive_block,
				forum_tags_block,
				rich_text,
				page_template,
				page_type
				) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', array(0, 1, 1, 1, 'l F j, Y g:ia', 1, 1, 1, 0, 1, 350, 250, 1, 1, 1, 1, 1, $pageTemplate->getPageTemplateID(), $pageType->getPageTypeID()));
        // Add Sample Forum Post
        $forumsPage = \Page::getByPath('/forums');
        if (is_object($forumsPage) || $forumsPage->cID != null) {
            $pageType = \PageType::getByHandle('forum_post');
            $template = \PageTemplate::getByHandle('forum_post');
            $samplePost = $forumsPage->add($pageType, array('cName' => 'My First Forum Post', 'cDescription' => 'First Forum Post', 'cHandle ' => 'first-forum-post'), $template);
            $samplePost->setAttribute('forum_post', t('
				<p>Hey, Congratulations, you have installed Forums for Concrete5.  Forums will give visitors to your site frontend
				editing capabilities to add Forum Messages and reply to existing messages.</p>
				<p>Administrators have access to the Forums Dashboard Page to customize and manage your forums.</p>
				<p>So get your forum started and if you have any comments or questions visit <a href="http://forums.webli.us" target="_blank">forums.webli.us</a></p>'));
            $samplePost->setAttribute('forum_post_approved', 1);
            $samplePost->setAttribute('tags', array('Forums', t('Frist Message')));
        }
        $cms = Core::make('app');
        $cms->clearCaches();
    }
 public function configurePackage($pkg)
 {
     $theme = Theme::getByHandle('worldskills');
     if (!is_object($theme)) {
         $theme = Theme::add('worldskills', $pkg);
     }
     // add skill ID attribute
     $attributeKey = CollectionAttributeKey::getByHandle('worldskills_skill_id');
     if (!is_object($attributeKey)) {
         $type = AttributeType::getByHandle('text');
         $args = array('akHandle' => 'worldskills_skill_id', 'akName' => t('Skill ID'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1);
         CollectionAttributeKey::add($type, $args, $pkg);
     }
     // add skill page type
     $pageType = \PageType::getByHandle('worldskills_skill');
     if (!is_object($pageType)) {
         $template = \PageTemplate::getByHandle('full');
         \PageType::add(array('handle' => 'worldskills_skill', 'name' => 'Skill', 'defaultTemplate' => $template, 'allowedTemplates' => 'C', 'templates' => array($template), 'ptLaunchInComposer' => 0, 'ptIsFrequentlyAdded' => 0), $pkg)->setConfiguredPageTypePublishTargetObject(new PageTypePublishTargetAllConfiguration(PageTypePublishTargetAllType::getByHandle('all')));
     }
     // add member ID attribute
     $attributeKey = CollectionAttributeKey::getByHandle('worldskills_member_id');
     if (!is_object($attributeKey)) {
         $type = AttributeType::getByHandle('text');
         $args = array('akHandle' => 'worldskills_member_id', 'akName' => t('Member ID'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1);
         CollectionAttributeKey::add($type, $args, $pkg);
     }
     // add member page type
     $pageType = \PageType::getByHandle('worldskills_member');
     if (!is_object($pageType)) {
         $template = \PageTemplate::getByHandle('full');
         \PageType::add(array('handle' => 'worldskills_member', 'name' => 'Member', 'defaultTemplate' => $template, 'allowedTemplates' => 'C', 'templates' => array($template), 'ptLaunchInComposer' => 0, 'ptIsFrequentlyAdded' => 0), $pkg)->setConfiguredPageTypePublishTargetObject(new PageTypePublishTargetAllConfiguration(PageTypePublishTargetAllType::getByHandle('all')));
     }
     // add skill block
     $blockType = \BlockType::getByHandle('worldskills_skill');
     if (!is_object($blockType)) {
         \BlockType::installBlockTypeFromPackage('worldskills_skill', $pkg);
     }
     // add skill list block
     $blockType = \BlockType::getByHandle('worldskills_skill_list');
     if (!is_object($blockType)) {
         \BlockType::installBlockTypeFromPackage('worldskills_skill_list', $pkg);
     }
     // add people block
     $blockType = \BlockType::getByHandle('worldskills_people');
     if (!is_object($blockType)) {
         \BlockType::installBlockTypeFromPackage('worldskills_people', $pkg);
     }
     // add member block
     $blockType = \BlockType::getByHandle('worldskills_member');
     if (!is_object($blockType)) {
         \BlockType::installBlockTypeFromPackage('worldskills_member', $pkg);
     }
     // add member list block
     $blockType = \BlockType::getByHandle('worldskills_member_list');
     if (!is_object($blockType)) {
         \BlockType::installBlockTypeFromPackage('worldskills_member_list', $pkg);
     }
     try {
         $authenticationType = AuthenticationType::getByHandle('worldskills');
     } catch (\Exception $e) {
         $authenticationType = AuthenticationType::add('worldskills', 'WorldSkills Auth', 0, $pkg);
         $authenticationType->disable();
     }
     $page = \SinglePage::add('/dashboard/system/basics/worldskills', $pkg);
     if (is_object($pag)) {
         $page->updateCollectionName('WorldSkills');
     }
     \Config::save('worldskills.api_url', \Config::get('worldskills.api_url', 'https://api.worldskills.org'));
     \Config::save('worldskills.authorize_url', \Config::get('worldskills.authorize_url', 'https://auth.worldskills.org'));
 }
Beispiel #4
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);
     }
 }
 public function publish(AttributeKey $ak, Package $pkg = null)
 {
     $key = CollectionKey::add($ak->getType(), array('akHandle' => $ak->getHandle(), 'akName' => $ak->getName(), 'akIsInternal' => $ak->getIsInternal(), 'akIsSearchableIndexed' => $ak->getIsIndexed(), 'akIsSearchable' => $ak->getIsSearchable()), $pkg);
     return $key;
 }