예제 #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);
     }
 }
예제 #2
0
 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     $main = SinglePage::add('/dashboard/multisite', $pkg);
     $mainSites = SinglePage::add('/dashboard/multisite/sites', $pkg);
 }
예제 #3
0
 public function run()
 {
     $db = Loader::db();
     $cnt = $db->GetOne('select count(*) from TaskPermissions where tpHandle = ?', array('delete_user'));
     if ($cnt < 1) {
         $g3 = Group::getByID(ADMIN_GROUP_ID);
         $tip = TaskPermission::addTask('delete_user', t('Delete Users'), false);
         if (is_object($g3)) {
             $tip->addAccess($g3);
         }
     }
     Loader::model('single_page');
     $sp = Page::getByPath('/dashboard/settings/multilingual');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/settings/multilingual');
         $d1a->update(array('cName' => t('Multilingual Setup')));
     }
     $sp = Page::getByPath('/dashboard/composer');
     if ($sp->isError()) {
         $d2 = SinglePage::add('/dashboard/composer');
         $d2->update(array('cName' => t('Composer Beta'), 'cDescription' => t('Write for your site.')));
     }
     $sp = Page::getByPath('/dashboard/composer/write');
     if ($sp->isError()) {
         $d3 = SinglePage::add('/dashboard/composer/write');
     }
     $sp = Page::getByPath('/dashboard/composer/drafts');
     if ($sp->isError()) {
         $d4 = SinglePage::add('/dashboard/composer/drafts');
     }
     $sp = Page::getByPath('/dashboard/pages/types/composer');
     if ($sp->isError()) {
         $d5 = SinglePage::add('/dashboard/pages/types/composer');
     }
 }
