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 if (isset($_POST['cancel'])) {
20 $msg->addFeedback('CANCELLED');
21 header('Location: language.php');
23 } else if (isset($_POST['submit'])) {
24 require_once(AT_INCLUDE_PATH . '../mods/_core/languages/classes/LanguageEditor.class.php');
26 if ($languageManager->exists($_POST['code'], $_POST['locale'])) {
27 $msg->addError('LANG_EXISTS');
29 $state = LanguageEditor::addLanguage($_POST, $db);
32 if (!$msg->containsErrors() && $state !== FALSE) {
33 $msg->addFeedback('LANG_ADDED');
34 header('Location: language.php');
39 require(AT_INCLUDE_PATH.'header.inc.php');
40 $savant->display('admin/system_preferences/language_add.tmpl.php');
41 require(AT_INCLUDE_PATH.'footer.inc.php'); ?>