Example #1
0
function copy_cssrule($idcss, $idcssfile)
{
    global $client;
    $id = 0;
    // get css-rule data for import
    $tmp_data = get_cssrule_data($idcss, 0);
    if (empty($tmp_data)) {
        return -1109;
    }
    // import failed, could not get css-rule data
    // check for duplicates
    $duplicate = is_duplicate_selektor($tmp_data['type'], $tmp_data['name'], $client, $idcssfile, 0);
    if (!empty($duplicate)) {
        return -1114;
    }
    // import failed, css-rule is existing
    $id = insert_cssrule($client, $tmp_data['type'], $tmp_data['name'], $tmp_data['description'], $tmp_data['styles'], $tmp_data['status'], $tmp_data['warning']);
    return empty($id) ? -1109 : $id;
    // return errno or id of copied rule
}
Example #2
0
//
// set presets
//
// to do: import css-files
$stiltyp = array($cms_lang["css_rule_type01"] => "", $cms_lang["css_rule_type02"] => ".", $cms_lang["css_rule_type03"] => "#");
$ruletype = $type;
$rulename = $name;
$ruledescription = $description;
$rulestyles = $styles;
$rulewarnings = '';
$rulecreated = '';
$rulelastmodified = '';
$ruleauthor = '';
// get data for editing
if ($idcss && !$errno) {
    $tmp_data = get_cssrule_data($idcss, 1);
    if ($tmp_data) {
        $ruletype = $tmp_data['type'];
        $rulestyles = $tmp_data['styles'];
        $ruledescription = $tmp_data['description'];
        $rulewarnings = $tmp_data['warning'];
        $idcss = $tmp_data['idcss'];
        if ($action != '10') {
            $rulename = $tmp_data['name'];
            $rulecreated = date($cfg_cms['FormatDate'] . ' ' . $cfg_cms['FormatTime'], $tmp_data['created']);
            $rulelastmodified = date($cfg_cms['FormatDate'] . ' ' . $cfg_cms['FormatTime'], $tmp_data['lastmodified']);
            $ruleauthor = $tmp_data['vorname'] . ' ' . $tmp_data['nachname'];
        } else {
            // handle duplicate css-stile
            $rulename = '';
            $idcss = '';