當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Current::isSettingMode方法代碼示例

本文整理匯總了PHP中Current::isSettingMode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Current::isSettingMode方法的具體用法?PHP Current::isSettingMode怎麽用?PHP Current::isSettingMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Current的用法示例。


在下文中一共展示了Current::isSettingMode方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: beforeRender

 /**
  * beforeRender
  *
  * @param Controller $controller Controller
  * @return void
  * @throws NotFoundException
  */
 public function beforeRender(Controller $controller)
 {
     //RequestActionの場合、スキップする
     if (!empty($controller->request->params['requested'])) {
         return;
     }
     $this->controller = $controller;
     $this->__prepare();
     //pathからページデータ取得
     if (isset($this->controller->viewVars['page'])) {
         $page = $this->controller->viewVars['page'];
     } else {
         $this->Page = ClassRegistry::init('Pages.Page');
         $page = $this->Page->getPageWithFrame(Current::read('Page.permalink'));
         if (empty($page)) {
             throw new NotFoundException();
         }
     }
     if (Current::hasSettingMode() && Current::isSettingMode() && Current::permission('page_editable')) {
         $this->controller->request->data['ContainersPage'] = Hash::combine($page, 'Container.{n}.type', 'Container.{n}.ContainersPage');
     }
     ////cancelUrlをセット
     //if (! isset($this->controller->viewVars['cancelUrl'])) {
     //	$this->controller->set('cancelUrl', $page['Page']['permalink']);
     //}
     //Pluginデータ取得
     $pluginsRoom = ClassRegistry::init('PluginManager.PluginsRoom');
     $plugins = $pluginsRoom->getPlugins($page['Page']['room_id'], Current::read('Language.id'));
     //ページHelperにセット
     $results = array('containers' => Hash::combine($page['Container'], '{n}.type', '{n}'), 'boxes' => Hash::combine($page['Box'], '{n}.id', '{n}', '{n}.container_id'), 'plugins' => $plugins);
     $this->controller->helpers['Pages.PageLayout'] = $results;
 }
開發者ID:Onasusweb,項目名稱:Pages,代碼行數:39,代碼來源:PageLayoutComponent.php

示例2: getBlockStatus

 /**
  * ブロックのステータスラベルを表示
  *
  * @param null|bool $isSetting 強製的にセッティングモード
  * @return string HTML
  */
 public function getBlockStatus($isSetting = null)
 {
     if (!Current::permission('block_editable')) {
         return '';
     }
     if (!isset($isSetting)) {
         $isSetting = Current::isSettingMode();
     }
     if (!$isSetting || !Current::read('Block.id')) {
         return '';
     }
     $block = Current::read('Block', array());
     $publicType = Hash::get($block, 'public_type');
     if ($publicType === Block::TYPE_PUBLIC) {
         return '';
     }
     $html = $this->__getBlockStatus();
     return $html;
 }
開發者ID:akagane99,項目名稱:Blocks,代碼行數:25,代碼來源:BlocksHelper.php

示例3: index

 /**
  * index method
  *
  * @throws NotFoundException
  * @return void
  */
 public function index()
 {
     if (Current::isSettingMode() && !Current::permission('page_editable')) {
         $paths = func_get_args();
         $path = implode('/', $paths);
         $this->redirect('/' . $path);
         return;
     }
     $paths = func_get_args();
     $path = implode('/', $paths);
     $page = $this->Page->getPageWithFrame($path);
     if (empty($page)) {
         throw new NotFoundException();
     }
     $this->set('page', $page);
     $page['Container'] = Hash::combine($page['Container'], '{n}.type', '{n}');
     $page['Box'] = Hash::combine($page['Box'], '{n}.id', '{n}', '{n}.container_id');
     $page['Container'] = array(Container::TYPE_MAIN => $page['Container'][Container::TYPE_MAIN]);
     $this->set('pageMainContainer', $page);
 }
開發者ID:Onasusweb,項目名稱:Pages,代碼行數:26,代碼來源:PagesController.php

示例4: hasContainer

 /**
  * The layout have container
  *
  * @param string $containerType Container type.
  *    e.g.) Container::TYPE_HEADER or TYPE_MAJOR or TYPE_MAIN or TYPE_MINOR or TYPE_FOOTER
  * @return bool The layout have container
  */
 public function hasContainer($containerType)
 {
     if (!($result = isset($this->__containers[$containerType]) && $this->__containers[$containerType]['ContainersPage']['is_published'])) {
         return false;
     }
     if (!Current::isSettingMode()) {
         $box = $this->getBox($containerType);
         $frames = Hash::combine($box, '{n}.Frame.{n}.id', '{n}.Frame.{n}');
         $result = count($frames);
     }
     return $result;
 }
開發者ID:Onasusweb,項目名稱:Pages,代碼行數:19,代碼來源:PageLayoutHelper.php

示例5: array

<?php

/**
 * Registrations routes configuration
 *
 * @author Noriko Arai <arai@nii.ac.jp>
 * @author Shohei Nakajima <nakajimashouhei@gmail.com>
 * @link http://www.netcommons.org NetCommons Project
 * @license http://www.netcommons.org/license.txt NetCommons License
 * @copyright Copyright 2014, NetCommons Project
 */
App::uses('Current', 'NetCommons.Utility');
$params = array('plugin' => 'registrations', 'controller' => 'registration_edit');
$options = array('block_id' => '[0-9]+', 'key' => '[a-zA-Z0-9_]+');
if (Current::isSettingMode()) {
    Router::connect('/' . Current::SETTING_MODE_WORD . '/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/:key/*', $params, $options);
    Router::connect('/' . Current::SETTING_MODE_WORD . '/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/*', $params, $options);
}
Router::connect('/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/:key/*', $params, $options);
Router::connect('/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/*', $params, $options);
開發者ID:NetCommons3,項目名稱:Registrations,代碼行數:20,代碼來源:routes.php

示例6: isSettingMode

 /**
  * Check setting mode
  *
  * @return bool
  */
 public static function isSettingMode()
 {
     return Current::isSettingMode();
 }
開發者ID:Onasusweb,項目名稱:Pages,代碼行數:9,代碼來源:Page.php


注:本文中的Current::isSettingMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。