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);
     }
 }
Exemple #2
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');
     }
 }
Exemple #3
0
 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     $main = SinglePage::add('/dashboard/multisite', $pkg);
     $mainSites = SinglePage::add('/dashboard/multisite/sites', $pkg);
 }
 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();
     }
 }
 public function view($message = null, $error = null)
 {
     Loader::model('single_page');
     $this->set('generated', SinglePage::getList());
     if ($message && !$error) {
         $this->set('message', $message);
     } else {
         if ($message) {
             $this->error->add($message);
         }
     }
     if ($this->isPost()) {
         if ($this->token->validate('add_single_page')) {
             $pathToNode = SinglePage::getPathToNode($this->post('pageURL'), false);
             $path = SinglePage::sanitizePath($this->post('pageURL'));
             if (strlen($pathToNode) > 0) {
                 // now we check to see if this is already added
                 $pc = Page::getByPath('/' . $path, 'RECENT');
                 if ($pc->getError() == COLLECTION_NOT_FOUND) {
                     SinglePage::add($this->post('pageURL'));
                     $this->redirect('/dashboard/pages/single', t('Page Successfully Added.'));
                 } else {
                     $this->redirect('/dashboard/pages/single', t("That page has already been added."), 1);
                 }
             } else {
                 $this->redirect('/dashboard/pages/single', t('That specified path doesn\'t appear to be a valid static page.'), 1);
             }
         }
         $this->redirect('/dashboard/pages/single', $this->token->getErrorMessage(), 1);
     }
 }
Exemple #6
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();
 }
Exemple #7
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"));
 }
 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);
 }
 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')));
 }
Exemple #10
0
 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.")));
 }
Exemple #12
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');
 }
Exemple #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.')));
		}
	}
Exemple #15
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');
 }
Exemple #16
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);
         }
     }
 }
 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);
 }
Exemple #19
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);
     }
 }
Exemple #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 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());
 }
Exemple #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);
     }
 }
Exemple #23
0
 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');
 }
Exemple #24
0
 public function view()
 {
     $this->set('generated', SinglePage::getList());
     if ($this->isPost()) {
         if ($this->token->validate('add_single_page')) {
             $pathToNode = SinglePage::getPathToNode($this->post('pageURL'), false);
             $path = SinglePage::sanitizePath($this->post('pageURL'));
             if (strlen($pathToNode) > 0) {
                 // now we check to see if this is already added
                 $pc = Page::getByPath('/' . $path, 'RECENT');
                 if ($pc->getError() == COLLECTION_NOT_FOUND) {
                     SinglePage::add($path);
                     $this->redirect('/dashboard/pages/single', 'single_page_added');
                 } else {
                     $this->error->add(t("That page has already been added."));
                 }
             } else {
                 $this->error->add(t('That specified path doesn\'t appear to be a valid static page.'));
             }
         }
     }
 }
