Example #1
0
function printOpFormIntro($opname, $extra = array(), $upload = FALSE)
{
    global $pageno, $tabno, $page;
    echo "<form method=post id={$opname} name={$opname} action='?module=redirect&page={$pageno}&tab={$tabno}&op={$opname}'";
    if ($upload) {
        echo " enctype='multipart/form-data'";
    }
    echo ">";
    fillBypassValues($pageno, $extra);
    foreach ($extra as $inputname => $inputvalue) {
        printf('<input type=hidden name="%s" value="%s">', htmlspecialchars($inputname, ENT_QUOTES), htmlspecialchars($inputvalue, ENT_QUOTES));
    }
}
Example #2
0
function showTabs($pageno, $tabno)
{
    global $tab, $page, $trigger;
    if (!isset($tab[$pageno]['default'])) {
        return;
    }
    echo "<div class=greynavbar><ul id=foldertab style='margin-bottom: 0px; padding-top: 10px;'>";
    foreach ($tab[$pageno] as $tabidx => $tabtitle) {
        // Hide forbidden tabs.
        if (!permitted($pageno, $tabidx)) {
            continue;
        }
        // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
        if (!isset($trigger[$pageno][$tabidx])) {
            $tabclass = 'std';
        } elseif (!strlen($tabclass = call_user_func($trigger[$pageno][$tabidx]))) {
            continue;
        }
        if ($tabidx == $tabno) {
            $tabclass = 'current';
        }
        // override any class for an active selection
        echo "<li><a class={$tabclass}";
        echo " href='index.php?page={$pageno}&tab={$tabidx}";
        $args = array();
        fillBypassValues($pageno, $args);
        foreach ($args as $param_name => $param_value) {
            echo "&" . urlencode($param_name) . '=' . urlencode($param_value);
        }
        echo "'>{$tabtitle}</a></li>\n";
    }
    echo "</ul></div>";
}