Example #1
0
    $model->moduleDelete(array('id' => $api->getInputVal('id')));
    $model->tokenDelete(array('module_id' => $api->getInputVal('id')));
    $model->langDelete(array('id' => $api->getInputVal('id')));
    $model->commentDelete(array('module_id' => $api->getInputVal('id')));
    $model->ratingDelete(array('module_id' => $api->getInputVal('id')));
    if (is_file('modules/' . $module->icon)) {
        unlink('modules/' . $module->icon);
    }
    if (is_file('modules/' . $module->file)) {
        unlink('modules/' . $module->file);
    }
    $response->json($response);
} elseif ($route->match('tokens', 1)) {
    // Prepare and sanitize post input
    $api->setInputs(array('module_id' => $route->getParam(0)));
    $response->data = $model->tokensAll(array('module_id' => $api->getInputVal('module_id')));
    $response->json($response);
} 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());