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


PHP PageTheme::getByID方法代码示例

本文整理汇总了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);
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:25,代码来源:inspect.php

示例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');
			}
		}
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:11,代码来源:customize.php

示例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);
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:design.php

示例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;
     }
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:13,代码来源:page.php

示例5: getSiteTheme

	public function getSiteTheme() {
		$c = Page::getByID(HOME_CID);
		return PageTheme::getByID($c->getCollectionThemeID());
	}
开发者ID:remkoj,项目名称:concrete5,代码行数:4,代码来源:page_theme.php

示例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();
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:19,代码来源:controller.php

示例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);
开发者ID:Zyqsempai,项目名称:amanet,代码行数:30,代码来源:preview_internal.php

示例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);
     }
 }
开发者ID:Mihail9575,项目名称:concrete5,代码行数:31,代码来源:view.php


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