Example #1
0
function save()
{
    $data = json_decode(\route\getParam("data"), true);
    $parent = $data["parent"];
    $children = $data["children"];
    include PATH . "src/fileSys.php";
    checkDir();
    $attrNameArr = array('id', 'class', 'name', 'frame', 'readonly', 'type', 'placeholder');
    $styleNameArr = array('width', 'height', 'top', 'left', 'position', 'background-color', 'resize', 'right', 'bottom', 'font-size', 'color', 'z-index', 'cursor', 'border-left', 'border-right', 'border-top', 'border-bottom', 'padding-left', 'padding-right', 'padding-top', 'padding-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin-bottom', 'line-height', 'text-align', 'background-image', 'background-repeat', 'border-radius', 'display', 'background-size', 'pointer-events', 'overflow', 'opacity', 'filter');
    createCss($parent, $children, $styleNameArr);
    createHtml($children, $attrNameArr);
    print '{"save": "success"}';
}
Example #2
0
function getRoute()
{
    global $commandList;
    $queryString = $_SERVER['QUERY_STRING'];
    if ($queryString || isset($_POST['c'])) {
        $command = \route\getParam("c");
        $action = \route\getParam("a");
        // param route check
        if (empty($action) || empty($command)) {
            echo "wrong route";
            exit;
        }
        // commandList check
        if (!$commandList[$command] || !in_array($action, $commandList[$command])) {
            echo "can not find in commandList";
            exit;
        }
        include PATH . "control/" . $command . ".php";
        call_user_func_array("\\{$command}\\{$action}", array());
    } else {
        // show index page
    }
}