예제 #4
0
 public function run()
 {
     $sp = Page::getByPath('/dashboard/system/seo/excluded');
     if (!is_object($sp) || $sp->isError()) {
         $sp = SinglePage::add('/dashboard/system/seo/excluded');
         $sp->update(array('cName' => t('Excluded URL Word List')));
         $sp->setAttribute('meta_keywords', 'pretty, slug');
     }
     $bt = BlockType::getByHandle('next_previous');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $db = Loader::db();
     $columns = $db->MetaColumns('Pages');
     if (isset($columns['PTID'])) {
         $db->Execute('alter table Pages drop column ptID');
     }
     if (isset($columns['CTID'])) {
         $db->Execute('alter table Pages drop column ctID');
     }
     $bt = BlockType::getByHandle('search');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
예제 #5
0
 public function run()
 {
     // Since 5.1.0 we've moved around a number of pages in the dashboard
     Loader::model('single_page');
     // Rename Forms to Reports
     $p = Page::getByPath('/dashboard/form_results');
     // We can only run these once so we do a check to see if that's the case.
     if ($p->isError()) {
         return false;
     }
     $p->update(array('cName' => t('Reports'), 'cDescription' => t('Get data from forms and logs.'), 'cHandle' => 'reports'));
     $p->rescanCollectionPath();
     $p = SinglePage::getByID($p->getCollectionID());
     $p->refresh();
     $d3a = SinglePage::add('/dashboard/reports/forms');
     $d3b = SinglePage::add('/dashboard/reports/logs');
     $d3c = SinglePage::add('/dashboard/reports/database');
     $d4 = Page::getByPath('/dashboard/users');
     $d4a = SinglePage::add('/dashboard/users/search');
     $d4b = SinglePage::add('/dashboard/users/add');
     $d4c = SinglePage::add('/dashboard/users/groups');
     $d4d = Page::getByPath("/dashboard/users/attributes");
     $db = Loader::db();
     $db->query("update Pages set cDisplayOrder = 0 where cID = ?", array($d4a->getCollectionID()));
     $db->query("update Pages set cDisplayOrder = 1 where cID = ?", array($d4b->getCollectionID()));
     $db->query("update Pages set cDisplayOrder = 2 where cID = ?", array($d4c->getCollectionID()));
     $db->query("update Pages set cDisplayOrder = 3 where cID = ?", array($d4d->getCollectionID()));
     $p = Page::getByPath('/dashboard/groups');
     $p->delete();
     $p = Page::getByPath('/dashboard/collection_types');
     $p->update(array('cHandle' => 'pages'));
     $p->rescanCollectionPath();
     $p = SinglePage::getByID($p->getCollectionID());
     $p->refresh();
     $p = Page::getByPath('/dashboard/pages/attributes');
     $p->delete();
     $d7a = SinglePage::add('/dashboard/pages/themes');
     $d7b = SinglePage::add('/dashboard/pages/themes/add');
     $d7c = SinglePage::add('/dashboard/pages/themes/inspect');
     $d7d = SinglePage::add('/dashboard/pages/themes/customize');
     $d7e = SinglePage::add('/dashboard/pages/themes/marketplace');
     $d7f = SinglePage::add('/dashboard/pages/types');
     $d7g = SinglePage::add('/dashboard/pages/types/attributes');
     $d7h = SinglePage::add('/dashboard/pages/single');
     $p = Page::getByPath('/dashboard/themes');
     $p->delete();
     $d3a->update(array('cName' => t('Form Results'), 'cDescription' => t('Get submission data.')));
     $d4->update(array('cName' => t('Users and Groups'), 'cDescription' => t('Add and manage people.')));
     $d4a->update(array('cName' => t('Find Users')));
     $d4b->update(array('cName' => t('Add User')));
     $d4c->update(array('cName' => t('Groups')));
     $d4d->update(array('cName' => t('User Attributes')));
     $d7 = Page::getByPath('/dashboard/pages');
     $d7->update(array('cName' => t('Pages and Themes'), 'cDescription' => t('Reskin your site.')));
     $d7f->update(array('cName' => t('Page Types'), 'cDescription' => t('What goes in your site.')));
     $d7h->update(array('cName' => t('Single Pages')));
     $p = Page::getByPath('/dashboard/logs');
     $p->delete();
 }
예제 #6
0
 /**
  * Install package
  */
 public function install()
 {
     $pkg = parent::install();
     mkdir(DIR_CONFIG_SITE . '/pubkeys');
     Loader::model('single_page');
     $d = SinglePage::add('/pubkey', $pkg);
     $d->update(array('cFilename' => "/pubkey.php"));
 }
예제 #7
0
 public function install()
 {
     $this->precheck();
     $this->load_required_models();
     $pkg = parent::install();
     $cp = SinglePage::add('/dashboard/problog/site_importer/', $pkg);
     $cp->update(array('cName' => t('ProBlog Importer'), 'cDescription' => t('Import XML Blog Data')));
 }
예제 #8
0
 public function install()
 {
     $pkg = parent::install();
     // Add the dashboard pages
     $mainPage = SinglePage::add('/dashboard/lgt_events', $pkg);
     $listPage = SinglePage::add('/dashboard/lgt_events/list', $pkg);
     $addPage = SinglePage::add('/dashboard/lgt_events/add', $pkg);
 }
예제 #9
0
파일: controller.php 프로젝트: Remo/cobble
 public function install()
 {
     $pkg = parent::install();
     //Install dashboard page
     Loader::model('single_page');
     $newC = SinglePage::add('/dashboard/cobble', $pkg);
     $newC->update(array('cDescription' => 'A Diagnostic Tool for Concrete 5 '));
 }
 public function install()
 {
     $pkg = parent::install();
     //load all the stuff we need and define essentials
     Loader::model('single_page');
     // dashboard
     $p1 = SinglePage::add('/dashboard/wp_theme_importer/', $pkg);
     $p1->update(array('cName' => t("Worpress Theme Importer"), 'cDescription' => t("Concrete-ize Wordpress themes.")));
 }
예제 #11
0
	public function run() {
		$db = Loader::db();
		Loader::model('collection_attributes');
		Loader::model('single_page');
		Loader::model('file_version');
		
		// Add in stuff that may have gotten missed before
		$p = Page::getByPath('/profile');
		if ($p->isError()) {
			$d1 = SinglePage::add('/profile');
			$d2 = SinglePage::add('/profile/edit');
			$d3 = SinglePage::add('/profile/avatar');				
		}
		$p2 = Page::getByPath('/dashboard/users/registration');
		if ($p2->isError()) {
			$d4 = SinglePage::add('/dashboard/users/registration');
		}
		
		// Move any global blocks to new scrapbook page.
		$sc = Page::getByPath("/dashboard/scrapbook/global");
		$scn = Page::getByPath('/dashboard/scrapbook');
		$scu = Page::getByPath('/dashboard/scrapbook/user');
		if (!$sc->isError()) {
			$blocks = $sc->getBlocks("Global Scrapbook");
			if (count($blocks) > 0) {
				// we create the new shared scrapbook 1
				$a = Area::getOrCreate($scn, t('Shared Scrapbook 1'));
				foreach($blocks as $_b) {
					// we move them into the area on the new page. 
					$_b->move($scn, $a);
					$_b->refreshCacheAll();
				}
			}
			$sc->delete();
		}
		if (!$scu->isError()) {
			$scu->delete();
		}
		//add the new collection attribute keys
		$cak=CollectionAttributeKey::getByHandle('header_extra_content');
		if(!is_object($cak)) {
			CollectionAttributeKey::add('header_extra_content', t('Header Extra Content'), true, null, 'TEXT');
		}
		$cak=CollectionAttributeKey::getByHandle('exclude_search_index');
		if (!is_object($cak)) {
			CollectionAttributeKey::add('exclude_search_index', t('Exclude From Search Index'), true, null, 'BOOLEAN');
		}
		
		//convert file tags to new format, cleaned up with leading and trailing line breaks  
		$fileVersionsData=$db->GetAll('SELECT fID, fvID, fvTags FROM FileVersions');
		foreach($fileVersionsData as $fvData){
			$vals=array( FileVersion::cleanTags($fvData['fvTags']) , $fvData['fID'] , $fvData['fvID'] );
			$db->query('UPDATE FileVersions SET fvTags=? WHERE fID=? AND fvID=?',  $vals );
		}
	}
 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');
 }
