Ejemplo n.º 1
0
                if ($skipLayoutSave) {
                    //see above
                } elseif ($cvalID) {
                    //get the cval of the record that corresponds to this version & area
                    $vals = array($nvc->getCollectionID(), $nvc->getVersionID(), $_GET['arHandle'], intval($_REQUEST['layoutID']));
                    $cvalID = intval($db->getOne('SELECT cvalID FROM CollectionVersionAreaLayouts WHERE cID=? AND cvID=? AND arHandle=? AND layoutID=? ', $vals));
                    if ($updateLayoutId) {
                        $nvc->updateAreaLayoutId($cvalID, $layout->layoutID);
                    }
                } else {
                    $nvc->addAreaLayout($area, $layout, $position);
                }
                if ($_POST['layoutPresetAction'] == 'create_new_preset') {
                    $newPresetName = strlen($_POST['layoutPresetNameAlt']) ? $_POST['layoutPresetNameAlt'] : $_POST['layoutPresetName'];
                    if (strlen(trim($newPresetName))) {
                        LayoutPreset::add(trim($newPresetName), $layout);
                    }
                }
                header('Location: ' . BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $_GET['cID'] . '&mode=edit' . $step);
                exit;
            }
            break;
    }
}
if ($_REQUEST['ctask'] && $valt->validate()) {
    switch ($_REQUEST['ctask']) {
        case 'delete':
            if ($cp->canDeleteCollection() && $c->getCollectionID != '1' && !$c->isMasterCollection()) {
                $children = $c->getNumChildren();
                if ($children == 0 || $cp->canAdminPage()) {
                    $c->markPendingAction('DELETE');
Ejemplo n.º 2
0
					//are we adding a new layout to an area, or updating an existing one? 
					$cvalID=intval($_REQUEST['cvalID']);
					if($skipLayoutSave){
						//see above
					}elseif( $cvalID ){
						//get the cval of the record that corresponds to this version & area 
						$vals = array( $nvc->getCollectionID(), $nvc->getVersionID(), $_GET['arHandle'], intval($originalLayoutID) );
						$cvalID = intval($db->getOne('SELECT cvalID FROM CollectionVersionAreaLayouts WHERE cID=? AND cvID=? AND arHandle=? AND layoutID=? ',$vals));	
						if($updateLayoutId) $nvc->updateAreaLayoutId( $cvalID, $layout->layoutID);  
					}else{  
						$nvc->addAreaLayout($area, $layout, $position);  
					} 					
					
					if ( $_POST['layoutPresetAction']=='create_new_preset' ) { 
						$newPresetName = (strlen($_POST['layoutPresetNameAlt']))?$_POST['layoutPresetNameAlt']:$_POST['layoutPresetName'];
						if(strlen(trim($newPresetName))) LayoutPreset::add(trim($newPresetName), $layout);
					}	

					header('Location: ' . BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $_GET['cID'] . '&mode=edit' . $step);
					exit;
				}				
				break;					
		}
	}
	
	if ($_REQUEST['ctask'] && $valt->validate()) {
		
		switch ($_REQUEST['ctask']) {
			case 'delete':
				if ($cp->canDeleteCollection() && $c->getCollectionID != '1' && (!$c->isMasterCollection())) {
					$children = $c->getNumChildren();