case 'edit':
     edit($id, $option);
     break;
 case 'editA':
     edit(intval($cid[0]), $option);
     break;
 case 'go2menu':
 case 'go2menuitem':
 case 'resethits':
 case 'menulink':
 case 'save':
 case 'apply':
     save($option, $task);
     break;
 case 'remove':
     trash($cid, $option);
     break;
 case 'publish':
     changeState($cid, 1, $option);
     break;
 case 'unpublish':
     changeState($cid, 0, $option);
     break;
 case 'accesspublic':
     changeAccess(intval($cid[0]), 0, $option);
     break;
 case 'accessregistered':
     changeAccess(intval($cid[0]), 1, $option);
     break;
 case 'accessspecial':
     changeAccess(intval($cid[0]), 2, $option);
Example #2
0
function dispatch($from, $to)
{
    $fromtype = strpos($from, "_section_") > -1 ? "section" : "unknown";
    $fromtype = strpos($from, "_theme_") > -1 ? "theme" : $fromtype;
    $fromtype = strpos($from, "style_") > -1 ? "style" : $fromtype;
    $fromtype = strpos($from, "click") > -1 ? "click" : $fromtype;
    $fromtype = strpos($from, "copy") > -1 ? "copy" : $fromtype;
    //$fromtype = ( strpos($from, "trash"     ) > -1 ) ? "delete"  : $fromtype;
    //echo "calling switch on [$from]/[$fromtype] with [$to]<br/>\n";
    if ($to == "trash") {
        $x = str_replace("_browser_", "", $from);
        $x = str_replace("_theme_", "", $x);
        $x = str_replace("_section_", "", $x);
        $x = str_replace("style_", "", $x);
        $x = str_replace("object", "", $x);
        $x = str_replace("_box", "", $x);
        //echo "<!-- dispatching to trash with [$fromtype] [$x] -->\n";
        if ($x == "default") {
            droperror("{$x}:{$fromtype}", "trash");
        } else {
            trash($fromtype, $x);
        }
    } else {
        switch ($fromtype) {
            case "style":
                movestyle($from, $to);
                break;
            case "theme":
                movetheme($from, $to);
                break;
            case "section":
                movesection($from, $to);
                break;
            case "click":
                clickevent($to);
                break;
            case "copy":
                docopy($from, $to);
                break;
            default:
                droperror($from, $to);
                break;
        }
    }
}