function master_config($div, $va, $cond, $res) { req('boot'); $r = ajxr(substr($res, 1)); $r[4] = substr($r[4], 0, 1) != '-' ? $r[4] : ''; $r[5] = $r[5] != '-' ? $r[5] : ''; $r[9] = $r[9] != '-' ? $r[9] : ''; //4cond 5com 6opt 9tmpl if ($r[1] == 'blocks') { $r[2] = str_replace(array('page', 'popup'), 'bloc', $r[2]); } //forbidden_blocks $nod = $_SESSION['modsnod']; $_SESSION['cond'] = determine_cond($r[4]); if ($cond == "sav" or $cond == "savb") { $ret[$va] = $r; array_shift($r); $_SESSION['mods'][$div][$va] = $r; $ret = modif_vars('users', $nod, $ret, "mdf"); } elseif ($cond == "add") { $md = $r[1] ? $r[1] : $va; $pos = $r[0]; $cnd = $r[2] == '-' ? '' : $r[2]; $ret = array($div, $md, '', '', $cnd, '', '', '', '', ''); $cmd = define_modc_b($div); if ($cmd) { $keys = array_keys($cmd); $i = 0; foreach ($cmd as $k => $v) { $nv = $v; array_unshift($nv, $div); $nk = $keys[$i]; if ($nk == 0) { $nk = 'push'; } if ($k == $r[0]) { $nmd[$nk] = $nv; $i++; $nk = $keys[$i]; if ($nk == 0) { $nk = 'push'; } $nmd[$nk] = $ret; } else { $nmd[$nk] = $nv; } $i++; } } else { $nmd[] = $ret; } $r = modif_vars('users', $nod, $nmd, "mdf"); define_mods('', $r); define_modc(); define_prma(); } elseif ($cond == "new") { $nv = $r; $nv[0] = $div; $r = modif_vars('users', $nod, $nv, "push"); define_mods('', $r); define_modc(); define_prma(); } elseif ($cond == "del") { unset($_SESSION['mods'][$div][$va]); modif_vars('users', $nod, $va, "del"); define_modc(); define_prma(); } elseif ($cond) { $_SESSION['cond'] = determine_cond($cond); } if ($div == 'newsletter') { define_mods(''); } return console_block($div, $ret); }
function see_conds_b() { $go = '/?admin=' . $_GET['admin']; if ($cnd = $_GET['set_cond']) { $_SESSION['cond'] = determine_cond($cnd); define_modc(); define_prma(); if ($_GET['admin'] == 'css') { relod('/?admin=css&desgn=' . $_SESSION['prmd']); } } $r = $_SESSION['mods']['system']; $cnd = $_SESSION['cond']; $ra = array_flip(array('', 'home', 'cat', 'art')); if ($r) { foreach ($r as $k => $v) { $ra[$v[3]] += 1; } foreach ($ra as $k => $v) { if ($k) { $c = $k == $cnd[0] && !$cnd[1] ? 'active' : ''; $ret .= lkc($c, $go . '&set_cond=' . $k, $k); } } } if ($ret) { $all = lkc($cnd[0] == '' ? 'active' : '', $go . '&set_cond=all', nms(100)); return btn('nbp', $all . $ret) . hlpbt('console_cond') . ' '; } }
function define_condition() { if ($_SESSION['read']) { $cnd = array('art', $_SESSION['read']); } elseif ($_GET['context']) { $cnd = array($_GET['context']); } elseif ($_SESSION['frm'] == 'Home') { $cnd = array('home'); } elseif ($_SESSION['frm']) { $cnd = array('cat', $_SESSION['frm']); } else { $cnd = array('cat', ''); } $_SESSION['cond'] = $cnd; define_modc(); define_prma(); }
function master_config($block, $mod, $act, $res) { req('boot'); $r = ajxr($res); $cond = substr($r[4], 0, 1) != '-' ? $r[4] : ''; if ($act == 'add') { $cond = $r[2]; } $r[5] = $r[5] != '-' ? $r[5] : ''; $r[4] = $r[4] != '-' ? $r[4] : ''; $r[9] = $r[9] != '-' ? $r[9] : ''; //4cond,5com,6opt,9tmpl,10pop $nod = $_SESSION['modsnod']; if ($cond) { $_SESSION['cond'] = determine_cond($cond); } if ($act == 'sav' or $act == "savb") { $ret[$mod] = $r; array_shift($r); $_SESSION['mods'][$block][$mod] = $r; $ret = modif_vars('users', $nod, $ret, "mdf"); define_modc(); } elseif ($act == 'add') { $md = $mod ? $mod : $r[1]; $pos = $r[0]; $cnd = $r[2] == '-' ? '' : $r[2]; $ret = array($block, $md, '', '', $cnd, '', '', '', '', '', ''); $cmd = define_modc_b($block); if ($cmd) { $keys = array_keys($cmd); $i = 0; foreach ($cmd as $k => $v) { //existants $nv = $v; array_unshift($nv, $block); $nk = $keys[$i]; if ($nk == 0) { $nk = 'push'; } if ($k == $pos) { $nmd[$nk] = $nv; $i++; $nk = $keys[$i]; if ($nk == 0) { $nk = 'push'; } $nmd[$nk] = $ret; } else { $nmd[$nk] = $nv; } $i++; } } else { $nmd[] = $ret; } $r = modif_vars('users', $nod, $nmd, 'mdf'); define_mods('', $r); define_modc(); define_prma(); } elseif ($act == 'new') { $nv = $r; $nv[0] = $block; $r = modif_vars('users', $nod, $nv, 'push'); define_mods('', $r); define_modc(); define_prma(); } elseif ($act == 'del') { unset($_SESSION['mods'][$block][$mod]); modif_vars('users', $nod, $mod, 'del'); define_modc(); define_prma(); } elseif ($act) { $_SESSION['cond'] = determine_cond($act); } if ($block == 'newsletter') { define_mods(''); } return console_block($block, $ret); }