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 /************************************************************************/
12 // $Id: language_add.php 7208 2008-01-09 16:07:24Z greg $
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/Language/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'); ?>
41 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
42 <input type="hidden" name="import" value="1" />
43 <div class="input-form" style="width:95%">
45 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="code"><?php echo _AT('lang_code'); ?></label><br />
46 <input id="code" name="code" type="text" size="2" maxlength="2" class="formfield" value="<?php echo $_POST['code']; ?>" />
50 <label for="locale"><?php echo _AT('locale'); ?></label><br />
51 <input id="locale" name="locale" type="text" size="2" maxlength="2" class="formfield" value="<?php echo $_POST['locale']; ?>" />
55 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="charset"><?php echo _AT('charset'); ?></label><br />
56 <input id="charset" name="charset" type="text" size="31" maxlength="20" class="formfield" value="<?php echo $_POST['charset']; ?>" />
60 <label for="ltr"><?php echo _AT('direction'); ?></label><br />
62 if ($_POST['direction'] == 'rtl') {
63 $rtl = 'checked="checked"';
67 $ltr='checked="checked"';
70 <input id="ltr" name="direction" type="radio" value="ltr" <?php echo $ltr; ?> /><label for="ltr"><?php echo _AT('ltr'); ?></label>, <input id="rtl" name="direction" type="radio" value="rtl" <?php echo $rtl; ?> /><label for="rtl"><?php echo _AT('rtl'); ?></label>
74 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="reg_exp"><?php echo _AT('reg_exp'); ?></label><br />
75 <input id="reg_exp" name="reg_exp" type="text" size="31" class="formfield" value="<?php echo $_POST['reg_exp']; ?>" />
79 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="nname"><?php echo _AT('name_in_language'); ?></label><br />
80 <input id="nname" name="native_name" type="text" size="31" maxlength="20" class="formfield" value="<?php echo $_POST['native_name']; ?>" />
84 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="ename"><?php echo _AT('name_in_english'); ?></label><br />
85 <input id="ename" name="english_name" type="text" size="31" maxlength="20" class="formfield" value="<?php echo $_POST['english_name'];?>" />
89 <div class="row buttons">
90 <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" /> <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
95 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>