2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
15 define('AT_INCLUDE_PATH', '../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 admin_authenticate(AT_ADMIN_PRIV_LANGUAGES);
19 if (isset($_POST['submit_no'])) {
20 $msg->addFeedback('CANCELLED');
21 //shozub -- is this supposed to be lang_codeinstead of delete_lang???
22 header('Location: language.php?lang_code='.$_POST['delete_lang']);
26 if (isset($_POST['submit_yes'])) {
27 require_once(AT_INCLUDE_PATH . 'classes/Language/LanguageEditor.class.php');
29 $lang =& $languageManager->getLanguage($_POST['lang_code']);
30 $languageEditor =& new LanguageEditor($lang);
31 $languageEditor->deleteLanguage();
33 $msg->addFeedback('LANG_DELETED');
34 header('Location: language.php');
39 $language =& $languageManager->getLanguage($_GET['lang_code']);
40 if ($language === FALSE) {
41 $msg->addError('ITEM_NOT_FOUND'); // Originally AT_LANG_NOT_FOUND, make error code
43 header('Location: language.php?lang_code='.$_POST['delete_lang']);
47 require(AT_INCLUDE_PATH.'header.inc.php');
49 $hidden_vars['lang_code'] = $_GET['lang_code'];
51 $confirm = array('DELETE_LANG', $language->getEnglishName());
52 $msg->addConfirm($confirm, $hidden_vars);
55 require(AT_INCLUDE_PATH.'footer.inc.php');