예제 #1
0
function jsondispatch()
{
    $target = getvardata("target", "unknown", 99);
    switch ($target) {
        case "browser":
            $browserval = $_SESSION["browserval"];
            $browsername = $_SESSION["browsername"];
            $browsericon = $_SESSION["browsericon"];
            showcard($browserval, $browsername, $browsericon, "windowbox vbar selectable droppable", "onclick=\"browserchange();\"");
            break;
        case "theme":
            break;
        case "section":
            break;
    }
}
예제 #2
0
function sectionbox()
{
    $sectionlist = array();
    $shandle = $_SESSION["shandle"];
    $debug = $_SESSION["debug"];
    $activesection = getvardata("activesection", "default", 99);
    if ($debug == "true") {
        echo "<!-- activesection[{$activesection}]-->\n";
    }
    $sql = "select looking_for,theme,css_selector from activecss where conditional=\"sectionlist\" order by looking_for";
    if ($debug == "true") {
        echo "<!-- section sql[{$sql}] -->\n";
    }
    $sresult = mysqli_query($shandle, $sql) or die("Cannot talk to activecss: ");
    while ($sdata = mysqli_fetch_array($sresult)) {
        $thissection = $sdata["looking_for"];
        $thisname = $sdata["theme"];
        $thisicon = $sdata["css_selector"];
        $sectionlist[$thissection]["name"] = $thisname;
        $sectionlist[$thissection]["icon"] = $thisicon;
        $_SESSION["sectionlist"][$thissection]["name"] = $thisname;
        $_SESSION["sectionlist"][$thissection]["icon"] = $thisicon;
    }
    // now we have a list of known browsers
    if ($debug == "true") {
        echo "<!-- sections:";
        print_r($_SESSION["sectionlist"]);
        echo "-->\n";
    }
    $classlist = "windowbox hbar";
    echo "\t<div name='sectionbox' id='sectionbox' class='eboxdiv'>\n";
    showcard("new", "section", "New Section", "sections.gif", "{$classlist} selectable", "onclick=\"sectionchange('New Section');\"");
    foreach ($sectionlist as $thissection => $sectioninfo) {
        if ($debug == "true") {
            echo "<!-- testing [{$thissection}] vs [{$activesection}] -->\n";
        }
        $selected = $thissection == $activesection ? "isactive" : "inactive";
        $sectionname = $sectioninfo["name"];
        $sectionicon = $sectioninfo["icon"];
        showcard($thissection, "section", $sectionname, $sectionicon, "{$classlist} isection selectable draggable {$selected}", "");
    }
    echo "\t</div>\n";
}