Exemple #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');
     }
 }
 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;
 }
 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);
 }
 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);
 }
 public function up(Schema $schema)
 {
     \Concrete\Core\Database\Schema\Schema::refreshCoreXMLSchema(array('ConversationPermissionAddMessageAccessList', 'ConversationSubscriptions', 'Conversations'));
     // Subscribe admin to conversations by default, if we have no subscriptions
     $users = \Conversation::getDefaultSubscribedUsers();
     if (count($users) == 0) {
         $admin = \UserInfo::getByID(USER_SUPER_ID);
         if (is_object($admin)) {
             $users = array($admin);
             \Conversation::setDefaultSubscribedUsers($users);
         }
     }
     $db = \Database::get();
     $db->Execute('DROP TABLE IF EXISTS PageStatistics');
     $pp = $schema->getTable('PagePaths');
     if (!$pp->hasColumn('ppGeneratedFromURLSlugs')) {
         $db->Execute('alter table PagePaths add column ppGeneratedFromURLSlugs tinyint(1) unsigned not null default 0');
         // we have to do this directly because the page path calls below will die otherwise.
     }
     $bt = BlockType::getByHandle('page_list');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = BlockType::getByHandle('page_title');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = BlockType::getByHandle('form');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $c = \Page::getByPath('/dashboard/system/seo/urls');
     if (is_object($c) && !$c->isError()) {
         $c->update(array('cName' => 'URLs and Redirection'));
     }
     $sp = \Page::getByPath('/dashboard/system/environment/entities');
     if (!is_object($sp) || $sp->isError()) {
         $sp = \SinglePage::add('/dashboard/system/environment/entities');
         $sp->update(array('cName' => 'Database Entities'));
         $sp->setAttribute('meta_keywords', 'database, entities, doctrine, orm');
     }
     $pkx = Category::getByHandle('multilingual_section');
     if (!is_object($pkx)) {
         $pkx = Category::add('multilingual_section');
     }
     $pkx->associateAccessEntityType(Type::getByHandle('group'));
     $pkx->associateAccessEntityType(Type::getByHandle('user'));
     $pkx->associateAccessEntityType(Type::getByHandle('group_combination'));
     $db->Execute("alter table QueueMessages modify column body longtext not null");
     $ms = $schema->getTable('MultilingualSections');
     if (!$ms->hasColumn('msNumPlurals')) {
         $ms->addColumn('msNumPlurals', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 2));
         $this->updateSectionPlurals = true;
     }
     if (!$ms->hasColumn('msPluralRule')) {
         $ms->addColumn('msPluralRule', 'string', array('notnull' => true, 'length' => 400, 'default' => '(n != 1)'));
         $this->updateSectionPlurals = true;
     }
     if (!$ms->hasColumn('msPluralCases')) {
         $ms->addColumn('msPluralCases', 'string', array('notnull' => true, 'length' => 1000, 'default' => "one@1\nother@0, 2~16, 100, 1000, 10000, 100000, 1000000, …"));
         $this->updateSectionPlurals = true;
     }
     $mt = $schema->getTable('MultilingualTranslations');
     if (!$mt->hasColumn('msgidPlural')) {
         $mt->addColumn('msgidPlural', 'text', array('notnull' => false));
         $this->updateMultilingualTranslations = true;
     }
     if (!$mt->hasColumn('msgstrPlurals')) {
         $mt->addColumn('msgstrPlurals', 'text', array('notnull' => false));
         $this->updateMultilingualTranslations = true;
     }
     $cms = $schema->getTable('ConversationMessages');
     if (!$cms->hasColumn('cnvMessageAuthorName')) {
         $cms->addColumn('cnvMessageAuthorName', 'string', array('notnull' => false, 'length' => 255));
     }
     if (!$cms->hasColumn('cnvMessageAuthorEmail')) {
         $cms->addColumn('cnvMessageAuthorEmail', 'string', array('notnull' => false, 'length' => 255));
     }
     if (!$cms->hasColumn('cnvMessageAuthorWebsite')) {
         $cms->addColumn('cnvMessageAuthorWebsite', 'string', array('notnull' => false, 'length' => 255));
     }
     $this->updatePermissionDurationObjects();
     $key = Key::getByHandle('add_conversation_message');
     if (is_object($key) && !$key->permissionKeyHasCustomClass()) {
         $key->setPermissionKeyHasCustomClass(true);
     }
     $this->installMaintenanceModePermission();
 }
