本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
示例6: isSettingMode
/**
* Check setting mode
*
* @return bool
*/
public static function isSettingMode()
{
return Current::isSettingMode();
}