Example #1
0
} elseif ($route->match('tokencreate', null)) {
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    $model->tokenCreate($api->getInputs());
    $response->json($response);
} elseif ($route->match('tokendelete', null)) {
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    $model->tokenDelete($api->getInputs());
    $response->json($response);
} elseif ($route->match('commentnotnew', null)) {
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    //    var_dump($api->getInputs());
    //    exit;
    if (!$model->commentUpdate(array('isnew' => 0), array('module_id' => $api->getInputVal('module_id')))) {
        $response->status = 500;
        $response->message = 'Unable to update a comment';
        $response->json($response);
    }
    //    $input['id'] = $db->inserId();
    //    $response->data = $input;
    $response->json($response);
} elseif ($route->match('commentdelete', null)) {
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    $model->commentDelete($api->getInputs());
    $response->json($response);
} elseif ($route->match('archivedelete', null)) {
    // Prepare and sanitize post input
    $api->setInputs($_POST);