Esempio n. 1
0
         $nvc = $c->getVersionToModify();
         if ($_POST['reset_css']) {
             $nvc->resetAreaCustomStyle($area);
         } else {
             if ($_POST['cspID'] > 0 && $_POST['cspPresetAction'] == 'update_existing_preset') {
                 $csp = CustomStylePreset::getByID($_POST['cspID']);
                 $csr = $csp->getCustomStylePresetRuleObject();
                 // we update the csr in case anything has been changed
                 $csr->update($_POST['css_id'], $_POST['css_class_name'], $_POST['css_custom'], $_POST);
                 $nvc->setAreaCustomStyle($area, $csr);
             } 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->canWrite()) {
         Loader::model('custom_style');
         $nvc = $c->getVersionToModify();
         //Loader::model('layout');
         $originalLayoutID = intval($_REQUEST['originalLayoutID']);
         $layoutID = intval($_REQUEST['layoutID']);