Example #1
0
    //    if(property_exists($langs,$title_lang) &&  $langs->$title_lang !=''){
    //        $module->title = $langs->$title_lang;
    //    }
    // Set module description
    if (property_exists($langs, $desc_lang) && $langs->{$desc_lang} != '') {
        $module->description = $langs->{$desc_lang};
    }
    $response->data = $module;
    $response->json($response);
} elseif ($route->match('api-module-archive', 1)) {
    if (!$route->getParam(0)) {
        $response->status = 404;
        $response->message = 'Not found';
        $response->json($response);
    }
    $response->data = $model->archiveAll(array('modulename' => $route->getParam(0)));
    if (empty($response->data)) {
        $response->status = 404;
        $response->message = 'Not found';
        $response->json($response);
    }
    $response->json($response);
} elseif ($route->match('api-modules-installed', null)) {
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    $module = $model->moduleFind(array('id' => $api->getInputVal('id')));
    if (!$module) {
        $response->status = 404;
        $response->message = 'Not found';
        $response->json($response);
    }