Exemple #1
0
 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     Loader::model('job');
     // install job
     $jb = Job::installByPackage('generate_multilingual_sitemap', $pkg);
     $p = SinglePage::add('/dashboard/multilingual', $pkg);
     if (is_object($p)) {
         $p->update(array('cName' => t('Multilingual'), 'cDescription' => t('Translate your site.')));
     }
     $p1 = SinglePage::add('/dashboard/multilingual/setup', $pkg);
     if (is_object($p1)) {
         $p1->update(array('cName' => t('Setup'), 'cDescription' => ''));
     }
     $p2 = SinglePage::add('/dashboard/multilingual/page_report', $pkg);
     if (is_object($p2)) {
         $p2->update(array('cName' => t('Page Report'), 'cDescription' => ''));
     }
     BlockType::installBlockTypeFromPackage('switch_language', $pkg);
     $ak = CollectionAttributeKey::getByHandle('multilingual_exclude_from_copy');
     if (!is_object($ak)) {
         CollectionAttributeKey::add('BOOLEAN', array('akHandle' => 'multilingual_exclude_from_copy', 'akName' => t('Exclude from Internationalization Copy'), 'akIsSearchable' => true), $pkg);
     }
 }
 private function getOrInstallBlockType($pkg, $btHandle)
 {
     $bt = BlockType::getByHandle($btHandle);
     if (empty($bt)) {
         BlockType::installBlockTypeFromPackage($btHandle, $pkg);
         $bt = BlockType::getByHandle($btHandle);
     }
     return $bt;
 }
 public function install()
 {
     $pkg = parent::install();
     //Install block
     BlockType::installBlockTypeFromPackage('custom_contact_form', $pkg);
     //Install dashboard page
     Loader::model('single_page');
     $p = SinglePage::add('/dashboard/reports/custom_contact_form', $pkg);
     $p->update(array('cName' => t('Contact Form Submissions')));
     $p->setAttribute('icon_dashboard', 'icon-list-alt');
 }
 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     Loader::model('attribute/categories/collection');
     // install attributes
     $cab1 = CollectionAttributeKey::add('BOOLEAN', array('akHandle' => 'easynews_section', 'akName' => t('NEWS Section'), 'akIsSearchable' => true), $pkg);
     //install pages
     $def = SinglePage::add('/dashboard/easy_news', $pkg);
     $def->update(array('cName' => 'Easy News', 'cDescription' => t('Manage site news.')));
     $def = SinglePage::add('/dashboard/easy_news/help', $pkg);
     $def->update(array('cName' => 'Easy News Help', 'cDescription' => t('Easy News help.')));
     //install block
     BlockType::installBlockTypeFromPackage('easynews_list', $pkg);
 }
 public function install()
 {
     Loader::library('mootools/attribute', FRONTEND_DEVELOPER_PACKAGE_HANDLE);
     $pkg = parent::install();
     Loader::model('single_page');
     Loader::model('attribute/categories/user');
     Loader::model('attribute/categories/file');
     $singlePages = array("/dashboard/mootools" => array('cName' => t('Mootools Plugin Developer'), 'cDescription' => t('Management of mootools plugin')), "/dashboard/mootools/plugin" => array('cName' => t('plugin'), 'cDescription' => t('Management of Mootools Plugin that does import')), "/dashboard/mootools/importer" => array('cName' => t('import'), 'cDescription' => t('Import from repository')));
     foreach ($singlePages as $key => $page) {
         $collection = SinglePage::add($key, $pkg);
         if (!empty($collection)) {
             $collection->update($page);
         }
     }
     //The name of the user of github is added to the attribute.
     $values = array("akHandle" => MOOTOOLS_GITHUB_USER, "akName" => t("Name of user of github"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true);
     $key = UserAttributeKey::add("text", $values, $pkg);
     $fileAttributes = array(array("type" => "boolean", "values" => array("akHandle" => MOOTOOLS_PLUGIN, "akName" => t("This file is a plugin of Mootools"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true)), array("type" => "text", "values" => array("akHandle" => MOOTOOLS_COMPONENT_NAME, "akName" => t("Component name of Mootools"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true)), array("type" => "text", "values" => array("akHandle" => MOOTOOLS_PLUGIN_LICENSE, "akName" => t("License of Mootools plugin"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true)), array("type" => "text", "values" => array("akHandle" => MOOTOOLS_PLUGIN_AUTHORS, "akName" => t("Authors of Mootools plugin"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true)), array("type" => "select", "values" => array("akHandle" => MOOTOOLS_PLUGIN_DEPENDENCES, "akName" => t("Dependence of Mootools plugin"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true)), array("type" => "number", "values" => array("akHandle" => MOOTOOLS_PLUGIN_DISPLAY_ORDER, "akName" => t("The order of display of Mootools plugin"), "akIsSearchable" => true, "akIsSearchableIndexed" => true, "akIsAutoCreated" => true, "akIsEditable" => true)));
     $attributesKeys = array();
     foreach ($fileAttributes as $key => $attr) {
         $type = $attr["type"];
         $values = $attr["values"];
         $handle = $values["akHandle"];
         $attributesKeys[$handle] = FileAttributeKey::add($type, $values, $pkg);
     }
     if (!empty($attributesKeys[MOOTOOLS_PLUGIN_DEPENDENCES])) {
         $key = $attributesKeys[MOOTOOLS_PLUGIN_DEPENDENCES];
         $db = Loader::db();
         $db->Replace('atSelectSettings', array('akID' => $key->getAttributeKeyID(), 'akSelectAllowMultipleValues' => true), array('akID'), true);
     }
     BlockType::installBlockTypeFromPackage("mootools_plugin_build_form", $pkg);
     BlockType::installBlockTypeFromPackage("github_tags", $pkg);
     BlockType::installBlockTypeFromPackage("github_issues", $pkg);
     BlockType::installBlockTypeFromPackage("github_repository", $pkg);
     PageTheme::add('small_project', $pkg);
 }
 private function installBlocks($pkg)
 {
     $bt = BlockType::getByHandle('boilerplate_callout');
     if (!$bt || !is_object($bt)) {
         BlockType::installBlockTypeFromPackage('boilerplate_callout', $pkg);
     } else {
         // the block already exists, so we want
         // to update it to use the block from our package
         // this might not be OK for marketplace stuff if
         // you are modifying other packages or the core
         Loader::db()->execute('update Pages set pkgID = ? where btID = ?', array($pkg->pkgID, $bt->getBlockTypeID()));
     }
 }
Exemple #7
0
		/**
		 * refreshes the BlockType's database schema throws an Exception if error
		 * @return void
		 */
		public function refresh() {
			if ($this->getPackageID() > 0) {
				$pkg = Package::getByID($this->getPackageID());
				$resp = BlockType::installBlockTypeFromPackage($this->getBlockTypeHandle(), $pkg, $this->getBlockTypeID());			
				if ($resp != '') {
					throw new Exception($resp);
				}
			} else {
				$resp = BlockType::installBlockType($this->getBlockTypeHandle(), $this->getBlockTypeID());			
				if ($resp != '') {
					throw new Exception($resp);
				}
			}
		}
 public function install()
 {
     $pkg = parent::install();
     //install block
     BlockType::installBlockTypeFromPackage('easyslider_slideshow', $pkg);
 }
Exemple #9
0
	protected function importBlockTypes(SimpleXMLElement $sx) {
		if (isset($sx->blocktypes)) {
			foreach($sx->blocktypes->blocktype as $bt) {
				$pkg = ContentImporter::getPackageObject($bt['package']);
				if (is_object($pkg)) {
					BlockType::installBlockTypeFromPackage($bt['handle'], $pkg);
				} else {
					BlockType::installBlockType($bt['handle']);				
				}
			}
		}
	}
 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'));
 }
Exemple #11
0
 function install()
 {
     $pkg = parent::install();
     BlockType::installBlockTypeFromPackage('tweetcrete', $pkg);
 }
Exemple #12
0
 public function install()
 {
     $pkg = parent::install();
     // install block
     BlockType::installBlockTypeFromPackage('sortable_fancybox_gallery', $pkg);
 }
 private function addBlock($blockHandle)
 {
     if (!is_object(BlockType::getByHandle($blockHandle))) {
         BlockType::installBlockTypeFromPackage($blockHandle, $this->pkg);
     }
 }
Exemple #14
0
 public function install()
 {
     $pkg = parent::install();
     // install block
     BlockType::installBlockTypeFromPackage('premium_google_map', $pkg);
 }
Exemple #15
0
 public function install()
 {
     $pkg = parent::install();
     BlockType::installBlockTypeFromPackage('magnific_popup', $pkg);
 }
 public function install()
 {
     $pkg = parent::install();
     // install block
     BlockType::installBlockTypeFromPackage('markdown', $pkg);
 }
Exemple #17
0
 public function install()
 {
     $pkg = parent::install();
     // install block
     BlockType::installBlockTypeFromPackage('deluxe_image_gallery', $pkg);
 }
Exemple #18
0
 public function install()
 {
     $pkg = parent::install();
     BlockType::installBlockTypeFromPackage($this->pkgHandle, $pkg);
     $this->installPageLinkAttribute($pkg);
 }
 public function install()
 {
     $pkg = parent::install();
     // install block
     BlockType::installBlockTypeFromPackage('hhvm_fixes', $pkg);
 }