Exemple #30
0
 public function run()
 {
     if (!Config::get('SITE_INSTALLED_APP_VERSION')) {
         Config::save('SITE_INSTALLED_APP_VERSION', Config::get('SITE_APP_VERSION'));
     }
     BlockTypeList::resetBlockTypeDisplayOrder();
     $th = PageTheme::getByHandle('greek_yogurt');
     if (!is_object($th)) {
         PageTheme::add('greek_yogurt');
     }
     $bt = BlockType::getByHandle('core_scrapbook_display');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = BlockType::getByHandle('search');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $sp = Page::getByPath('/dashboard/users/group_sets');
     if ($sp->isError()) {
         $d11 = SinglePage::add('/dashboard/users/group_sets');
         $d11->update(array('cName' => t('Group Sets')));
     }
     $sp = Page::getByPath('/dashboard/system/seo/bulk_seo_tool');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/system/seo/bulk_seo_tool');
         $d1a->update(array('cName' => t('Bulk SEO Updater')));
     }
     $sp = Page::getByPath('/dashboard/system/permissions/users');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/system/permissions/users');
         $d1a->update(array('cName' => t('User Permissions')));
     }
     $sp = Page::getByPath('/dashboard/blocks/permissions');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/blocks/permissions');
         $d1a->update(array('cName' => t('Block &amp; Stack Permissions')));
     }
     $sp = Page::getByPath('/dashboard/system/permissions/advanced');
     if ($sp->isError()) {
         $d1b = SinglePage::add('/dashboard/system/permissions/advanced');
         $d1b->update(array('cName' => t('Advanced Permissions')));
     }
     $sp = Page::getByPath('/dashboard/workflow');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/workflow');
         $d1a->update(array('cName' => t('Workflow')));
     }
     $sp = Page::getByPath('/dashboard/workflow/list');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/workflow/list');
     }
     $sp = Page::getByPath('/dashboard/workflow/me');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/workflow/me');
         $d1a->update(array('cName' => t('Waiting for Me')));
     }
     $sp = Page::getByPath('/dashboard/system/environment/proxy');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/system/environment/proxy');
         $d1a->update(array('cName' => t('Proxy Server')));
     }
     // update meta keywords
     $pageKeywords = array('/dashboard/composer' => t('blog, blogging'), '/dashboard/composer/write' => t('new blog, write blog, blogging'), '/dashboard/composer/drafts' => t('blog drafts, composer'), '/dashboard/sitemap' => t('pages, add page, delete page, copy, move, alias'), '/dashboard/sitemap/full' => t('pages, add page, delete page, copy, move, alias'), '/dashboard/sitemap/explore' => t('pages, add page, delete page, copy, move, alias, bulk'), '/dashboard/sitemap/search' => t('find page, search page, search, find, pages, sitemap'), '/dashboard/files/search' => t('add file, delete file, copy, move, alias, resize, crop, rename, images, title, attribute'), '/dashboard/files/attributes' => t('file, file attributes, title, attribute, description, rename'), '/dashboard/files/sets' => t('files, category, categories'), '/dashboard/files/add_set' => t('new file set'), '/dashboard/users' => t('users, groups, people, find, delete user, remove user, change password, password'), '/dashboard/users/search' => t('find, search, people, delete user, remove user, change password, password'), '/dashboard/users/groups' => t('user, group, people, permissions, access, expire'), '/dashboard/users/attributes' => t('user attributes, user data, gather data, registration data'), '/dashboard/users/add' => t('new user, create'), '/dashboard/users/add_group' => t('new user group, new group, group, create'), '/dashboard/users/group_sets' => t('group set'), '/dashboard/reports' => t('forms, log, error, email, mysql, exception, survey'), '/dashboard/reports/statistics' => t('hits, pageviews, visitors, activity'), '/dashboard/reports/forms' => t('forms, questions, response, data'), '/dashboard/reports/surveys' => t('questions, quiz, response'), '/dashboard/reports/logs' => t('forms, log, error, email, mysql, exception, survey, history'), '/dashboard/pages/themes' => t('new theme, theme, active theme, change theme, template, css'), '/dashboard/pages/themes/add' => t('theme'), '/dashboard/pages/themes/inspect' => t('page types'), '/dashboard/pages/themes/customize' => t('custom theme, change theme, custom css, css'), '/dashboard/pages/types' => t('page type defaults, global block, global area, starter, template'), '/dashboard/pages/attributes' => t('page attributes, custom'), '/dashboard/pages/single' => t('single, page, custom, application'), '/dashboard/workflow' => t('add workflow, remove workflow'), '/dashboard/blocks/stacks' => t('stacks, reusable content, scrapbook, copy, paste, paste block, copy block, site name, logo'), '/dashboard/blocks/stacks/list' => t('edit stacks, view stacks, all stacks'), '/dashboard/blocks/types' => t('block, refresh, custom'), '/dashboard/extend' => t('add-on, addon, add on, package, applications, ecommerce, discussions, forums, themes, templates, blocks'), '/dashboard/extend/install' => t('add-on, addon, ecommerce, install, discussions, forums, themes, templates, blocks'), '/dashboard/extend/update' => t('update, upgrade'), '/dashboard/extend/connect' => t('concrete5.org, my account, marketplace'), '/dashboard/extend/themes' => t('buy theme, new theme, marketplace, template'), '/dashboard/extend/add-ons' => t('buy addon, buy add on, buy add-on, purchase addon, purchase add on, purchase add-on, find addon, new addon, marketplace'), '/dashboard/system' => t('dashboard, configuration'), '/dashboard/system/basics/site_name' => t('website name, title'), '/dashboard/system/basics/icons' => t('logo, favicon, iphone, icon, bookmark'), '/dashboard/system/basics/editor' => t('tinymce, content block, fonts, editor, content, overlay'), '/dashboard/system/basics/multilingual' => t('translate, translation, internationalization, multilingual'), '/dashboard/system/basics/timezone' => t('timezone, profile, locale'), '/dashboard/system/basics/interface' => t('interface, quick nav, dashboard background, background image'), '/dashboard/system/seo/urls' => t('vanity, pretty url, seo, pageview, view'), '/dashboard/system/seo/bulk_seo_tool' => t('bulk, seo, change keywords, engine, optimization, search'), '/dashboard/system/seo/tracking_codes' => t('traffic, statistics, google analytics, quant, pageviews, hits'), '/dashboard/system/seo/statistics' => t('turn off statistics, tracking, statistics, pageviews, hits'), '/dashboard/system/seo/search_index' => t('configure search, site search, search option'), '/dashboard/system/optimization/cache' => t('cache option, change cache, override, turn on cache, turn off cache, no cache, page cache, caching'), '/dashboard/system/optimization/clear_cache' => t('cache option, turn off cache, no cache, page cache, caching'), '/dashboard/system/optimization/jobs' => t('index search, reindex search, build sitemap, sitemap.xml, clear old versions, page versions, remove old'), '/dashboard/system/permissions/site' => t('editors, hide site, offline, private, public, access'), '/dashboard/system/permissions/files' => t('file options, file manager, upload, modify'), '/dashboard/system/permissions/file_types' => t('security, files, media, extension, manager, upload'), '/dashboard/system/permissions/tasks' => t('security, actions, administrator, admin, package, marketplace, search'), '/dashboard/system/permissions/ip_blacklist' => t('security, lock ip, lock out, block ip, address, restrict, access'), '/dashboard/system/permissions/captcha' => t('security, registration'), '/dashboard/system/permissions/antispam' => t('antispam, block spam, security'), '/dashboard/system/permissions/maintenance_mode' => t('lock site, under construction, hide, hidden'), '/dashboard/system/registration/postlogin' => t('profile, login, redirect, specific, dashboard, administrators'), '/dashboard/system/registration/profiles' => t('member profile, member page, community, forums, social, avatar'), '/dashboard/system/registration/public_registration' => t('signup, new user, community'), '/dashboard/system/mail' => t('smtp, mail settings'), '/dashboard/system/mail/method' => t('email server, mail settings, mail configuration, external, internal'), '/dashboard/system/mail/importers' => t('email server, mail settings, mail configuration, private message, message system, import, email, message'), '/dashboard/system/attributes' => t('attribute configuration'), '/dashboard/system/attributes/sets' => t('attributes, sets'), '/dashboard/system/attributes/types' => t('attributes, types'), '/dashboard/system/environment/info' => t('overrides, system info, debug, support, help'), '/dashboard/system/environment/debug' => t('errors, exceptions, develop, support, help'), '/dashboard/system/environment/logging' => t('email, logging, logs, smtp, pop, errors, mysql, log'), '/dashboard/system/environment/file_storage_locations' => t('security, alternate storage, hide files'), '/dashboard/system/environment/proxy' => t('network, proxy server'), '/dashboard/system/backup_restore' => t('export, backup, database, sql, mysql, encryption, restore'), '/dashboard/system/backup_restore/update' => t('upgrade, new version, update'), '/dashboard/system/backup_restore/database' => t('export, database, xml, starting, points, schema, refresh, custom, tables'), '/dashboard/system/seo/search_index' => t('configure search, site search, search option'), '/dashboard/system/optimization/cache' => t('cache option, change cache, override, turn on cache, turn off cache, no cache, page cache, caching'));
     foreach ($pageKeywords as $page => $keywords) {
         $p = Page::getByPath($page, 'ACTIVE');
         $ak = CollectionAttributeKey::getByHandle('meta_keywords');
         if (is_object($p) && !$p->isError() && $ak instanceof AttributeKey) {
             $p->setAttribute('meta_keywords', $keywords);
         }
     }
     // install the permissions from permissions.xml
     $this->installPermissionsAndWorkflow();
     $this->addGlobalBlockPermissions();
     $this->migratePagePermissions();
     $this->migratePagePermissionPageTypes();
     $this->migrateAreaPermissions();
     $this->migrateAreaPermissionBlockTypes();
     $this->migrateBlockPermissions();
     $this->migrateFileSetPermissions();
     $this->migrateAddFilePermissions();
     $this->migrateFilePermissions();
     $this->migrateTaskPermissions();
     $this->migrateThemes();
     $this->migratePageTypes();
     $this->setupDashboardIcons();
 }