Example #1
0
     $code = Helper::getHTTPGetStringValue('code', null);
     $app = DbHelper::selectRow(TBL_APPLICATIONS, APP_ID . '=' . $appId, APP_PACKAGE);
     $mAppDesc = new ApplicationDesc($app[0]);
     if ($mAppDesc->addTranslation($code)) {
         Helper::pushAlert(ALERT_SUCCESS, 'Translation added with success !');
     } else {
         Helper::pushAlert(ALERT_ERROR, 'Something goes wrong ! Check log file in admin section.');
     }
     header('Location:index.php?p=' . PAGE_ID_APPS_PUB . '&app=' . $appId . "&code=" . $code);
     break;
     //////// DELETE TRANSLATION
 //////// DELETE TRANSLATION
 case 'delTranslation':
     require_once BASE_PATH . 'includes/appdesc.class.php';
     $mAppDesc = new ApplicationDesc($_POST['package']);
     if ($mAppDesc->delTranslation($_POST['code'])) {
         Helper::pushAlert(ALERT_SUCCESS, 'Translation deleted with success !');
     } else {
         Helper::pushAlert(ALERT_ERROR, 'Something goes wrong ! Check log file in admin section.');
     }
     header('Location:index.php?p=' . PAGE_ID_APPS_PUB . '&app=' . Helper::getHTTPGetStringValue('app', 0));
     break;
     //////// SAVE TRANSLATION
 //////// SAVE TRANSLATION
 case 'saveTranslation':
     require_once BASE_PATH . 'includes/appdesc.class.php';
     $mAppDesc = new ApplicationDesc($_POST['package']);
     if ($mAppDesc->loadTranslation($_POST['code'])) {
         foreach ($_POST as $k => $value) {
             $tmp = explode('-', $k);
             if (count($tmp) == 2 && strcmp($tmp[0], "prop") == 0) {