コード例 #1
0
ファイル: adminx.php プロジェクト: philum/cms
function bar_add_mod($vl)
{
    $r = msql_read('system', "admin_modules", '', 1);
    if ($r) {
        foreach ($r as $k => $v) {
            $defs[$v[0]][$k] = $v[1];
        }
    }
    $re = prep_cond_mods($vl);
    list($defb, $defc, $defd) = whose_mods($re, $vl, $defs);
    $def = array_merge($defc, $defd);
    $ret .= btn("txtsmall", 'module:');
    ksort($def);
    //$ret.=menuder_form_kv($def,'bar" id="modbar',"","kk").' ';//defc
    $ret .= select(atn('bar') . atd('modbar'), $def, 'kk');
    $ret .= btn("txtsmall", 'condition:');
    $here = $_SESSION['cond'][0];
    //$ret.=menuder_form_kv(array('-','home','cat','art'),'pos" id="modcond',$here,"vv").' ';
    $ret .= select(atn('pos'), array('-', 'home', 'cat', 'art'), 'vv', $here);
    $ret .= btn("txtsmall", 'position:');
    if (!is_array($re)) {
        $re = array("-" => "-");
    }
    end($re);
    $here = current($re);
    //select last
    //$ret.=menuder_form_kv($re,'pos" id="modpos',$here,"vk").' ';
    $ret .= select(atn('pos') . atd('modpos'), array_flip($re), 'kv', $here) . ' ';
    //
    $ret .= ljb('popsav', 'SaveR', 'modules_' . $vl . '__add\',\'modpos|modbar|modcond', nms(92)) . br();
    $ret .= '</form>' . br();
    $ret .= divc('imgr', hlpbt('modules'));
    $hlp = msql_read("lang", "admin_modules", "");
    //help
    foreach ($def as $k => $v) {
        $cat = $r[$k][0];
        if (!$cat) {
            $cat = 'user';
        }
        if (!$_SESSION['line'][$k]) {
            $df[$cat][] = ljb('popbt', 'SaveR', 'modules_' . $vl . '_' . ajx($k) . '_add\',\'modpos', $k) . ' ' . btn('txtsmall2', $hlp[$k][0]);
        }
    }
    $ret .= make_tabs($df);
    return $ret;
}
コード例 #2
0
ファイル: styl.php プロジェクト: philum/cms
function facil_pos($defs, $k)
{
    $u = '/?admin=css&';
    //$ret.=lkc("txtnoir",$u.'edit_css='.$k.'&append_this==#'.$k,'append_this').' ';
    $ret .= lkc('txtyl', $u . 'erase=' . $k . '#' . ($k - 1), 'delete') . ' ';
    $ret .= lkc('txtbox', $u . 'newfrom=' . $k . '&edit_css=' . ($k + 1) . '#' . ($k + 1), nms(44)) . ' ';
    foreach ($defs as $ka => $v) {
        $rb[$ka] = name_classe($v);
    }
    //$t.=btn('txtx','position:').menuder_form_kv($rb,'pos',$k,"kv");
    $t .= btn('txtx', 'position:') . select(atn('pos'), $rb, 'kv', $k);
    $t .= input2('submit', 'save', "ok");
    $ret .= form($u . '&atpos=' . $k, $t);
    return $ret;
}
コード例 #3
0
ファイル: art.php プロジェクト: philum/cms
function art_read_mecanics($id, $r, $msg, $n, $prw, $tp)
{
    if (!$id) {
        return;
    }
    $n = $_SESSION['nl'] ? $_SESSION['nl'] : $n;
    //no_edit
    $rear = nb_ib_arts($id) + 1;
    $otp = read_idy($id, 'DESC');
    $r['opts'] = $_SESSION['opts'] ? $_SESSION['opts'] : art_opts($id);
    $panout['id'] = $id;
    $panout['suj'] = $r['suj'];
    //$prw=slct_media($prw);
    if ($r['re'] == 0) {
        $panout['css'] = "hide";
    } else {
        $panout['css'] = "";
    }
    //if($_GET['module']=="agenda")$panout['suj']=strftime("%A %d %B %Y",$r['day']).' :: ';
    $panout += prepare_tits($id, $r, $rear, $otp, $n, $prw);
    //count($otp)
    if ($prw < 3) {
        $panout['thumb'] = prepare_thumb($r['img']);
    }
    if (good_rech() && $n) {
        $panout += prepare_msg_rech($id, $msg, $r, $n);
    } elseif ($msg) {
        $panout += prepare_msg($id, $msg, $r, $prw);
        //corps && $prw!=1
        if (!$_SESSION['nl']) {
            $trk = prepare_tracks($id, $otp);
        }
    }
    return balb('section', atd($id) . atn($id), template($panout, $tp)) . $trk;
}
コード例 #4
0
ファイル: art.php プロジェクト: philum/cms
function art_read_mecanics($id, $r, $msg, $n, $prw, $tp)
{
    if (!$id) {
        return;
    }
    $n = $_SESSION['nl'] ? $_SESSION['nl'] : $n;
    //no_edit
    $rear = nb_ib_arts($id) + 1;
    $otp = read_idy($id, 'ASC');
    $r['opts'] = $_SESSION['opts'] ? $_SESSION['opts'] : art_opts($id);
    //p($r['opts']);
    $panout['id'] = $id;
    $panout['suj'] = $r['suj'];
    //$prw=slct_media($prw);
    if ($r['re'] == 0) {
        $panout['css'] = "hide";
    } else {
        $panout['css'] = '';
    }
    if ($prw == 1 or $prw == 2) {
        $panout['thumb'] = prepare_thumb($r['img'], $id);
    }
    if ($prw == 'rch') {
        $panout += prepare_msg_rech($id, $msg, $r);
    } elseif ($msg) {
        $panout += prepare_msg($id, $msg, $r, $prw);
        //corps && $prw!=1
        if (!$_SESSION['nl']) {
            $trk = prepare_tracks($id, $otp);
        }
    }
    $panout += prepare_tits($id, $r, $rear, $otp, $panout['count'], $prw);
    //count($otp)
    return balb('section', atd($id) . atn($id), template($panout, $tp)) . $trk . "\n";
}
コード例 #5
0
ファイル: admin.php プロジェクト: philum/cms
function adm_members_a($auth, $goto)
{
    //newuser save
    $arr = affect_auth($auth);
    $mmbrs = $_SESSION['qbin']['membrs'];
    $qdu = ses('qdu');
    $qb = ses('qb');
    $USE = ses('USE');
    if ($_POST['newuser'] && $_POST['newuser'] != 'newuser') {
        $usrd = adduser($qb, $_POST['newuser'], $_POST['pass'], $_POST['mail']);
        $tosave = rse('mbrs', $qdu . ' WHERE name="' . $qb . '"');
        $tosave .= $_POST['adlv'] . '::' . $_POST['newuser'] . ',';
        $_SESSION['qbin']['membrs'] = tab_members($tosave);
        update('qdu', 'mbrs', $tosave, 'name', $qb);
        relod($goto);
    } elseif ($_POST['Submit']) {
        //modifuser
        foreach ($mmbrs as $k => $v) {
            if ($_POST['del$k'] != $k) {
                if ($_POST[$k]) {
                    $tosave .= $_POST[$k] . '::' . $k . ',';
                } else {
                    $tosave .= $v . '::' . $k . ',';
                }
            }
        }
        if ($_POST['addu']) {
            $tosave .= $_POST['adlv'] . '::' . $_POST['addu'] . ',';
        }
        update('qdu', 'mbrs', $tosave, 'name', $qb);
        //mbrs
        $_SESSION['qbin']['membrs'] = tab_members($tosave);
        relod($goto);
    }
    if ($mmbrs) {
        //readusers
        foreach ($mmbrs as $k => $v) {
            if ($k != $USE && $v <= $auth) {
                //$v=authlevel(nb)
                //$rc[$k]=menuder_form_kv($arr,$k,$v,'kv');
                $rc[$k] = select(atn($k), $arr, 'kv', $v);
                $rc[$k] .= ' ' . checkbox('del' . $k, $k, 'delete', '') . br();
            } elseif ($k == $USE) {
                $rc[$k] = btn('txtx', $k . ' :: auth_level: ' . $v) . br();
            }
        }
        if ($rc) {
            $inp = on2cols($rc, 470, 5);
        }
        if ($rc) {
            $inp .= br() . input2('submit', 'Submit', 'Apply', '');
            $ret .= form($goto, $inp) . br();
        }
    }
    if ($auth > 4) {
        $ret .= lkc('txtbox', '/?admin=members&adduser==', 'add_user') . br() . br();
    }
    if ($_GET['adduser'] == '=') {
        //show_list
        $uss = sql('name', 'qdu', 'k', '');
        $mmbrs[$qb] = $auth;
        $usrs = array_combine_sub($uss, $mmbrs);
        if ($usrs) {
            //$inp=menuder_form_kv($usrs,'addu',$v,'kk').menuder_form_kv($arr,'adlv',$v,'kv');
            $inp = select(atn('addu'), $usrs, 'kk', $v) . select(atn('adlv'), $arr, 'kv', $v);
            $inp .= input2('submit', 'Submit', 'Apply', '');
            $ret .= form($goto, $inp);
        }
        if ($auth > 4) {
            $cls = '" size="10" maxlength="50';
            //adduser
            $inp = input2('text', 'newuser', 'newuser' . $cls, '') . ' ';
            $inp .= input2('text', 'pass', 'password' . $cls, '') . ' ';
            $inp .= input2('text', 'mail', 'mail' . $cls, '') . ' ';
            //$inp.=menuder_form_kv($arr,'adlv',$v,'kv').' ';
            $inp .= select(atn('adlv'), $arr, 'kv', $v);
            $valu = $inp . ' ' . input2('submit', 'Submit', 'add_user', '');
            $ret .= br() . form($goto . '&adduser==', $valu);
        }
    }
    return $ret;
}
コード例 #6
0
ファイル: lib.php プロジェクト: philum/cms
function radiobtn($r, $h, $n)
{
    if ($r) {
        foreach ($r as $k => $v) {
            $ck = $v == $h ? ' checked="checked"' : '';
            $id = randid();
            $ret .= '<input type="radio"' . atn($n) . atd($id) . atv($v) . $ck . '/> ' . label($id, 'small', '', $v) . ' ';
        }
    }
    return $ret;
}