예제 #13
0
 private function _upgrade(&$pkg)
 {
     Loader::model('single_page');
     $oldDashboardPage = Page::getByPath('/dashboard/pages/designer_content');
     if ($oldDashboardPage && is_object($oldDashboardPage) && $oldDashboardPage->getCollectionID()) {
         $oldDashboardPage->delete();
     }
     $newDashboardPage = Page::getByPath('/dashboard/blocks/designer_content');
     if (!$newDashboardPage || !is_object($newDashboardPage) || !$newDashboardPage->getCollectionID()) {
         $newDashboardPage = SinglePage::add('/dashboard/blocks/designer_content', $pkg);
     }
     $this->_setupDashboardIcon($newDashboardPage, 'icon-gift');
 }
예제 #14
0
	public function run() {
		// contains all the items that have changed from 5.0.0a1 to the next version
		$db = Loader::db();
		
		// create jobs dashboard page
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('index_search');
		$d11 = SinglePage::add('/dashboard/jobs');
		if (is_object($d11)) {
			$d11->update(array('cName'=>t('Maintenance'), 'cDescription'=>t('Run common cleanup tasks.')));
		}
	}
예제 #15
0
	public function run() {
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('generate_sitemap');
		$d1 = SinglePage::add('/download_file');
		if (is_object($d1)) {
			$d1->update(array('cName'=>'Download File'));
		}
		$d2 = SinglePage::add('/dashboard/logs');
		if (is_object($d2)) {
			$d2->update(array('cName'=>'Logging', 'cDescription' => 'Keep tabs on your site.'));
		}

	}
 private function addSinglePage($path, $name, $description = '', $icon = '')
 {
     Loader::model('single_page');
     $page = Page::getByPath($path);
     if (is_object($page) && $page->getCollectionID() > 0) {
         return;
     }
     $sp = SinglePage::add($path, $this->pkg);
     $sp->update(array('cName' => $name, 'cDescription' => $description));
     if (version_compare(APP_VERSION, '5.6', '>')) {
         if ($icon != '') {
             $sp->setAttribute('icon_dashboard', $icon);
         }
     }
 }
