当前位置: 首页>>代码示例>>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;未经允许,请勿转载。