本文整理汇总了PHP中Permissions::canAddLayoutToArea方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canAddLayoutToArea方法的具体用法?PHP Permissions::canAddLayoutToArea怎么用?PHP Permissions::canAddLayoutToArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canAddLayoutToArea方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$json = Loader::helper('json');
$c = Page::getByID($_REQUEST['cID']);
$a = Area::get($c, $_GET['arHandle']);
if (!is_object($c) || !is_object($a)) {
$jsonData = array();
$jsonData['msg'] = t('Access Denied.');
echo $json->encode($jsonData);
exit;
}
$nvc = $c->getVersionToModify();
$cp = new Permissions($c);
$ap = new Permissions($a);
if (!$cp->canEditPageContents() || !$ap->canAddLayoutToArea()) {
$jsonData = array();
$jsonData['msg'] = t('Access Denied.');
echo $json->encode($jsonData);
exit;
}
$valt = Loader::helper('validation/token');
$token = '&' . $valt->getParameter();
if ($_GET['task'] == 'deletePreset') {
$layoutPreset = LayoutPreset::getByID($_REQUEST['lpID']);
if (is_object($layoutPreset)) {
$layout = $layoutPreset->getLayoutObject();
$layoutID = $layout->layoutID;
}
} else {
$layoutID = intval($_REQUEST['layoutID']);
示例2: Permissions
$stack = Stack::getByID($_REQUEST['stackID']);
$canViewPane = false;
if (is_object($stack)) {
$stp = new Permissions($stack);
$canViewPane = $stp->canRead() && $ap->canAddStacks();
}
break;
case 'paste':
$toolSection = "block_area_add_scrapbook";
$canViewPane = $ap->canAddBlocks();
break;
case 'layout':
$originalLayoutId = intval($_REQUEST['originalLayoutID']) ? intval($_REQUEST['originalLayoutID']) : intval($_REQUEST['layoutID']);
$args['refreshAction'] = REL_DIR_FILES_TOOLS_REQUIRED . '/edit_area_popup?atask=layout&cID=' . $c->getCollectionID() . '&arHandle=' . $a->getAreaHandle() . '&refresh=1&originalLayoutID=' . $originalLayoutId . '&cvalID=' . $_REQUEST['cvalID'] . '&areaNameNumber=' . intval($_REQUEST['areaNameNumber']);
$toolSection = "block_area_layout";
$canViewPane = $ap->canAddLayoutToArea();
$args['action'] = $a->getAreaUpdateAction('layout') . '&originalLayoutID=' . $originalLayoutId . '&cvalID=' . intval($_REQUEST['cvalID']) . '&areaNameNumber=' . intval($_REQUEST['areaNameNumber']);
break;
case 'design':
$toolSection = 'custom_style';
$args['style'] = $c->getAreaCustomStyleRule($a);
$args['action'] = $a->getAreaUpdateAction('design');
$args['refreshAction'] = REL_DIR_FILES_TOOLS_REQUIRED . '/edit_area_popup?atask=design&cID=' . $c->getCollectionID() . '&arHandle=' . $a->getAreaHandle() . '&refresh=1';
$canViewPane = $ap->canEditAreaDesign();
if ($canViewPane) {
if ($_REQUEST['subtask'] == 'delete_custom_style_preset') {
$styleToDelete = CustomStylePreset::getByID($_REQUEST['deleteCspID']);
$styleToDelete->delete();
}
}
break;
示例3: t
echo $a->getAreaID();
?>
"><span><i class="fa fa-share-alt"></i> <?php
echo $a->getAreaDisplayName();
?>
</span></div>
<div class="popover fade" data-area-menu="area-menu-a<?php
echo $a->getAreaID();
?>
">
<div class="arrow"></div>
<div class="popover-inner">
<ul class="dropdown-menu">
<?php
$showAreaDesign = $ap->canEditAreaDesign() && Config::get('concrete.design.enable_custom') == true;
$showAreaLayouts = $ap->canAddLayoutToArea() && Config::get('concrete.design.enable_layouts') == true && !$a->isGlobalArea();
$canEditAreaPermissions = $ap->canEditAreaPermissions() && Config::get('concrete.permissions.model') != 'simple' && !$a->isGlobalArea();
$showAddBlock = (bool) $ap->canAddBlocks();
if ($showAddBlock) {
?>
<li><a href='#' data-menu-action="area-add-block"><?php
echo t('Add Block');
?>
</a></li><?php
}
if ($showAreaDesign || $showAreaLayouts) {
if ($showAreaDesign) {
?>
<li><a data-menu-action="edit-area-design" href="#"><?php
echo t("Edit Area Design");
?>
示例4: header
} else {
$csr = CustomStyleRule::add($_POST['css_id'], $_POST['css_class_name'], $_POST['css_custom'], $_POST);
$nvc->setAreaCustomStyle($area, $csr);
}
if ($_POST['cspPresetAction'] == 'create_new_preset') {
CustomStylePreset::add($_POST['cspName'], $csr);
}
}
header('Location: ' . BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $_GET['cID'] . '&mode=edit' . $step);
exit;
}
break;
case 'layout':
$area = Area::get($c, $_GET['arHandle']);
$ap = new Permissions($area);
if ($ap->canAddLayoutToArea()) {
Loader::model('custom_style');
$nvc = $c->getVersionToModify();
//Loader::model('layout');
$originalLayoutID = intval($_REQUEST['originalLayoutID']);
$layoutID = intval($_REQUEST['layoutID']);
$params = array('type' => 'table', 'rows' => intval($_REQUEST['layout_rows']), 'columns' => intval($_REQUEST['layout_columns']), 'locked' => intval($_REQUEST['locked']), 'spacing' => intval($_REQUEST['spacing']), 'layoutID' => $layoutID);
//Save Existing layout preset
$lpID = intval($_REQUEST['lpID']);
if ($lpID && $_POST['layoutPresetAction'] == 'update_existing_preset') {
$layoutPreset = LayoutPreset::getByID($lpID);
if ($layoutPreset) {
$layout = $layoutPreset->getLayoutObject();
}
if (!$layout || !intval($layout->layoutID)) {
throw new Exception(t('Layout preset not found'));