예제 #17
0
 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);
 }
예제 #18
0
 public function run()
 {
     Loader::model('single_page');
     $sp = Page::getByPath('/dashboard/system/basics/interface');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/system/basics/interface');
         $d1a->update(array('cName' => t('Interface Preferences')));
     }
     $sp = Page::getByPath('/dashboard/news');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/news');
         $d1a->update(array('cName' => t('Newsflow')));
         $d1a->setAttribute('exclude_nav', 1);
         $d1a->setAttribute('exclude_search_index', 1);
     }
 }
예제 #19
0
 public function testSystemPageBoolean()
 {
     SinglePage::add('/dashboard/reports');
     $reportsPage = Page::getByPath('/dashboard/reports');
     $this->assertEquals(true, $reportsPage->isSystemPage());
     $page2 = self::createPage('Awesome Page 2');
     $this->assertEquals(false, $page2->isSystemPage());
     $account = SinglePage::add('/account');
     SinglePage::add('/account/profile');
     $profile = Page::getByPath('/account/profile');
     $this->assertEquals(true, $account->isSystemPage());
     $this->assertEquals(true, $profile->isSystemPage());
     $page2->move($profile);
     $this->assertEquals(true, $page2->isSystemPage());
     $page2 = Page::getByPath('/account/profile/awesome-page-2');
     $this->assertEquals(true, $page2->isSystemPage());
 }
예제 #20
0
	protected function importSinglePageStructure(SimpleXMLElement $sx) {
		Loader::model('single_page');
		if (isset($sx->singlepages)) {
			foreach($sx->singlepages->page as $p) {
				$pkg = ContentImporter::getPackageObject($p['package']);
				$spl = SinglePage::add($p['path'], $pkg);
				if (is_object($spl)) { 
					if (isset($p['root']) && $p['root'] == true) {
						$spl->moveToRoot();
					}
					if ($p['name']) {
						$spl->update(array('cName' => $p['name'], 'cDescription' => $p['description']));
					}
				}
			}
		}
	}
 public function refresh($cID = 0, $token)
 {
     if (intval($cID) > 0) {
         if ($this->token->validate('refresh', $token)) {
             Loader::model('single_page');
             $p = SinglePage::getByID($cID);
             $cp = new Permissions($p);
             if ($cp->canAdmin()) {
                 $p->refresh();
                 $this->redirect('/dashboard/pages/single', t('Page Successfully Refreshed.'));
             }
             $this->redirect('/dashboard/pages/single', t('You do not have permissions to refresh this page.'), 1);
         }
         $this->redirect('/dashboard/pages/single', $this->token->getErrorMessage(), 1);
     }
     $this->redirect('/dashboard/pages/single', t('Page Unsuccessfully Refreshed.'), 1);
 }
예제 #22
0
 public function update_profiles()
 {
     if ($this->isPost()) {
         $publicProfilesEnabled = $this->post('public_profiles') ? true : false;
         Config::save('ENABLE_USER_PROFILES', $publicProfilesEnabled);
         if ($publicProfilesEnabled) {
             SinglePage::add('/members');
         } else {
             $membersPage = Page::getByPath('/members');
             if ($membersPage instanceof Page && !$membersPage->isError()) {
                 $membersPage->delete();
             }
         }
         Config::save('GRAVATAR_FALLBACK', $this->post('gravatar_fallback') ? true : false);
         Config::save('GRAVATAR_MAX_LEVEL', Loader::helper('security')->sanitizeString($this->post('gravatar_max_level')));
         Config::save('GRAVATAR_IMAGE_SET', Loader::helper('security')->sanitizeString($this->post('gravatar_image_set')));
         $message = $this->post('public_profiles') ? t('Public profiles have been enabled') : t('Public profiles have been disabled.');
         $this->redirect('/dashboard/system/registration/profiles', $message);
     }
 }
