Exemplo n.º 1
0
 protected function setUp()
 {
     parent::setUp();
     Category::add('collection');
     Page::addHomePage();
     PageTemplate::add('full', 'Full');
     PageType::add(array('handle' => 'basic', 'name' => 'Basic'));
 }
Exemplo n.º 2
0
 protected function addPage2()
 {
     $home = Page::getByID(HOME_CID);
     PageType::add(array('handle' => 'alternate', 'name' => 'Alternate'));
     $pt = PageType::getByID(2);
     $template = PageTemplate::getByID(1);
     $page = $home->add($pt, array('uID' => 1, 'cName' => 'Test page', 'pTemplateID' => $template->getPageTemplateID()));
     return $page;
 }
Exemplo n.º 3
0
 public function setUp()
 {
     $this->tables = array_merge($this->tables, array('PermissionAccessList', 'PageTypeComposerFormLayoutSets', 'AttributeSetKeys', 'AttributeSets', 'AttributeKeyCategories', 'PermissionAccessEntityTypes', 'Packages', 'AttributeKeys', 'AttributeTypes', 'PageFeeds'));
     parent::setUp();
     \Concrete\Core\Permission\Access\Entity\Type::add('page_owner', 'Page Owner');
     \Concrete\Core\Permission\Category::add('page');
     \Concrete\Core\Permission\Key\Key::add('page', 'view_page', 'View Page', '', 0, 0);
     PageTemplate::add('left_sidebar', 'Left Sidebar');
     PageTemplate::add('right_sidebar', 'Right Sidebar');
     PageType::add(array('handle' => 'alternate', 'name' => 'Alternate'));
     PageType::add(array('handle' => 'another', 'name' => 'Another'));
     foreach ($this->pageData as $data) {
         $c = call_user_func_array(array($this, 'createPage'), $data);
         $c->reindex();
     }
     $this->list = new \Concrete\Core\Page\PageList();
     $this->list->ignorePermissions();
 }
 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'));
 }