AC-4804: Security fixes for XSS, possible sql injection on multiple scripts within...
[acontent.git] / docs / themes / default / language / language_add_edit.tmpl.php
1 <?php\r
2 /************************************************************************/\r
3 /* AContent                                                             */\r
4 /************************************************************************/\r
5 /* Copyright (c) 2010                                                   */\r
6 /* Inclusive Design Institute                                           */\r
7 /*                                                                      */\r
8 /* This program is free software. You can redistribute it and/or        */\r
9 /* modify it under the terms of the GNU General Public License          */\r
10 /* as published by the Free Software Foundation.                        */\r
11 /************************************************************************/\r
12 \r
13 global $onload;\r
14 $onload = "initial();";\r
15 \r
16 include(TR_INCLUDE_PATH.'header.inc.php');\r
17 ?>\r
18 \r
19 <form name="input_form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?><?php if (isset($_GET["id"])) echo '?id='.intval($_GET["id"]); ?>" >\r
20 <?php if (isset($this->row["language_code"])) {?>\r
21 <input type="hidden" name="language_code" value="<?php echo $this->row["language_code"]; ?>" />\r
22 <input type="hidden" name="charset" value="<?php echo $this->row["charset"]; ?>" />\r
23 <?php }?>\r
24 \r
25 <div class="input-form">\r
26 \r
27 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('add_edit_language'); ?></legend>\r
28         <table class="form-data" align="center">\r
29                 <tr>\r
30                         <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?></td>\r
31                 </tr>\r
32 <!-- \r
33                 <tr align="left">\r
34                         <th><span class="required" title="<?php echo _AT('required_field'); ?>">*</span>\r
35                         <label for="lang_code"><?php echo _AT('lang_code'); ?></label></th>\r
36                         <td>\r
37 <?php if (isset($this->row['language_code'])) echo $this->row['lang_code']; else {?>\r
38                         <select name="lang_code" id="lang_code">\r
39                                 <option value="-1">-- <?php echo _AT('select');?> --</option>\r
40 <?php \r
41         foreach ($this->rows_lang as $row_lang)\r
42         {\r
43 ?>\r
44                                 <option value="<?php echo $row_lang['code_3letters']; ?>" <?php if ((isset($_POST["lang_code"]) && $_POST["lang_code"] == $row_lang['code_3letters']) || (!isset($_REQUEST["lang_code"]) && $this->row["lang_code"] == $row_lang['code_3letters'])) echo 'selected="selected"'; ?>><?php echo $row_lang["description"]. ' - '. $row_lang['code_3letters']; ?></option>\r
45 <?php\r
46         }\r
47 ?>\r
48                         </select>\r
49 <?php }?>\r
50                         </td>\r
51                 </tr>\r
52  -->\r
53                 <tr align="left">\r
54                         <th><label for="lang_code">&nbsp;&nbsp;&nbsp;<?php echo _AT('lang_code'); ?></label></th>\r
55                         <td>\r
56 <?php if (isset($this->row['language_code'])) echo $this->row['language_code']; else {?>\r
57                                 <input id="lang_code" name="lang_code" type="text" size="2" maxlength="2" value="<?php if (isset($_POST['lang_code'])) echo AT_print($_POST['lang_code'], 'input.text'); else echo AT_print($this->row['language_code'], 'input.text'); ?>" />\r
58 <?php }?>\r
59                         </td>\r
60                 </tr>\r
61 \r
62                 <tr align="left">\r
63                         <th><label for="locale">&nbsp;&nbsp;&nbsp;<?php echo _AT('locale'); ?></label></th>\r
64                         <td>\r
65 <?php if (isset($this->row['language_code'])) if ($this->row['locale'] == '') echo _AT('na'); else echo $this->row['locale']; else {?>\r
66                                 <input id="locale" name="locale" type="text" size="2" maxlength="2" value="<?php if (isset($_POST['locale'])) echo AT_print($_POST['locale'], 'input.text'); else echo AT_print($this->row['locale'], 'input.text'); ?>" />\r
67 <?php }?>\r
68                         </td>\r
69                 </tr>\r
70 \r
71                 <tr align="left">\r
72                         <th><span class="required" title="<?php echo _AT('required_field'); ?>">*</span>\r
73                         <label for="charset"><?php echo _AT('charset'); ?></label></th>\r
74                         <td>\r
75 <?php if (isset($this->row['language_code'])) echo $this->row['charset']; else {?>\r
76                                 <input type="text" name="charset" id="charset" value="<?php if (isset($_POST['charset'])) echo $_POST['charset']; else if (isset($this->row["charset"])) echo AT_print($this->row["charset"], 'input.text'); else echo DEFAULT_CHARSET; ?>" />\r
77 <?php }?>\r
78                         </td>\r
79                 </tr>\r
80 \r
81                 <tr align="left">\r
82                         <th><span class="required" title="<?php echo _AT('required_field'); ?>">*</span>\r
83                         <label for="native_name"><?php echo _AT('name_in_language'); ?></label></th>\r
84                         <td><input type="text" name="native_name" id="native_name" value="<?php if (isset($_POST['native_name'])) echo $_POST['native_name']; else echo AT_print($this->row["native_name"], 'input.text'); ?>" /></td>\r
85                 </tr>\r
86 \r
87                 <tr align="left">\r
88                         <th><span class="required" title="<?php echo _AT('required_field'); ?>">*</span>\r
89                         <label for="english_name"><?php echo _AT('name_in_english'); ?></label></th>\r
90                         <td><input type="text" name="english_name" id="english_name" value="<?php if (isset($_POST['english_name'])) echo $_POST['english_name']; else echo AT_print($this->row["english_name"], 'input.text'); ?>" /></td>\r
91                 </tr>\r
92 \r
93                 <tr align="left">\r
94                         <th>&nbsp;&nbsp;&nbsp;<?php echo _AT("status"); ?></th>\r
95                         <td>\r
96                                 <input type="radio" name="status" id="statusD" value="0" <?php if ((isset($_POST['status']) && $_POST['status']==0) || (!isset($_POST['status']) && $this->row['status']==0)) echo 'checked="checked"'; ?> /><label for="statusD"><?php echo _AT('disabled'); ?></label> \r
97                                 <input type="radio" name="status" id="statusE" value="1" <?php if ((isset($_POST['status']) && $_POST['status']==1) || (!isset($_POST['status']) && $this->row['status']==1) || (!isset($_POST['status']) && !isset($this->row['status']))) echo 'checked="checked"'; ?> /><label for="statusE"><?php echo _AT('enabled'); ?></label>\r
98                         </td>\r
99                 </tr>\r
100 \r
101                 <tr>\r
102                         <td colspan="2" align="center">\r
103                         <p class="submit_button">\r
104                         <input type="submit" name="save" value="<?php echo _AT('save'); ?>" />&nbsp;&nbsp;\r
105                         <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />\r
106                         </p>\r
107                         </td>\r
108                 </tr>\r
109         </table>\r
110         \r
111 </fieldset>\r
112 </div>\r
113 </form>\r
114 \r
115 <script type="text/JavaScript">\r
116 //<!--\r
117 \r
118 function initial()\r
119 {\r
120         // set cursor focus\r
121         document.input_form.lang_code.focus();\r
122 }\r
123 \r
124 function CheckAll(element_name, selectall_checkbox_name) {\r
125         for (var i=0;i<document.input_form.elements.length;i++) {\r
126                 var e = document.input_form.elements[i];\r
127                 if ((e.name == element_name) && (e.type=='checkbox')) {\r
128                         e.checked = document.input_form[selectall_checkbox_name].checked;\r
129                         togglerowhighlight(document.getElementById("r" + e.id), e.id);\r
130                 }\r
131         }\r
132 }\r
133 \r
134 function togglerowhighlight(obj, boxid) {\r
135         if (document.getElementById(boxid).checked) {\r
136                 obj.className = 'selected';\r
137         } else {\r
138                 obj.className = '';\r
139         }\r
140 }\r
141 //  End -->\r
142 //-->\r
143 </script>\r
144 \r
145 <?php include(TR_INCLUDE_PATH.'footer.inc.php'); ?>\r