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);
17 if (!AT_DEVEL_TRANSLATE) { exit; }
19 require_once(AT_INCLUDE_PATH . '../mods/_core/languages/classes/LanguageEditor.class.php');
21 $lang = $languageManager->getLanguage($_GET['lang_code']);
22 if ($lang === FALSE) {
23 require(AT_INCLUDE_PATH.'header.inc.php');
24 echo '<h3>'._AT('edit_language').'</h3>';
25 $msg->addError('NO_LANGUAGE');
29 require(AT_INCLUDE_PATH.'footer.inc.php');
33 if (isset($_POST['cancel'])) {
34 $msg->addFeedback('CANCELLED');
35 header('Location: language.php');
37 } else if (isset($_POST['submit'])) {
38 $languageEditor = new LanguageEditor($_GET['lang_code']);
39 $state = $languageEditor->updateLanguage($_POST, $languageManager->exists($_POST['code'], $_POST['locale']));
41 if (!$msg->containsErrors() && $state !== FALSE) {
42 $msg->addFeedback('LANG_UPDATED');
43 header('Location: language.php');
48 require(AT_INCLUDE_PATH.'header.inc.php');
53 if (!isset($_POST['submit'])) {
54 $_POST['code'] = $lang->getParentCode();
55 $_POST['locale'] = $lang->getLocale();
56 $_POST['charset'] = $lang->getCharacterSet();
57 $_POST['direction'] = $lang->getDirection();
58 $_POST['reg_exp'] = $lang->getRegularExpression();
59 $_POST['native_name'] = $lang->getNativeName();
60 $_POST['english_name'] = $lang->getEnglishName();
63 $savant->assign('lang', $lang);
64 $savant->display('admin/system_preferences/language_edit.tmpl.php');
65 require(AT_INCLUDE_PATH.'footer.inc.php'); ?>