예제 #23
0
파일: controller.php 프로젝트: remo/social
 public function install()
 {
     $pkg = parent::install();
     // Add social single page
     SinglePage::add('social', $pkg);
     // Add dashboard pages.
     $d = SinglePage::add('dashboard/social', $pkg);
     $d->update(array('cName' => t('Social'), 'cDescription' => t('Configure social networks.')));
     SinglePage::add('dashboard/social/facebook', $pkg);
     SinglePage::add('dashboard/social/linkedin', $pkg);
     SinglePage::add('dashboard/social/twitter', $pkg);
     SinglePage::add('dashboard/social/google', $pkg);
     // Add social network attribute keys.
     $this->add_user_attribute_key('facebook_id', 'Facebook ID');
     $this->add_user_attribute_key('linkedin_id', 'LinkedIn ID');
     $this->add_user_attribute_key('twitter_id', 'Twitter ID');
     $this->add_user_attribute_key('google_id', 'Google ID');
     // Basic fields for profile information.
     $this->add_user_attribute_key('first_name', 'First Name');
     $this->add_user_attribute_key('last_name', 'Last Name');
 }
예제 #24
0
 private function getOrAddSinglePage($pkg, $cPath, $cName = '', $cDescription = '')
 {
     Loader::model('single_page');
     $sp = SinglePage::add($cPath, $pkg);
     if (is_null($sp)) {
         //SinglePage::add() returns null if page already exists
         $sp = Page::getByPath($cPath);
     } else {
         //Set page title and/or description...
         $data = array();
         if (!empty($cName)) {
             $data['cName'] = $cName;
         }
         if (!empty($cDescription)) {
             $data['cDescription'] = $cDescription;
         }
         if (!empty($data)) {
             $sp->update($data);
         }
     }
     return $sp;
 }
예제 #25
0
 public function run()
 {
     $bt = BlockType::getByHandle('guestbook');
     if (is_object($bt)) {
         $bt->refresh();
     }
     // add user export users task permission
     $pk = PermissionKey::getByHandle('access_user_search_export');
     if (!$pk instanceof PermissionKey) {
         $pk = PermissionKey::add('user', 'access_user_search_export', 'Export Site Users', 'Controls whether a user can export site users or not', false, false);
         $pa = $pk->getPermissionAccessObject();
         if (!is_object($pa)) {
             $pa = PermissionAccess::create($pk);
         }
         $adminGroup = Group::getByID(ADMIN_GROUP_ID);
         //Make sure "Adminstrators" group still exists
         if ($adminGroup) {
             $adminGroupEntity = GroupPermissionAccessEntity::getOrCreate($adminGroup);
             $pa->addListItem($adminGroupEntity);
             $pt = $pk->getPermissionAssignmentObject();
             $pt->assignPermissionAccess($pa);
         }
     }
     if (!Config::get('SECURITY_TOKEN_JOBS')) {
         Config::save('SECURITY_TOKEN_JOBS', Loader::helper('validation/identifier')->getString(64));
     }
     if (!Config::get('SECURITY_TOKEN_ENCRYPTION')) {
         Config::save('SECURITY_TOKEN_ENCRYPTION', Loader::helper('validation/identifier')->getString(64));
     }
     if (!Config::get('SECURITY_TOKEN_VALIDATION')) {
         Config::save('SECURITY_TOKEN_VALIDATION', Loader::helper('validation/identifier')->getString(64));
     }
     $sp = Page::getByPath('/dashboard/system/mail/method/test_settings');
     if (!is_object($sp) || $sp->isError()) {
         $sp = SinglePage::add('/dashboard/system/mail/method/test_settings');
         $sp->update(array('cName' => t('Test Mail Settings')));
         $sp->setAttribute('meta_keywords', 'test smtp, test mail');
     }
 }
