Beispiel #1
0
function makenew($qb, $restore = '')
{
    $qdu = ses('qdu');
    require 'styl.php';
    if (!auth(4)) {
        $_SESSION['auth'] = 4;
    }
    msq_copy("system", "default_css_1", 'design', $qb . '_design_1');
    msq_copy("system", "default_clr_1", 'design', $qb . '_clrset_1');
    msq_copy("system", "default_css_2", 'design', $qb . '_design_2');
    msq_copy("system", "default_clr_2", 'design', $qb . '_clrset_2');
    msq_copy("system", "default_mods", 'users', $qb . '_mods_1');
    msq_copy("system", "default_rstr", 'users', $qb . '_rstr');
    msq_copy("system", "default_apps", 'users', $qb . '_apps');
    if ($restore) {
        list($rstr, $config) = ndprms_defaults();
        update('qdu', 'rstr', $rstr, 'name', ses('qb'));
        update('qdu', 'config', $config, 'name', ses('qb'));
    }
    $clr = msql_read('system', 'default_clr_1', '');
    $css = 'css/' . $qb . '_design_1.css';
    build_css($css, css_default(1), $clr);
    $clr = msql_read('system', 'default_clr_2', '');
    $css = 'css/' . $qb . '_design_2.css';
    build_css($css, css_default(), $clr);
    update('qdu', 'menus', ses('dayx'), 'name', $qb);
    if (!is_dir('users/' . $qb)) {
        mkdir_r('users/' . $qb);
    }
    return $qb;
}
Beispiel #2
0
function backup_console()
{
    //(421)
    $base = 'msql/users/';
    $nod = $_SESSION['modsnod'];
    $f = $base . $nod . '_sav.php';
    $goto = '/?admin=console';
    if ($d = $_GET["newfrom_mods"]) {
        newmodfrom($d);
        select_mods($d);
    }
    if ($_GET["adopt_mods"]) {
        foreach ($_SESSION['prmb'] as $k => $v) {
            $vaue .= $v . '#';
        }
        update("qdu", "config", $vaue, "name", ses('qb'));
    }
    if ($_GET["backup_mods"]) {
        copy($base . $nod . '.php', $f);
    }
    if ($_GET["mk_default"]) {
        msq_copy('users', $nod, 'system', 'default_mods');
        msq_copy('users', $nod, 'users', 'public_mods_1');
        alert('system/default_mods;public_mods_1');
    }
    if ($_GET["restore_mods"]) {
        copy($f, $base . $nod . '.php');
        define_mods('');
        define_condition();
    }
    if ($_GET["refresh_mods"]) {
        define_mods('');
        define_condition();
    }
    if ($_GET["make_copy"]) {
        msq_copy('users', ses('qb') . '_mods_' . ses('prmb1'), 'users', $nod);
        define_mods('');
        define_condition();
    }
    if ($_GET["default_mods"]) {
        msq_copy('system', 'default_mods', 'users', $nod);
        define_mods('');
        define_condition();
    }
    $rt = array('backup' => 'save', 'restore' => 'left', 'refresh' => 'reload', 'copy' => 'copy', 'default' => 'file', 'mkdef' => 'export');
    foreach ($rt as $k => $v) {
        $rt[$k] = picto($v);
    }
    $ret = lkc('txtx" title="' . nms(94), $goto . '&backup_mods==', $rt['backup']);
    if (is_file($f)) {
        $ret .= lkc('txtx" title="' . nms(95), $goto . '&restore_mods==', $rt['restore']);
    }
    $ret .= lkc('txtx" title="' . nms(97), $goto . '&refresh_mods==', $rt['refresh']);
    if ($p1 = ses('prmb1')) {
        $ret .= lkc('txtx" title="' . nms(132) . ':' . $p1, $goto . '&make_copy==', $rt['copy']);
    }
    $ret .= lkc('txtx" title="' . nms(96), $goto . '&default_mods==', $rt['default']);
    if (auth(6)) {
        $ret .= lkc('txtx" title="' . nms(113), $goto . '&mk_default==', $rt['mkdef']) . ' ';
    }
    $ret .= hlpbt('console') . ' ';
    $ret .= msqlink('', ses('qb') . '_mods_' . prmb(1));
    $ret .= msqlink('system', 'admin_modules');
    return $ret . br();
}
Beispiel #3
0
function edit_css()
{
    $base = "msql/design/";
    $basy = "msql/system/";
    clrpckr_js();
    $qb = ses('qb');
    $lh = sesmk('csslang');
    $defsb["_menus_"] = array("div", "class", "element", "color", "bkg", "border", "free");
    $edit = $_GET["edit_css"] ? $_GET["edit_css"] : $_POST["edit_css"];
    if (!$_SESSION['desgn']) {
        $_SESSION['desgn'] = $_SESSION['prmd'];
    }
    $numb = $_GET["desgn"];
    //desgn
    if ($numb && $numb != "=") {
        $_SESSION['desgn'] = $numb;
        $_SESSION['clrset'] = $numb;
        $_SESSION['prmd'] = $numb;
        $_SESSION['clrs'][$numb] = msql_read('design', $qb . '_clrset_' . $_SESSION['clrset'], '');
        $defs = read_vars($base, $qb . '_design_' . $_SESSION['desgn'], $defsb);
    }
    $desgn = $_SESSION['desgn'];
    $prmd = $_SESSION['prmd'];
    $clrset = $_SESSION['clrset'] = $_SESSION['clrset'] ? $_SESSION['clrset'] : $prmd;
    $f_dsn = $qb . '_design_' . $desgn;
    $f_clr = $qb . '_clrset_' . $clrset;
    $basecss = 'css/' . $f_dsn . '.css';
    $basecss_temp = 'css/' . $qb . '_design_dev_' . $prmd . '.css';
    #load
    if (!$defs) {
        $defs = read_vars($base, $f_dsn, $defsb);
    }
    unset($defs['_menus_']);
    //good_nb
    unset($defs[0]);
    $defs = reorder_keys($defs);
    if (!is_file($basecss_temp)) {
        build_css($basecss_temp, $defs);
    }
    #sav
    if ($nd = $_GET["newdiv"]) {
        $defs = defs_addnew($defs, $_GET["from"], array($nd, '', '', '', '', '', ''));
        //p($defs);
        save_vars($base, $f_dsn, $defs);
        $edit = find_value($defs, array($nd));
    }
    if ($_GET["new_from"]) {
        $tbn = msq_find_last('design', $qb, 'design');
        save_vars($base, $qb . '_design_' . $tbn, $defs);
        msq_copy('design', $f_clr, 'design', $qb . '_clrset_' . $tbn);
        //msq_copy('design',$qb.'_blocks_'.$desgn,'design',$qb.'_blocks_'.$tbn);
        $_SESSION['clrs'][$tbn] = $_SESSION['clrs'][$_SESSION['desgn']];
        $_SESSION['desgn'] = $_SESSION['clrset'] = $tbn;
        $f_dsn = $qb . '_design_' . $tbn;
        $f_clr = $qb . '_clrset_' . $tbn;
        msql_modif('users', 'public_design', dsnam_arr(desname($qb, $desgn)), '', 'one', $tbn);
        build_css('css/' . $qb . '_design_dev_' . $tbn . '.css', $defs);
    }
    if ($_GET["make_public"]) {
        if ($_GET["inform"]) {
            $tbn = $desgn;
        } else {
            $tbn = msq_find_last('design', 'public', 'design');
        }
        save_vars($base, 'public_design_' . $tbn, $defs);
        msq_copy('design', $f_clr, 'design', 'public_clrset_' . $tbn);
        msql_modif('users', 'public_design', dsnam_arr(desname($qb, $desgn)), '', 'one', $desgn);
        build_css('css/public_design_' . $tbn . '.css', $defs);
        alert('created: public_design_' . $tbn);
    }
    if ($_GET["make_admin"]) {
        build_css('css/_admin.css', $defs);
        save_vars($basy, 'default_css_3', $defs);
        alert('modified: system/default_css_3, _admin.css');
    }
    if ($_GET["make_global"]) {
        build_css('css/_global.css', $defs);
        save_vars($basy, 'default_css_1', $defs);
        msq_copy('design', $f_clr, 'system', 'default_clr_1');
        alert('modified: system/default_css_1, _global.css');
    }
    if ($_GET["make_default"]) {
        build_css('css/_classic.css', $defs);
        save_vars($basy, 'default_css_2', $defs);
        msq_copy('design', $f_clr, 'system', 'default_clr_2');
        $defse = empty_design($defs, 'clr');
        build_css('css/_default.css', $defse);
        alert('modified: table system/default_css_2, _classic.css, _default.css (no colors)');
    }
    //clrset
    if ($_GET["clrset"]) {
        $_SESSION['clrset'] = $clrset = $_GET["clrset"];
        $f_clr = $qb . '_clrset_' . $clrset;
        $_SESSION['clrs'][$prmd] = msql_read('design', $f_clr, '');
        build_css($basecss_temp, $defs);
    }
    //import_clrset
    if ($_GET["import_clrset"]) {
        $_SESSION['clrs'][$prmd] = explode("_", $_GET["import_clrset"]);
        if ($_SESSION["auth"] >= 6) {
            save_clr($qb . '_' . $clrset);
        }
    }
    if ($_GET["add_clrset"]) {
        save_clr($qb . '_' . $_GET["clrset"]);
    }
    //reset
    if ($_GET["reset_clr"] or $_GET["add_design"]) {
        $_SESSION['clrs'][$prmd] = msql_read('system', "default_clr_2", '');
        save_clr($f_clr);
    }
    if ($_GET["reset_default"] or $_GET["add_design"]) {
        $defs = css_default();
        unset($defs['_menus_']);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    if ($_GET["reset_global"] or $_GET["add_design"]) {
        $defs = css_default(1);
        unset($defs['_menus_']);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    //public
    if ($pub = $_GET["public_clr"]) {
        $_SESSION['clrs'][$prmd] = msql_read('design', 'public_clrset_' . $pub, '');
        save_clr($f_clr);
    }
    if ($pub = $_GET["public_design"]) {
        $defs = msql_read('design', 'public_design_' . $pub, '');
        unset($defs['_menus_']);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    //null
    if ($_GET["empty_design"]) {
        $defs = empty_design($defs, 'css');
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    if ($pub = $_GET["null_clr"]) {
        $_SESSION['clrs'][$prmd] = array('', '', '', '', '', '', '', '');
        save_clr($f_clr);
    }
    if ($pub = $_GET["null_design"]) {
        $defs = css_default();
        $defs = empty_design($defs, 'css');
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    //append
    if ($_GET["append"]) {
        $defsc = css_default();
        unset($defsc['_menus_']);
        $defs = array_append($defs, $defsc);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    if ($_GET["append_global"]) {
        $defsc = css_default();
        unset($defsc['_menus_']);
        $defs = array_append($defs, $defsc);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    if ($_GET["inject_global"]) {
        $defsc = css_default();
        unset($defsc['_menus_']);
        $defs = append_design($defs, $defsc);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    if ($_GET["reset_this"]) {
        $ec = $_GET["edit_css"];
        $defsc = css_default();
        $ecb = find_value($defsc, $defs[$ec]);
        if ($ecb) {
            $defs[$ec] = $defsc[$ecb];
            save_vars($base, $f_dsn, $defs);
            build_css($basecss_temp, $defs);
        }
    }
    //restore_design
    if ($_GET["restore"] == "design") {
        $defs = read_vars($base, $f_dsn . '_sav', $defsb);
        unset($defs['_menus_']);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    //restore_clrset
    if ($_GET["restore"] == "clrset") {
        $r = read_vars($base, $f_clr . '_sav', '');
        foreach ($r as $k => $v) {
            $clrst[] = $v[0];
        }
        $_SESSION['clrs'][$prmd] = $clrst;
        save_clr($f_clr);
        build_css($basecss_temp, $defs);
    }
    //herits
    if ($_GET["herit_desgn"]) {
        list($qbb, $nbd) = explode('_', $_GET["herit_desgn"]);
        $defs = read_vars($base, $qbb . '_design_' . $nbd, $defsb);
        //$_SESSION['clrs'][$desgn]=msql_read("design",$qbb.'_clrset_'.$nbd,'');
        //save_clr($f_clr);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    if ($_GET["herit_clrset"]) {
        list($qbb, $nbd) = explode('_', $_GET["herit_clrset"]);
        $_SESSION['clrs'][$desgn] = msql_read("design", $qbb . '_clrset_' . $nbd, '');
        save_clr($f_clr);
        build_css($basecss_temp, $defs);
    }
    //ff
    if ($_GET['addff']) {
        $defs = defs_adder_ff($defs);
        save_vars($base, $f_dsn, $defs);
        build_css($basecss_temp, $defs);
    }
    //save//add
    if ($_POST["save"] or $_GET["save_img"] or $_GET["save"]) {
        $defs = save_defs($base, $f_dsn, $defs, $defsb["_menus_"]);
        build_css($basecss_temp, $defs);
        if ($_POST["saveblocks"] or $_GET["save"]) {
            build_css($basecss, $defs);
        }
    }
    if ($_GET["invert_clr"]) {
        $_SESSION['clrs'][$prmd] = invert_defsclr();
        save_clr($f_clr);
        build_css($basecss_temp, $defs);
    }
    //sav
    if ($_GET["erase"]) {
        $defs = save_css_j_del($defs, $_GET["erase"]);
        save_vars($base, $f_dsn, $defs);
    }
    if ($_GET["newfrom"]) {
        $defs = save_css_newfrom($defs, $_GET["newfrom"]);
        //if($newdiv=$_GET["newdiv"])$defs[$edit]=array($newdiv);
        save_vars($base, $f_dsn, $defs);
    }
    if ($_GET["atpos"]) {
        $n = count($defs);
        $defs = save_css_displace($defs, $_GET["atpos"], $_POST["pos"]);
        if (count($defs) == $n) {
            save_vars($base, $f_dsn, $defs);
        }
    }
    if ($_GET['sav']) {
        save_vars($base, $f_dsn . '_sav', $defs, 1);
        save_clr($f_clr);
    }
    //_sav
    if ($_GET["apply"]) {
        save_vars($base, $f_dsn, $defs);
        save_clr($f_clr);
        build_css($basecss, $defs);
        informe_config_design();
    }
    //informe_config_width($defs);
    //build_css
    if ($_GET["build_css"]) {
        build_css($basecss_temp, $defs);
    }
    #body
    $go = '/?admin=css';
    $ret .= lkc("txtcadr", $go, $f_dsn) . ' ';
    $ret .= msql_desnam($qb, $desgn, '') . "\n";
    $ret .= hlpbt('design') . ' ';
    $ret .= msqlink('design', $qb . '_design_' . $desgn) . ' ';
    $ret .= lkc('popsav', "/?admin=console&exit_design==", pictxt('logout', nms(112)));
    //$ret.=lj('popbt','page_deskbkg','desk').lj('popbt','popup_site___desktop_ok__autosize','site');
    //icon('exit')
    $ret .= br() . br();
    if (prmb(5)) {
        $ret .= picto(alert) . helps('prmb5') . br() . br();
    }
    //$ret.=btn_switch('desgn',$prmd,'/?admin=css','live_edit');
    $ret .= see_conds_b() . ' ';
    //$ret.=lkc('txtx','/?admin=css&apply==cr_mod==','create conditionnal design').' ';
    $ret .= hlpbt('designcond') . br() . br();
    $ret .= btn("txtsmall", "save:") . ' ';
    $ret .= lkc('txtx', $go . '&sav==', "backup") . ' ';
    if ($_SESSION['prmd'] != $_SESSION['desgn']) {
        $ret .= lkc('txtx', $go . '&apply==', 'test design ' . $desgn) . ' ';
    }
    $ret .= lkc('txtx', $go . '&apply=save', nms(66) . ' (mods:' . prmb(1) . ')') . ' ';
    $ret .= lkc("popsav", $go . '&save==', nms(57)) . ' ';
    //$ret.=lkc("txtx",$go.'&save_inverted==','black').' ';
    $ret .= br();
    $ret .= btn("txtsmall", nms(111)) . ' ';
    //select
    $ret .= lj("txtbox", 'popup_styls___select', 'design:' . $desgn . '/clrset:' . $clrset) . ' ';
    $ret .= lj('txtx', 'popup_styls___herit', $lh[3]) . ' | ';
    //herit
    $ret .= lkc('txtx', $go . '&build_css==', nms(93)) . ' | ';
    //rebuild
    //$ret.=lkc('txtx',$go.'&build_css==&cmpq==',"cmpq").' ';
    $ret .= lj('txtx', 'popup_stylsff___1', '@font-face') . br();
    $ret .= btn("txtsmall", nms(113)) . ' ';
    //make
    $ret .= lkc('txtx', $go . '&new_from==', nms(44)) . ' ';
    $ret .= lkc('txtx', $go . '&empty_design==', nms(46)) . ' ';
    $ret .= lkc('txtx', $go . '&invert_clr==', nms(115)) . ' ';
    $ret .= lkc('txtx', $go . '&make_public==', $lh[4]) . ' ';
    //make_public
    $ret .= lkc('txtx', $go . '&make_public==&inform==', $lh[5]) . ' ';
    //inform_public
    if ($_SESSION['auth'] > 5) {
        $r = msql_read('users', $qb . '_design', $desgn);
        $desgname = $r[0] ? $r[0] : $r['name'];
        if ($desgname == 'admin') {
            $make = 'make_admin';
        } elseif ($desgname == 'global') {
            $make = 'make_global';
        } else {
            $make = 'make_default';
        }
        $ret .= lkc('txtbox', $go . '&' . $make . '==', $make);
    }
    $ret .= br();
    $ret .= btn("txtsmall", nms(95)) . ' ';
    //restore
    if (is_file($base . $f_dsn . '_sav.php')) {
        $ret .= lkc('txtx', $go . '&restore=design', 'design') . ' ';
    }
    //restore
    $ret .= lkc('txtx', $go . '&restore=clrset', 'clr') . ' | ';
    $ret .= lkc('txtx', $go . '&reset_default==', nms(96)) . ' ';
    //defaults
    $ret .= lkc('txtx', $go . '&reset_clr==', "clr") . ' | ';
    $ret .= lkc('txtx', $go . '&reset_global=1', "global") . ' ';
    $ret .= lkc('txtx', $go . '&public_clr=1', "clr") . ' | ';
    $ret .= lkc('txtx', $go . '&public_design=2', "public") . ' ';
    //public
    $ret .= lkc('txtx', $go . '&public_clr=2', "clr") . ' | ';
    $ret .= lkc('txtx', $go . '&null_design==', "null") . ' ';
    $ret .= lkc('txtx', $go . '&null_clr==', "clr") . br();
    $ret .= btn("txtsmall", nms(92)) . ' ';
    //append
    $ret .= lkc('txtx', $go . '&append==', nms(96)) . ' ';
    //default
    $ret .= lkc('txtx', $go . '&append_global==', "global") . ' ';
    $ret .= lkc('txtx', $go . '&inject_global==', $lh[9]) . br();
    //inject_globals
    $ret .= btn("txtsmall", nms(45)) . ' ';
    //see
    $ret .= lkt('txtx', $basecss, $lh[10]) . ' ';
    $ret .= lkt('txtx', $basecss_temp, $lh[11]) . ' ';
    //$ret.=lkt('txtx',$f_clr,"clr").' ';
    $ret .= lj('txtx', 'popup_styls___clr', "clrset") . ' ';
    $ret .= btn('txtx', count($defs) . ' ' . nms(117)) . ' ';
    $ret .= btn('txtx', mkday(filemtime($base . $f_dsn . '.php'))) . ' ';
    $ret .= br() . br();
    $ret .= f_inp_clr_manage_j() . br();
    //colors
    //plugin('csswidth'); $ret.=f_inp_widths($defs);//widths
    if ($defs) {
        $ret .= f_inp_plugs($defs, $defsb["_menus_"], $edit, 1) . br() . br();
    }
    //edit_css
    return $ret;
}
Beispiel #4
0
function repair_mods($nod)
{
    $r = read_vars('msql/users/', $nod . '_sav', '');
    if ($r) {
        $r = msq_copy('users', $nod . '_sav', 'users', $nod);
        if (auth(2)) {
            alert('backup mods restored');
        }
    }
    if (!$r) {
        $r = read_vars('msql/system/', 'default_mods', '');
        if ($r) {
            $r = msq_copy('system', 'default_mods', 'users', $nod);
        }
        if (auth(4)) {
            alert('using minimal config ' . lkc('txtx', '/admin/hubs&reinit==', 'reinit?'));
        }
    }
    return $r;
}
Beispiel #5
0
function dl_php_file($f)
{
    //msql/design/test_design_3.php
    list($dr, $db, $nd) = split("[/.]", $f);
    echo $dr;
    $nb = str_replace($_SESSION['target_hub'], $_SESSION['qb'], $nd);
    if (!is_file('../' . $f)) {
        $d = read_file('http://philum.net/plug/_migration.php?php=' . $f);
        $d = '<' . '?php' . $d . '?' . '>';
        write_file('../' . $f, $d);
        echo 'ok: ../msql/' . $db . '/' . $nb . br();
        msq_copy($db, $nd, $db, $nb);
    } else {
        echo 'already_exists: ' . $f . br();
    }
}
Beispiel #6
0
function newmodfrom($d)
{
    $nd = $_SESSION['qb'] . '_mods_';
    $_SESSION['modsnod'] = $nd . $d;
    if ($d != prmb(1) && !is_file('msql/users/' . $nd . $d . '.php')) {
        msq_copy('users', $nd . prmb(1), 'users', $nd . $d);
        echo btn('txtyl', '_mods_' . $d . ' created from _mods_' . prmb(1));
    }
}