Example #1
0
File: spe.php Project: philum/cms
function m_apps($r, $cnd, $dir, $p = '', $o = '')
{
    if ($p) {
        $p = ajx($p);
    }
    $dr = explode('/', $dir);
    $nd = $dir ? count($dr) : 0;
    if ($r) {
        foreach ($r as $k => $v) {
            if (strpos($v[5], $cnd) !== false && $cnd == 'boot' && !$v[8]) {
                $ret[] = read_apps($v);
            } elseif (strpos($v[5], $cnd) !== false or !$v[5]) {
                $t = $v[0];
                if ($v[1] == 'art') {
                    if ($v[2] == 'auto') {
                        $t = suj_of_id($v[3]);
                    } else {
                        $t = $v[2];
                    }
                    if ($t) {
                        $v[7] = apps_arts_thumb($v[3], $v[7]);
                    }
                } elseif ($v[1] == 'file' && is_image($v[3])) {
                    $v[7] = make_thumb_c($v[3], '38/38', 1);
                } elseif ($v[1] == 'img') {
                    $v[7] = make_thumb_c('users/' . $v[3], '38/38', 1);
                }
                //
                $_SESSION['apico'][$t] = $v[7];
                $rv = explode('/', $v[6]);
                $nv = $v[6] ? count($rv) : 0;
                if ($dir == $v[6]) {
                    $is = true;
                } else {
                    $is = match_vdir($dr, $nd, $rv);
                }
                if ($is && $nv == $nd + 1 && !$v[8] && auth($v[9])) {
                    //dirs
                    $ret[$rv[$nv - 1]] = 'popup_desktop__2_' . $cnd . '_' . ajx($v[6]) . '_' . $p . '_' . $o;
                } elseif ($is && $rv[$nd] && !$v[8]) {
                    $v6 = implode('/', array_slice($rv, 0, $nd + 1));
                    $ret[$rv[$nd]] = 'popup_desktop__2_' . $cnd . '_' . ajx($v6) . '_' . $p . '_' . $o;
                }
                if ($is && $nv > $nd) {
                    $is = false;
                }
                if ($is && !$v[8] && (!$v[9] or auth($v[9]))) {
                    $j = read_apps($v);
                    //if($v[1]=='link')$ret[$t]=array('link',$v[3]);
                    if ($j) {
                        $ret[$t] = $j;
                    }
                }
            }
        }
    }
    return $ret;
}
Example #2
0
File: bubs.php Project: philum/cms
function bub_apps($r, $d, $dir, $cond)
{
    //$r,,dir,cond//p($r); echo 'oo';
    $dr = explode('/', $dir);
    $nd = $dir ? count($dr) : 0;
    if ($r) {
        foreach ($r as $k => $v) {
            $rc = array_flip(explode(' ', ' ' . $v[5]));
            if ($rc[$cond ? $cond : 'menu'] or !$v[5]) {
                $rv = explode('/', $v[6]);
                $nv = $v[6] ? count($rv) : 0;
                $t = $v[0];
                $ico = $v[7] ? picto($v[7]) . ' ' : '';
                $rvb = $rv[$nv - 1];
                if ($dir == $v[6]) {
                    $is = true;
                } else {
                    $is = match_vdir($dr, $nd, $rv);
                }
                if ($is && $nv == $nd + 1 && !$v[8] && auth($v[9])) {
                    //dirs
                    $rb[$rvb] = popbub($v[4] ? $v[4] : $d, $v[6], picto('kright') . ' ' . $rvb, $dd, 1);
                }
                if ($is && $nv > $nd) {
                    $is = false;
                }
                if ($is && !$v[8] && (!$v[9] or auth($v[9]))) {
                    //noj
                    if ($v[1] == 'link') {
                        $rb[$t] = ljbub($ico . $t, $v[3], '', '', '', '');
                    } elseif ($v[1] == 'linkt') {
                        $rb[$t] = ljbub($ico . $t, $v[3], '', '', '', '1');
                    } elseif ($v[1] == 'js') {
                        $rb[$t] = ljbub($ico . $t, '', atj($v[2], $v[3]));
                    } elseif ($v[1] == 'bub') {
                        $rb[$t] = popbub($v[2], $v[3], $ico . $t, 'c', 1);
                    } else {
                        $j = read_apps($v);
                        $rb[$t] = ljbub($ico . $t, '', sj($j));
                    }
                }
            }
        }
    }
    if ($rb) {
        $ret = implode('', $rb);
    }
    //if($d=='arts')//$ret=desktop_build_ico($rb,'icones');
    $ret = scroll($rb, $ret, 19);
    return $ret;
}
Example #3
0
File: bubs.php Project: philum/cms
function bub_apps($r, $d, $dir, $cond)
{
    //$r,,dir,cond
    if ($dir == 'zero') {
        $dir = '';
        $dd = 'd';
    }
    $dr = explode('/', $dir);
    $nd = $dir ? count($dr) : 0;
    if ($r) {
        foreach ($r as $k => $v) {
            $rc = array_flip(explode(' ', ' ' . $v[5]));
            if ($rc[$cond ? $cond : 'menu'] or !$v[5]) {
                $t = $v[0];
                $rv = explode('/', $v[6]);
                $nv = $v[6] ? count($rv) : 0;
                $ico = $v[7] ? picto($v[7], 'min-width:20px;') . ' ' : '';
                $rvb = $rv[$nv - 1];
                if ($dir == $v[6]) {
                    $is = true;
                } else {
                    $is = match_vdir($dr, $nd, $rv);
                }
                if ($is && $nv >= $nd + 1 && !$v[8] && auth($v[9])) {
                    $root = $v[6];
                    //dirs
                    if ($nv >= $nd + 1) {
                        $rvb = $rv[$nd];
                        $rot = '';
                        for ($i = 0; $i <= $nd; $i++) {
                            $rot[] = $rv[$nd - $i];
                        }
                        $rot = array_reverse($rot);
                        if ($rot) {
                            $root = implode('/', $rot);
                        }
                    }
                    $pc = picto('kright', '20px') . '&nbsp;' . $rvb;
                    if ($dd) {
                        $pc = $rvb;
                    }
                    $rb[$rvb] = popbub($v[4] ? $v[4] : $d, ajx($root), $pc, $dd, 1);
                }
                if ($is && $nv > $nd) {
                    $is = false;
                }
                if ($is && !$v[8] && (!$v[9] or auth($v[9]))) {
                    //noj
                    if ($v[1] == 'link') {
                        $rb[$t] = ljbub($ico . $t, $v[3], '', '', '', '');
                    } elseif ($v[1] == 'linkt') {
                        $rb[$t] = ljbub($ico . $t, $v[3], '', '', '', '1');
                    } elseif ($v[1] == 'js') {
                        $rb[$t] = ljbub($ico . $t, '', atj($v[2], $v[3]));
                    } elseif ($v[1] == 'bub') {
                        $rb[$t] = popbub($v[2], $v[3], $ico . $t, 'c', 1);
                    } elseif ($v[1] == 'module') {
                        req('mod');
                        $rb[$t] = build_mod_r($v[2]);
                    } else {
                        $j = read_apps($v);
                        $rb[$t] = ljbub($ico . $t, '', sj($j));
                    }
                }
            }
        }
    }
    if ($rb) {
        $ret = implode('', $rb);
    }
    //if($d=='arts')//$ret=desktop_build_ico($rb,'icones');
    //$ret=scroll($rb,$ret,19);
    return $ret;
}
Example #4
0
File: mod.php Project: philum/cms
function read_apps_link($d, $vr = '', $c = '')
{
    list($p, $o) = explode('ยง', $d);
    if (is_numeric($p)) {
        if ($vr) {
            $r = msql_read('system', 'default_apps' . ($vr == 'system' ? '' : '_' . $vr), $p);
        } else {
            $r = msql_read('', $_SESSION['qb'] . '_apps', $p);
        }
        $r = array($r['button'], $r['type'], $r['process'], $r['param'], $r['option'], '', '', $r['icon'], '', $r['private']);
    } else {
        $r = explode(';', $p);
    }
    $t = $r[7] ? picto($r[7]) : $r[0];
    return lj($c, read_apps($r), $o ? $o : $t);
}