예제 #26
0
 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     $single_page = SinglePage::add('/dashboard/wordpress_import', $pkg);
     $single_page->update(array('cName' => t('WordPress Import'), 'cDescription' => t('Import WordPress Sites')));
     $import_stuff = SinglePage::add('/dashboard/wordpress_import/import', $pkg);
     $import_stuff->update(array('cName' => t('Import')));
     $import_stuff = SinglePage::add('/dashboard/wordpress_import/file', $pkg);
     $import_stuff->update(array('cName' => t('File')));
     $select = AttributeType::getByHandle('select');
     $wpCategory = CollectionAttributeKey::getByHandle('wordpress_category');
     if (!$wpCategory instanceof CollectionAttributeKey) {
         $wpCategory = CollectionAttributeKey::add($select, array('akSelectAllowMultipleValues' => 1, 'akSelectOptionDisplayOrder' => 'popularity_desc', 'akSelectAllowOtherValues' => 1, 'akHandle' => 'wordpress_category', 'akName' => t('Wordpress Category')), $pkg);
     }
     $tags = CollectionAttributeKey::getByHandle('tags');
     if (!$tags instanceof CollectionAttributeKey) {
         $tags = CollectionAttributeKey::add($select, array('akSelectAllowMultipleValues' => 1, 'akSelectOptionDisplayOrder' => 'popularity_desc', 'akSelectAllowOtherValues' => 1, 'akHandle' => 'tagsy', 'akName' => t('Tags')), $pkg);
     }
     $co = new Config();
     $co->setPackageObject($pkg);
     $co->save("WORDPRESS_IMPORT_FID", 0);
 }
예제 #27
0
 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);
 }
예제 #28
0
 /** 
  * Returns an array of package items (e.g. blocks, themes)
  */
 public function getPackageItems()
 {
     $items = array();
     Loader::model('single_page');
     Loader::library('mail/importer');
     Loader::model('job');
     Loader::model('collection_types');
     Loader::model('system/captcha/library');
     Loader::model('system/antispam/library');
     $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'] = CollectionType::getListByPackage($this);
     $items['mail_importers'] = MailImporter::getListByPackage($this);
     $items['configuration_values'] = Config::getListByPackage($this);
     $items['block_types'] = BlockTypeList::getByPackage($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['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this);
     $items['jobs'] = Job::getListByPackage($this);
     $items['workflow_types'] = WorkflowType::getListByPackage($this);
     ksort($items);
     return $items;
 }
예제 #29
0
	public static function getList() {
		$db = Loader::db();
		$r = $db->query("select Pages.cID from Pages inner join Collections on Pages.cID = Collections.cID where cFilename is not null and ctID = 0 order by cDateModified desc");
		$pages = array();
		while ($row = $r->fetchRow()) {
			$p = new SinglePage;
			$p->populatePage($row['cID'], 'where Pages.cID = ?', 'RECENT');
			$pages[] = $p;
		}
		return $pages;
	}
예제 #30
0
	public function getFilesInTheme() {
		Loader::model('collection_types');
		Loader::model('single_page');
		
		$dh = Loader::helper('file');
		$ctlist = CollectionType::getList();
		$cts = array();
		foreach($ctlist as $ct) {
			$cts[] = $ct->getCollectionTypeHandle();
		}
		
		$filesTmp = $dh->getDirectoryContents($this->ptDirectory);
		foreach($filesTmp as $f) {
			if (strrchr($f, '.') == PageTheme::THEME_EXTENSION) {
				$fHandle = substr($f, 0, strpos($f, '.'));
				
				if ($f == FILENAME_THEMES_VIEW) {
					$type = PageThemeFile::TFTYPE_VIEW;
				} else if ($f == FILENAME_THEMES_DEFAULT) {
					$type = PageThemeFile::TFTYPE_DEFAULT;
				} else if (in_array($f, SinglePage::getThemeableCorePages())) {
					$type = PageThemeFile::TFTYPE_SINGLE_PAGE;
				} else if (in_array($fHandle, $cts)) {
					$type = PageThemeFile::TFTYPE_PAGE_TYPE_EXISTING;
				} else {
					$type = PageThemeFile::TFTYPE_PAGE_TYPE_NEW;
				}
				
				$pf = new PageThemeFile();
				$pf->setFilename($f);
				$pf->setType($type);
				$files[] = $pf;
			}
		}
		
		return $files;
	}