GetStylesheetOperations(); $db = $gCms->GetDb(); $dateformat = trim(get_preference(get_userid(),'date_format_string','%x %X')); if( empty($dateformat) ) { $dateformat = '%x %X'; } #****************************************************************************** # Definition of global vars #****************************************************************************** # this var is used to store any error that may occur $error = ""; #****************************************************************************** # we get the parameters #****************************************************************************** # the new name of the css $css_name = ""; if (isset($_POST["css_name"])) $css_name = $_POST["css_name"]; $from = ""; if (isset($_REQUEST["from"])) $from = $_REQUEST["from"]; $templateid = ""; if (isset($_REQUEST["templateid"])) $templateid = (int)$_REQUEST["templateid"]; # the old name of the css (if it has changed, we'll have to check that the new # one is not already used.& $orig_css_name = ""; if (isset($_POST["orig_css_name"])) $orig_css_name = $_POST["orig_css_name"]; # the content of the CSS $css_text = ""; if (isset($_POST["css_text"])) $css_text = $_POST["css_text"]; // Clean up name $css_name = htmlspecialchars($css_name, ENT_QUOTES); # the ID of the CSS $css_id = -1; if (isset($_POST["css_id"])) $css_id = $_POST["css_id"]; else if (isset($_GET["css_id"])) $css_id = $_GET["css_id"]; $media_type = array(); if (isset($_POST['media_type'])) $media_type = $_POST['media_type']; $media_query = ''; if (isset($_POST['media_query'])) $media_query = $_POST['media_query']; $ajax = false; if (isset($_POST['ajax']) && $_POST['ajax']) $ajax = true; # if the form has beeen cancelled, we redirect if (isset($_POST["cancel"])) { if ($from == 'templatecssassoc') redirect("listcssassoc.php".$urlext."&type=template&id=" . $templateid); else redirect("listcss.php".$urlext); return; } #****************************************************************************** # first, checking the user's permission #****************************************************************************** $userid = get_userid(); $access = check_permission($userid, 'Modify Stylesheets'); if ($access) { # the user has submitted the form if (isset($_POST["editcss"])) { $validinfo = true; # check if the name is valid if ("" == $css_name) { $error .= "
".lang('noaccessto', array(lang('editcss')))."