当前位置: 首页>>代码示例>>PHP>>正文


PHP PageTheme::add方法代码示例

本文整理汇总了PHP中PageTheme::add方法的典型用法代码示例。如果您正苦于以下问题:PHP PageTheme::add方法的具体用法?PHP PageTheme::add怎么用?PHP PageTheme::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PageTheme的用法示例。


在下文中一共展示了PageTheme::add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

	public function run() {
		$db = Loader::db();
		Loader::model('single_page');
		
		Cache::disableLocalCache();
		
		//  we backup the custom styles table
		$this->backupCustomStylesTables();
		
		// upgrade blocks that differ between versions
		$this->updateBlocks();
		
		// Migrate data from the custom styles tables to the new approach
		$this->migrateCustomStyleData();		
		
		$this->setupSiteSearchIndexing();
		
		$this->installTaskPermissions();
		
		$this->updateDashboard();
		
		// add the dark chocolate theme 						
		$pt = PageTheme::getByHandle('dark_chocolate');
		if (!is_object($pt)) {
			$chocolate = PageTheme::add('dark_chocolate');
		}
		
		Cache::enableLocalCache();
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:29,代码来源:version_540.php

示例2: install

 public function install($ptHandle = null)
 {
     $th = PageTheme::getByFileHandle($ptHandle);
     if ($ptHandle == null) {
         $this->redirect('/dashboard/pages/themes');
     }
     $v = Loader::helper('validation/error');
     try {
         if (is_object($th)) {
             $t = PageTheme::add($ptHandle);
             $this->redirect('/dashboard/pages/themes/inspect', $t->getThemeID(), 1);
         } else {
             throw new Exception('Invalid Theme');
         }
     } catch (Exception $e) {
         switch ($e->getMessage()) {
             case PageTheme::E_THEME_INSTALLED:
                 $v->add(t('That theme has already been installed.'));
                 break;
             default:
                 $v->add($e->getMessage());
                 break;
         }
         $this->set('error', $v);
     }
     $this->view();
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:27,代码来源:controller.php

示例3: run

 public function run()
 {
     // Since we added the origfilename column in 5.0.0b1 we need to populate it
     Loader::block('library_file');
     $bl = new LibraryFileBlockController();
     $bl->populateOriginalFilenames();
     // install the new block types made available
     BlockType::installBlockType('flash_content');
     BlockType::installBlockType('guestbook');
     BlockType::installBlockType('slideshow');
     BlockType::installBlockType('search');
     BlockType::installBlockType('google_map');
     BlockType::installBlockType('video');
     BlockType::installBlockType('rss_displayer');
     BlockType::installBlockType('youtube');
     BlockType::installBlockType('survey');
     // rename external form
     $bt = BlockType::getByHandle('custom_form');
     $db = Loader::db();
     $tables = $db->MetaTables('TABLES');
     if (isset($tables['btCustomForm']) && !isset($tables['btExternalForm'])) {
         $db->Execute("alter table btCustomForm rename btExternalForm");
     }
     if (is_object($bt)) {
         BlockType::installBlockType('external_form', $bt->getBlockTypeID());
     }
     // add new theme
     $th = PageTheme::getByHandle('greensalad');
     if (!is_object($th)) {
         PageTheme::add('greensalad');
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:32,代码来源:version_500b1.php

示例4: install

 public function install()
 {
     Loader::model('collection_types');
     $pkg = parent::install();
     PageTheme::add('casual', $pkg);
     $pagetypearray = array(array("left_sidebar", "Left Sidebar"), array("right_sidebar", "Right Sidebar"), array("full", "One Column"), array("three_column", "Three Column Layout"));
     foreach ($pagetypearray as $value) {
         $pageType = CollectionType::getByHandle($value[0]);
         if (!$pageType) {
             $pkg = Package::getByHandle('casual');
             $newPageType = CollectionType::add(array('ctHandle' => $value[0], 'ctName' => t($value[1])), $pkg);
         } else {
             $newPageType = $pageType;
         }
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:16,代码来源:controller.php

示例5: install

 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);
 }
开发者ID:holyshared,项目名称:developer-package,代码行数:36,代码来源:controller.php

示例6: run

 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 & 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();
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:87,代码来源:version_560.php

示例7: installThemes

 private function installThemes($pkg)
 {
     PageTheme::add('boilerplate', $pkg);
 }
开发者ID:janzenz,项目名称:c5_boilerplate,代码行数:4,代码来源:controller.php

示例8: array

FSENLocalization::setupInterfaceLocalization4AjaxRequest();
#exit (0);
// make directories
Loader::model('single_page');
Loader::model('job');
$pkg = null;
// install themes
echo '<br/>';
echo 'Installing themes... <br/>';
$themes = array('full_stack_style', 'full_stack_style_mobile');
foreach ($themes as $t) {
    $pt = PageTheme::getByHandle($t);
    if ($pt instanceof PageTheme) {
        echo "{$t} had been installed; skip installing. <br/>";
    } else {
        PageTheme::add($t, $pkg);
        echo "{$t} newly installed. <br/>";
    }
    flush();
    ob_flush();
}
// install blocks
$bts = array('document_section', 'fse_app_key', 'fse_change_password', 'fse_delete_account', 'fse_email_settings', 'fse_login', 'fse_profile', 'fse_projects', 'fse_public_profile', 'fse_register', 'fse_request_to_reset_password', 'fse_reset_password', 'project_banner');
echo '<br/>';
echo 'Installing block types... <br/>';
foreach ($bts as $b) {
    $bt = BlockType::getByHandle($b);
    if ($bt instanceof BlockType) {
        echo "{$b} had been installed; skip installing. <br/>";
    } else {
        #BlockType::installBlockTypeFromPackage($b, $pkg);
开发者ID:rratcliffe,项目名称:fsen,代码行数:31,代码来源:install.php

示例9: importThemes

	protected function importThemes(SimpleXMLElement $sx) {
		if (isset($sx->themes)) {
			foreach($sx->themes->theme as $th) {
				$pkg = ContentImporter::getPackageObject($th['package']);
				$ptHandle = (string) $th['handle'];
				$pt = PageTheme::getByHandle($ptHandle);
				if (!is_object($pt)) {
					$pt = PageTheme::add($ptHandle, $pkg);
				}
				if ($th['activated'] == '1') {
					$pt->applyToSite();
				}
			}
		}
	}
开发者ID:nveid,项目名称:concrete5,代码行数:15,代码来源:importer.php


注:本文中的PageTheme::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。