Exemplo n.º 1
0
$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
// we change the availability
if ($action == 'makeunavailable') {
    if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) {
        SubLanguageManager::make_unavailable_language($_GET['id']);
    }
}
if ($action == 'makeavailable') {
    if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) {
        SubLanguageManager::make_available_language($_GET['id']);
    }
}
if ($action == 'setplatformlanguage') {
    if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) {
        SubLanguageManager::set_platform_language($_GET['id']);
    }
}
if (isset($_POST['Submit']) && $_POST['Submit']) {
    // changing the name
    $sql_update = "UPDATE {$tbl_admin_languages} SET original_name='{$_POST['txt_name']}'\n                   WHERE id='{$_POST['edit_id']}'";
    $result = Database::query($sql_update);
    // changing the Platform language
    if ($_POST['platformlanguage'] && $_POST['platformlanguage'] != '') {
        //$sql_update_2 = "UPDATE $tbl_settings_current SET selected_value='{$_POST['platformlanguage']}' WHERE variable='platformLanguage'";
        //$result_2 = Database::query($sql_update_2);
        api_set_setting('platformLanguage', $_POST['platformlanguage'], null, null, $_configuration['access_url']);
    }
} elseif (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case 'makeavailable':