本文整理汇总了PHP中PageTheme::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP PageTheme::getByID方法的具体用法?PHP PageTheme::getByID怎么用?PHP PageTheme::getByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageTheme
的用法示例。
在下文中一共展示了PageTheme::getByID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate_files
public function activate_files($ptID)
{
try {
Loader::model("collection_types");
$pt = PageTheme::getByID($ptID);
$txt = Loader::helper('text');
if (!is_array($this->post('pageTypes'))) {
throw new Exception(t("You must specify at least one template to make into a page type."));
}
$pkg = false;
$pkgHandle = $pt->getPackageHandle();
if ($pkgHandle) {
$pkg = Package::getByHandle($pkgHandle);
}
foreach ($this->post('pageTypes') as $ptHandle) {
$data['ctName'] = $txt->unhandle($ptHandle);
$data['ctHandle'] = $ptHandle;
$ct = CollectionType::add($data, $pkg);
}
$this->set('message', t('Files in the theme were activated successfully.'));
} catch (Exception $e) {
$this->set('error', $e);
}
$this->view($ptID);
}
示例2: reset
public function reset() {
$vt = Loader::helper('validation/token');
if ($vt->validate()) {
$themeID = $this->post('themeID');
$pt = PageTheme::getByID($themeID);
if (is_object($pt)) {
$values = $pt->reset();
$this->redirect('/dashboard/pages/themes/customize', 'view', $themeID, 'reset');
}
}
}
示例3: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');
$sh = Loader::helper('concrete/dashboard/sitemap');
if (!$sh->canRead()) {
die(t('Access Denied'));
}
if ($_POST['task'] == 'design_pages') {
$json['error'] = false;
if ($_POST['plID'] > 0) {
$pl = PageTheme::getByID($_POST['plID']);
}
if ($_POST['ctID'] > 0) {
$ct = CollectionType::getByID($_POST['ctID']);
}
if (is_array($_POST['cID'])) {
foreach ($_POST['cID'] as $cID) {
$c = Page::getByID($cID);
$cp = new Permissions($c);
if ($cp->canEditPageTheme($pl)) {
if ($_POST['plID'] > 0) {
$c->setTheme($pl);
}
if ($_POST['ctID'] > 0 && (!$c->isMasterCollection() && !$c->isGeneratedCollection())) {
$parentC = Page::getByID($c->getCollectionParentID());
$parentCP = new Permissions($parentC);
if ($c->getCollectionID() == HOME_CID || $parentCP->canAddSubCollection($ct)) {
$data = array('ctID' => $_POST['ctID']);
$c->update($data);
示例4: getCollectionThemeObject
/**
* Returns Collection's theme object
* @return PageTheme
*/
function getCollectionThemeObject()
{
if ($this->vObj->ptID < 1) {
return PageTheme::getSiteTheme();
} else {
$pl = PageTheme::getByID($this->vObj->ptID);
return $pl;
}
}
示例5: getSiteTheme
public function getSiteTheme() {
$c = Page::getByID(HOME_CID);
return PageTheme::getByID($c->getCollectionThemeID());
}
示例6: activate_confirm
public function activate_confirm($ptID, $token)
{
$l = PageTheme::getByID($ptID);
$val = Loader::helper('validation/error');
$valt = Loader::helper('validation/token');
if (!$valt->validate('activate', $token)) {
$val->add($valt->getErrorMessage());
$this->set('error', $val);
} else {
if (!is_object($l)) {
$val->add('Invalid Theme');
$this->set('error', $val);
} else {
$l->applyToSite();
$this->set('message', t('Theme activated'));
}
}
$this->view();
}
示例7: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::model('collection_types');
Loader::library('view');
if (isset($_POST['ttask']) && $_POST['ttask'] == 'preview_theme_customization') {
Cache::set('preview_theme_style', $_REQUEST['themeID'], $_POST, 30);
}
$previewCID = intval($_REQUEST['previewCID']);
$themeID = intval($_REQUEST['themeID']);
$ctID = intval($_REQUEST['ctID']);
$collectionType = CollectionType::getByID($ctID);
$c = Page::getByID($previewCID, 'RECENT');
//,"ACTIVE"
$cp = new Permissions($c);
if (!$cp->canEditPageTheme()) {
throw new Exception(t('Access Denied'));
}
$v = View::getInstance();
if ($themeID > 0) {
$th = PageTheme::getByID($themeID);
if (!file_exists($th->getThemeDirectory())) {
throw new Exception(t('Theme not found in %s', $th->getThemeDirectory()));
}
$v->setTheme($th);
}
$v->disableEditing();
$v->disableLinks();
$v->enablePreview();
$v->render($c);
示例8: checkMobileView
public function checkMobileView()
{
if (isset($_COOKIE['ccmDisableMobileView']) && $_COOKIE['ccmDisableMobileView'] == true) {
define('MOBILE_THEME_IS_ACTIVE', false);
return false;
// break out if we've said we don't want the mobile theme
}
$page = Page::getCurrentPage();
if ($page instanceof Page && $page->isAdminArea()) {
define('MOBILE_THEME_IS_ACTIVE', false);
return false;
// no mobile theme for the dashboard
}
Loader::library('3rdparty/mobile_detect');
$md = new Mobile_Detect();
if ($md->isMobile()) {
$themeId = Config::get('MOBILE_THEME_ID');
if ($themeId > 0) {
$mobileTheme = PageTheme::getByID($themeId);
if ($mobileTheme instanceof PageTheme) {
define('MOBILE_THEME_IS_ACTIVE', true);
// we have to grab the instance of the view
// since on_page_view doesn't give it to us
$this->setTheme($mobileTheme);
}
}
}
if (!defined('MOBILE_THEME_IS_ACTIVE')) {
define('MOBILE_THEME_IS_ACTIVE', false);
}
}