本文整理汇总了PHP中PageTheme::getByHandle方法的典型用法代码示例。如果您正苦于以下问题:PHP PageTheme::getByHandle方法的具体用法?PHP PageTheme::getByHandle怎么用?PHP PageTheme::getByHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageTheme
的用法示例。
在下文中一共展示了PageTheme::getByHandle方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
}
示例2: 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();
}
示例3: install
public function install($data = array())
{
$pkg = parent::install();
// Set Theme
// check for active themes
$active_theme = PageTheme::getSiteTheme();
// strcmp($active_theme->getThemeHandle(), $themeHandle) == 0
if (is_object($active_theme) && $active_theme->getThemeHandle() !== 'elemental') {
// Theme::setThemeHandle($themeHandle);
// $pt = PageTheme::getByID($pThemeID);
$pt = PageTheme::getByHandle('elemental');
$pt->applyToSite();
}
}
示例4: 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();
}
示例5: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$co = Request::get();
$v = View::getInstance();
$au = $co->getAuxiliaryData();
if (isset($au->theme) && isset($au->file)) {
$pt = PageTheme::getByHandle($au->theme);
$val = Cache::get('preview_theme_style', $pt->getThemeID(), false, true);
header("Content-Type: text/css");
if (is_array($val)) {
$values = $pt->mergeStylesFromPost($val);
}
$pt->outputStyleSheet($au->file, $values);
}
示例6: setThemeByPath
/**
* used by the theme_paths and site_theme_paths files in config/ to hard coded certain paths to various themes
* @access public
* @param $path string
* @param $theme object, if null site theme is default
* @return void
*/
public function setThemeByPath($path, $theme = NULL)
{
if ($theme != VIEW_CORE_THEME && $theme != 'dashboard') {
// this is a hack until we figure this code out.
if (is_string($theme)) {
$pageTheme = PageTheme::getByHandle($theme);
if (is_object($pageTheme) && $pageTheme->getThemeHandle() == $theme) {
// is it the theme that's been requested?
$theme = $pageTheme;
}
}
}
$this->themePaths[$path] = $theme;
}
示例7: foreach
foreach ($jobs as $j) {
$jb = Job::getByHandle($j);
if (is_object($jb)) {
echo "Job {$j} had been installed; skip intalling. <br/>";
} else {
#Job::installByPackage($j, $pkg);
Job::installByHandle($j);
echo "Job {$j} newly installed. <br/>";
}
flush();
ob_flush();
}
// Apply full_stack_style as the site theme
echo '<br/>';
echo 'Applying full_stack_style as site theme...';
$pt = PageTheme::getByHandle('full_stack_style');
$pt->applyToSite();
echo 'Done.<br/>';
// Install event extends here
#Events::extend('on_start', 'FSENLocalization', 'setupInterfaceLocalization4Request', 'models/fsen_localization.php');
#Events::extend('on_before_render', 'FSENLocalization', 'setupInterfaceLocalization4Page', 'models/fsen_localization.php');
// Apply page type for HOME page
echo '<br/>';
echo '<br/>';
echo 'Applying page type for HOME...';
$home_page = Page::getByID(HOME_CID);
$home_type = CollectionType::getByHandle('home');
$home_page->update(array('ctID' => $home_type->getCollectionTypeID()));
echo 'Done. <br/>';
// disable full page cache for HOME page
// $home_page->update (array ('cCacheFullPageContent' => 0));
示例8: 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();
}
}
}
}
示例9: __get
/**
* Convenience getters, mostly for grabbing model properties from views. If
* the data takes a non-trivial time to fetch, store as an object property
* of the same name, so it will be served from that.
* Apart from caching, there must be no side effects.
*
*/
public function __get($name)
{
/* One big switch for all the get names */
switch ($name) {
case 'crumbs':
// @return Array of Page objects, from highest level parent to walk page
$this->crumbs = Loader::helper('navigation')->getTrailToCollection($this->page);
krsort($this->crumbs);
return $this->crumbs;
break;
case 'teamPictures':
// @return Array<Array> of members
$theme = \PageTheme::getByHandle('janeswalk');
$this->teamPictures = array_map(function ($mem) use($theme) {
// TODO: deprecate this special-casing around the member 'you'
if ($mem['type'] === 'you') {
if ($mem['role'] === 'walk-organizer' || $mem['role'] === 'Walk Organizer') {
$mem['type'] = 'organizer';
} else {
$mem['type'] = 'leader';
}
}
switch ($mem['type']) {
case 'leader':
$mem['image'] = $theme->getThemeURL() . '/img/walk-leader.png';
$mem['title'] = 'Walk Leader';
break;
case 'organizer':
$mem['image'] = $theme->getThemeURL() . '/img/walk-organizer.png';
$mem['title'] = 'Walk Organizer';
break;
case 'community':
$mem['image'] = $theme->getThemeURL() . '/img/community-voice.png';
$mem['title'] = 'Community Voice';
break;
case 'volunteer':
$mem['image'] = $theme->getThemeURL() . '/img/volunteers.png';
$mem['title'] = 'Volunteer';
break;
default:
break;
}
if ($mem['user_id'] > 0) {
if ($avatar = Loader::helper('concrete/avatar')->getImagePath(\UserInfo::getByID($mem['user_id']))) {
$mem['avatar'] = $avatar;
}
}
return $mem;
}, (array) $this->team);
return $this->teamPictures;
break;
case 'walkLeaders':
// @return Array of team members who are walk leaders
return array_filter((array) $this->team, function ($mem) {
return strpos($mem['role'], 'leader') !== false || $mem['type'] === 'leader';
});
break;
case 'city':
// @return City of walk's city
$this->city = new City(Page::getByID($this->page->getCollectionParentID()));
return $this->city;
break;
case 'meetingPlace':
// @return Array<title, description> for first stop on walking route
foreach ((array) $this->map['markers'] as $marker) {
$this->meetingPlace = ['title' => $marker['title'], 'description' => $marker['description']];
return $this->meetingPlace;
}
break;
case 'initiatives':
// Initiatives
$this->initiatives = [];
$initiativeObjects = $this->page->getAttribute('walk_initiatives');
if ($initiativeObjects !== false) {
foreach ($initiativeObjects->getOptions() as $initiative) {
$this->initiatives[] = ['id' => $initiative->ID, 'name' => $initiative->value];
}
}
return $this->initiatives;
break;
}
}
示例10: t
<?php
$valt = Loader::helper('validation/token');
$theme = PageTheme::getByHandle("janeswalk");
$turl = $theme->getThemeUrl();
?>
<html id="tool">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" />
<link rel="stylesheet" href="<?php
echo $turl . '/css/screen.css';
?>
">
<link rel="stylesheet" href="<?php
echo $turl . '/css/main.css';
?>
">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<body style="margin:0;padding:0;">
<form method="post" enctype="multipart/form-data" action="<?php
echo REL_DIR_FILES_TOOLS_REQUIRED;
?>
/files/importers/quick" class="ccm-file-manager-submit-single">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="upload-image">
<div class="upload-item text-center">
<span class="btn-file">
<div class="fileupload-preview thumbnail" style="width: 200px; height: 170px;"><br><br><i class="fa fa-camera-retro fa-5x"></i></div>
<br>
<span class="fileupload-new"><?php
echo t('Click to upload an image');
?>