Exemple #1
0
                    break;
                case 'render':
                    $id = $router->getParams("id", 0, true);
                    $path = $config["global"]["path"];
                    echo file_get_contents("http://" . $_SERVER["HTTP_HOST"] . $path . "renderNews.php?id=" . $id);
                    exit;
                default:
                    setBadRequest('Unknown method for module news');
            }
            break;
        case 'push':
            $notifyController = new Notify();
            switch ($router->getMethod()) {
                case 'register_token_android':
                    $token = $router->getParams("token", 0, true);
                    $notifyController->registerNewToken($token, Notify::TOKEN_TYPE_GCM);
                    setResult(true, $router);
                    break;
                case 'register_token_ios':
                    $token = $router->getParams("token", 0, true);
                    $notifyController->registerNewToken($token, Notify::TOKEN_TYPE_APS);
                    setResult(true, $router);
                    break;
                default:
                    setBadRequest('Unknown method for module push');
            }
            break;
        default:
            setBadRequest('Unknown module' . $router->getModule());
    }
} catch (APIException $e) {