コード例 #1
0
ファイル: spe.php プロジェクト: philum/cms
function bubble_menus($t, $inl = '')
{
    //mods/submenus
    if (!$t) {
        return;
    }
    $nbo = 0;
    $n = "\n";
    $r = explode("\n", $t . $n);
    foreach ($r as $n => $k) {
        $nb = substr_count(substr($k, 0, 9), '-');
        $tit = substr($k, $nb);
        $tit = trim($tit);
        if ($tit) {
            list($lk, $d) = submn_t($tit);
            $cat[$nb] = $tit;
            $ct = '';
            $ct = $cat[0];
            for ($i = 2; $i <= $nb; $i++) {
                $ct .= '/' . $cat[$i - 1];
            }
            $isdir = substr($r[$n + 1], 0, 1) == '-' ? 1 : 0;
            if ($nb == 0 && $isdir) {
                $ret .= popbub('bubses', ajx($d), $d, 'd');
            } elseif ($nb == 0) {
                $ret .= li(lkc('', $lk, $d));
            } else {
                $ra[] = array($d, 'link', '', $lk, '', '', $ct, '');
            }
        }
    }
    $_SESSION['bubses'] = $ra;
    return mkbub($ret, $inl, 1, '');
}
コード例 #2
0
ファイル: spe.php プロジェクト: philum/cms
function bubble_menus($t, $inl = '')
{
    //mods/submenus
    if (!$t) {
        return;
    }
    $nbo = 0;
    $n = "\n";
    $r = explode("\n", $t . $n);
    //$id=randid();
    foreach ($r as $k) {
        $nb = substr_count($k, "-");
        $tit = substr($k, $nb);
        $tit = trim($tit);
        if ($tit) {
            list($lk, $d) = submn_t($tit);
            $cat[$nb] = $tit;
            $ct = '';
            $ct = $cat[0];
            for ($i = 2; $i <= $nb; $i++) {
                $ct .= '/' . $cat[$i - 1];
            }
            if ($nb == 0) {
                $ret .= popbub('bubses', ajx($d), $d, 'd');
            } else {
                $ra[] = array($d, 'link', '', $lk, '', '', $ct, '');
            }
        }
    }
    $_SESSION['bubses'] = $ra;
    return div(atc($inl) . atd('bub') . ats('position:relative; text-decoration:none;'), ul($ret));
}