2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 define('AT_INCLUDE_PATH', '../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16 admin_authenticate(AT_ADMIN_PRIV_LANGUAGES);
18 if (isset($_POST['submit_no'])) {
19 $msg->addFeedback('CANCELLED');
20 //shozub -- is this supposed to be lang_codeinstead of delete_lang???
21 header('Location: language.php?lang_code='.$_POST['delete_lang']);
25 if (isset($_POST['submit_yes'])) {
26 require_once(AT_INCLUDE_PATH . '../mods/_core/languages/classes/LanguageEditor.class.php');
28 $lang = $languageManager->getLanguage($_POST['lang_code']);
29 $languageEditor = new LanguageEditor($lang);
30 $languageEditor->deleteLanguage();
32 $msg->addFeedback('LANG_DELETED');
33 header('Location: language.php');
38 $language = $languageManager->getLanguage($_GET['lang_code']);
39 if ($language === FALSE) {
40 $msg->addError('ITEM_NOT_FOUND'); // Originally AT_LANG_NOT_FOUND, make error code
42 header('Location: language.php?lang_code='.$_POST['delete_lang']);
46 require(AT_INCLUDE_PATH.'header.inc.php');
48 $hidden_vars['lang_code'] = $_GET['lang_code'];
50 $confirm = array('DELETE_LANG', $language->getEnglishName());
51 $msg->addConfirm($confirm, $hidden_vars);
54 require(AT_INCLUDE_PATH.'footer.inc.php');