Пример #1
0
<?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
0
     $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
0
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");
        ?>
             } 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'));