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


PHP Utility::getCurrentTemplate方法代码示例

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


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

示例1: init

 /**
  * Initialize admin page theme
  */
 public function init()
 {
     $arrThemes = Utility::getCurrentTemplate('public');
     Yii::app()->theme = $arrThemes['folder'];
     $this->layout = $arrThemes['layout'];
     $this->dialogFixed = true;
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:10,代码来源:ForgotController.php

示例2: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id = null, $static = null)
 {
     $arrThemes = Utility::getCurrentTemplate('public');
     Yii::app()->theme = $arrThemes['folder'];
     $this->layout = $arrThemes['layout'];
     Utility::applyCurrentTheme($this->module);
     //$this->pageGuest = true;
     if ($id == null) {
         $criteria = new CDbCriteria();
         $criteria->condition = 'publish = :publish';
         $criteria->params = array(':publish' => 1);
         $criteria->order = 'creation_date DESC';
         $dataProvider = new CActiveDataProvider('OmmuPages', array('criteria' => $criteria, 'pagination' => array('pageSize' => 10)));
         $this->pageTitle = '';
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('application.webs.page.front_index', array('dataProvider' => $dataProvider));
     } else {
         if ($static == null) {
             $model = $this->loadModel($id);
             $title = Phrase::trans($model->name, 2);
             $description = Phrase::trans($model->desc, 2);
             $image = $model->media != '' && $model->media_show == 1 ? Yii::app()->request->baseUrl . '/public/page/' . $model->media : '';
         } else {
             $server = Utility::getConnected(Yii::app()->params['server_options']['bpad']);
             if ($server != 'neither-connected') {
                 if (in_array($server, Yii::app()->params['server_options']['localhost'])) {
                     $server = $server . '/bpadportal';
                 }
                 $url = $server . preg_replace('(' . Yii::app()->request->baseUrl . ')', '', Yii::app()->createUrl('api/page/detail'));
                 $item = array('id' => $id);
                 $items = http_build_query($item);
                 $ch = curl_init();
                 curl_setopt($ch, CURLOPT_URL, $url);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                 //curl_setopt($ch,CURLOPT_HEADER, true);
                 curl_setopt($ch, CURLOPT_POST, true);
                 curl_setopt($ch, CURLOPT_POSTFIELDS, $items);
                 $output = curl_exec($ch);
                 $model = json_decode($output);
             }
             $title = $model->success == '0' ? 'Page not found' : $model->title;
             $description = $model->success == '0' ? '' : $model->description;
             $image = $model->success == '0' ? '' : $model->media_image != '-' ? $model->media_image : '';
         }
         if ($static == null && $model == null || $static != null && $model->success == '0') {
             throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
         }
         $this->pageTitleShow = true;
         $this->pageTitle = $title;
         $this->pageDescription = Utility::shortText(Utility::hardDecode($description), 200);
         $this->pageMeta = '';
         $this->pageImage = $image;
         $this->render('application.webs.page.front_view', array('model' => $model, 'a' => $static));
     }
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:60,代码来源:PageController.php

示例3: init

 /**
  * Initialize admin page theme
  */
 public function init()
 {
     if (ArticleSetting::getInfo('permission') == 1) {
         $arrThemes = Utility::getCurrentTemplate('public');
         Yii::app()->theme = $arrThemes['folder'];
         $this->layout = $arrThemes['layout'];
     } else {
         $this->redirect(Yii::app()->createUrl('site/index'));
     }
 }
开发者ID:OmmuOpenSource,项目名称:Swvl,代码行数:13,代码来源:SiteController.php

示例4: init

 /**
  * Initialize public template
  */
 public function init()
 {
     $arrThemes = Utility::getCurrentTemplate('public');
     Yii::app()->theme = $arrThemes['folder'];
     $this->layout = $arrThemes['layout'];
     //load Lucene Library
     Yii::import('application.vendors.*');
     require_once 'Zend/Search/Lucene.php';
     parent::init();
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:13,代码来源:SearchController.php

示例5: init

 /**
  * Initialize public template
  */
 public function init()
 {
     $setting = OmmuSettings::model()->findByPk(1, array('select' => 'online, construction_date'));
     if ($setting->online == 0 && date('Y-m-d', strtotime($setting->construction_date)) > date('Y-m-d')) {
         $arrThemes = Utility::getCurrentTemplate('underconstruction');
         Yii::app()->theme = $arrThemes['folder'];
         $this->layout = $arrThemes['layout'];
     } else {
         $this->redirect(Yii::app()->createUrl('site/index'));
     }
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:14,代码来源:MaintenanceController.php

示例6: init

 /**
  * Initialize admin page theme
  */
 public function init()
 {
     if (!Yii::app()->user->isGuest) {
         if (in_array(Yii::app()->user->level, array(1, 2))) {
             $arrThemes = Utility::getCurrentTemplate('admin');
             Yii::app()->theme = $arrThemes['folder'];
             $this->layout = $arrThemes['layout'];
         } else {
             throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
         }
     } else {
         $this->redirect(Yii::app()->createUrl('site/login'));
     }
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:17,代码来源:TemplateController.php

示例7: init

 /**
  * Initialize admin page theme
  */
 public function init()
 {
     if (!Yii::app()->user->isGuest) {
         if (in_array(Yii::app()->user->level, array(1, 2))) {
             $arrThemes = Utility::getCurrentTemplate('admin');
             Yii::app()->theme = $arrThemes['folder'];
             $this->layout = $arrThemes['layout'];
         } else {
             $this->redirect(Yii::app()->createUrl('site/login'));
         }
     } else {
         $this->redirect(Yii::app()->createUrl('site/login'));
     }
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:17,代码来源:TranslateController.php

示例8: beforeControllerAction

 public function beforeControllerAction($controller, $action)
 {
     if (parent::beforeControllerAction($controller, $action)) {
         // this method is called before any module controller action is performed
         // you may place customized code here
         //list public controller in this module
         $publicControllers = array('site', 'user');
         // pake ini untuk set theme per action di controller..
         // $currentAction = Yii::app()->controller->id.'/'.$action->id;
         if (!in_array(strtolower(Yii::app()->controller->id), $publicControllers) && !Yii::app()->user->isGuest) {
             $arrThemes = Utility::getCurrentTemplate('admin');
             Yii::app()->theme = $arrThemes['folder'];
             $this->layout = $arrThemes['layout'];
         }
         Utility::applyCurrentTheme($this);
         return true;
     } else {
         return false;
     }
 }
开发者ID:ommu,项目名称:Vacancy-Advanced,代码行数:20,代码来源:VacancyModule.php

示例9: actionAjaxDelete

 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionAjaxDelete($id)
 {
     if (!isset($_GET['type'])) {
         $arrThemes = Utility::getCurrentTemplate('public');
         Yii::app()->theme = $arrThemes['folder'];
         $this->layout = $arrThemes['layout'];
         Utility::applyCurrentTheme($this->module);
     }
     $model = $this->loadModel($id);
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         if (isset($id)) {
             if ($model->delete()) {
                 $url = Yii::app()->controller->createUrl('ajaxmanage', array('id' => $model->article_id, 'replace' => 'true'));
                 echo CJSON::encode(array('type' => 2, 'id' => 'media-render', 'get' => $url));
             }
         }
     } else {
         $this->dialogDetail = true;
         $this->dialogGroundUrl = Yii::app()->controller->createUrl('admin/edit', array('id' => $model->article_id));
         $this->dialogWidth = 350;
         $this->pageTitle = Phrase::trans(26056, 1);
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('front_delete');
     }
 }
开发者ID:OmmuOpenSource,项目名称:Nirwasita,代码行数:32,代码来源:MediaController.php

示例10: init

 /**
  * Initialize admin page theme
  */
 public function init()
 {
     $arrThemes = Utility::getCurrentTemplate('admin');
     Yii::app()->theme = $arrThemes['folder'];
     $this->layout = $arrThemes['layout'];
 }
开发者ID:OmmuOpenSource,项目名称:OOS-Company-Profile,代码行数:9,代码来源:AdminController.php

示例11: getTemplateModule

 public static function getTemplateModule($moduleId, $publicControllerActions)
 {
     $currentControllerAction = str_replace("/{$moduleId}/", '', str_replace(Yii::app()->baseUrl, '', $_SERVER["REQUEST_URI"]));
     $part = explode('/', $currentControllerAction);
     if (in_array($currentControllerAction, $publicControllerActions)) {
         //public group
         $groupPage = 'public';
     } else {
         if (!Yii::app()->user->isGuest) {
             $groupPage = Yii::app()->user->id == 1 ? 'admin_sweeto' : 'back_office';
         }
     }
     return $arrThemes = Utility::getCurrentTemplate($groupPage);
 }
开发者ID:alfinresa,项目名称:demo,代码行数:14,代码来源:Utility.php


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