PageRenderTime 48ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/manager/actions/mutate_settings.dynamic.php

http://modx-ja.googlecode.com/
PHP | 1448 lines | 1370 code | 39 blank | 39 comment | 105 complexity | e8bdeb7576ea7e205bb34b349afa0a85 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, BSD-3-Clause
  1. <?php
  2. if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the MODx Content Manager instead of accessing this file directly.");
  3. if(!$modx->hasPermission('settings')) {
  4. $e->setError(3);
  5. $e->dumpError();
  6. }
  7. // check to see the edit settings page isn't locked
  8. $sql = "SELECT internalKey, username FROM $dbase.`".$table_prefix."active_users` WHERE $dbase.`".$table_prefix."active_users`.action=17";
  9. $rs = mysql_query($sql);
  10. $limit = mysql_num_rows($rs);
  11. if($limit>1) {
  12. for ($i=0;$i<$limit;$i++) {
  13. $lock = mysql_fetch_assoc($rs);
  14. if($lock['internalKey']!=$modx->getLoginUserID()) {
  15. $msg = sprintf($_lang["lock_settings_msg"],$lock['username']);
  16. $e->setError(5, $msg);
  17. $e->dumpError();
  18. }
  19. }
  20. }
  21. // end check for lock
  22. // reload system settings from the database.
  23. // this will prevent user-defined settings from being saved as system setting
  24. $settings = array();
  25. $sql = "SELECT setting_name, setting_value FROM $dbase.`".$table_prefix."system_settings`";
  26. $rs = mysql_query($sql);
  27. $number_of_settings = mysql_num_rows($rs);
  28. while ($row = mysql_fetch_assoc($rs)) $settings[$row['setting_name']] = $row['setting_value'];
  29. extract($settings, EXTR_OVERWRITE);
  30. $displayStyle = ($_SESSION['browser']!=='ie') ? 'table-row' : 'block' ;
  31. // load languages and keys
  32. $lang_keys = array();
  33. $dir = dir("includes/lang");
  34. while ($file = $dir->read()) {
  35. if(strpos($file, ".inc.php")>0) {
  36. $endpos = strpos ($file, ".");
  37. $languagename = substr($file, 0, $endpos);
  38. $lang_keys[$languagename] = get_lang_keys($file);
  39. }
  40. }
  41. $dir->close();
  42. $isDefaultUnavailableMsg = $site_unavailable_message == $_lang['siteunavailable_message_default'];
  43. $isDefaultUnavailableMsgJs = $isDefaultUnavailableMsg ? 'true' : 'false';
  44. $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default'];
  45. /* check the file paths */
  46. $settings['filemanager_path'] = $filemanager_path = trim($settings['filemanager_path']) == '' ? MODX_BASE_PATH : $settings['filemanager_path'];
  47. $settings['rb_base_dir'] = $rb_base_dir = trim($settings['rb_base_dir']) == '' ? MODX_BASE_PATH.'assets/' : $settings['rb_base_dir'];
  48. $settings['rb_base_url'] = $rb_base_url = trim($settings['rb_base_url']) == '' ? 'assets/' : $settings['rb_base_url'];
  49. ?>
  50. <script type="text/javascript">
  51. function checkIM() {
  52. im_on = document.settings.im_plugin[0].checked; // check if im_plugin is on
  53. if(im_on==true) {
  54. showHide(/imRow/, 1);
  55. }
  56. };
  57. function checkCustomIcons() {
  58. if(document.settings.editor_toolbar.selectedIndex!=3) {
  59. showHide(/custom/,0);
  60. }
  61. };
  62. function showHide(what, onoff){
  63. var all = document.getElementsByTagName( "*" );
  64. var l = all.length;
  65. var buttonRe = what;
  66. var id, el, stylevar;
  67. if(onoff==1) {
  68. stylevar = "<?php echo $displayStyle; ?>";
  69. } else {
  70. stylevar = "none";
  71. }
  72. for ( var i = 0; i < l; i++ ) {
  73. el = all[i]
  74. id = el.id;
  75. if ( id == "" ) continue;
  76. if (buttonRe.test(id)) {
  77. el.style.display = stylevar;
  78. }
  79. }
  80. };
  81. function addContentType(){
  82. var i,o,exists=false;
  83. var txt = document.settings.txt_custom_contenttype;
  84. var lst = document.settings.lst_custom_contenttype;
  85. for(i=0;i<lst.options.length;i++)
  86. {
  87. if(lst.options[i].value==txt.value) {
  88. exists=true;
  89. break;
  90. }
  91. }
  92. if (!exists) {
  93. o = new Option(txt.value,txt.value);
  94. lst.options[lst.options.length]= o;
  95. updateContentType();
  96. }
  97. txt.value='';
  98. }
  99. function removeContentType(){
  100. var i;
  101. var lst = document.settings.lst_custom_contenttype;
  102. for(i=0;i<lst.options.length;i++) {
  103. if(lst.options[i].selected) {
  104. lst.remove(i);
  105. break;
  106. }
  107. }
  108. updateContentType();
  109. }
  110. function updateContentType(){
  111. var i,o,ol=[];
  112. var lst = document.settings.lst_custom_contenttype;
  113. var ct = document.settings.custom_contenttype;
  114. while(lst.options.length) {
  115. ol[ol.length] = lst.options[0].value;
  116. lst.options[0]= null;
  117. }
  118. if(ol.sort) ol.sort();
  119. ct.value = ol.join(",");
  120. for(i=0;i<ol.length;i++) {
  121. o = new Option(ol[i],ol[i]);
  122. lst.options[lst.options.length]= o;
  123. }
  124. documentDirty = true;
  125. }
  126. /**
  127. * @param element el were language selection comes from
  128. * @param string lkey language key to look up
  129. * @param id elupd html element to update with results
  130. * @param string default_str default value of string for loaded manager language - allows some level of confirmation of change from default
  131. */
  132. function confirmLangChange(el, lkey, elupd){
  133. lang_current = document.getElementById(elupd).value;
  134. lang_default = document.getElementById(lkey+'_hidden').value;
  135. changed = lang_current != lang_default;
  136. proceed = true;
  137. if(changed) {
  138. proceed = confirm('<?php echo $_lang['confirm_setting_language_change']; ?>');
  139. }
  140. if(proceed) {
  141. //document.getElementById(elupd).value = '';
  142. lang = el.options[el.selectedIndex].value;
  143. var myAjax = new Ajax('index.php?a=118', {
  144. method: 'post',
  145. data: 'action=get&lang='+lang+'&key='+lkey
  146. }).request();
  147. myAjax.addEvent('onComplete', function(resp){
  148. document.getElementById(elupd).value = resp;
  149. });
  150. }
  151. }
  152. </script>
  153. <form name="settings" action="index.php?a=30" method="post" enctype="multipart/form-data">
  154. <h1><?php echo $_lang['settings_title']; ?></h1>
  155. <div id="actions">
  156. <ul class="actionButtons">
  157. <li id="Button1">
  158. <a href="#" onclick="documentDirty=false; document.settings.submit();">
  159. <img src="<?php echo $_style["icons_save"]?>" /> <?php echo $_lang['save']; ?>
  160. </a>
  161. </li>
  162. <li id="Button5">
  163. <a href="#" onclick="documentDirty=false;document.location.href='index.php?a=2';">
  164. <img src="<?php echo $_style["icons_cancel"]?>" /> <?php echo $_lang['cancel']; ?>
  165. </a>
  166. </li>
  167. </ul>
  168. </div>
  169. <div style="margin: 0 10px 0 20px">
  170. <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
  171. <input type="hidden" name="settings_version" value="<?php echo $modx_version; ?>" />
  172. <!-- this field is used to check site settings have been entered/ updated after install or upgrade -->
  173. <?php if(!isset($settings_version) || $settings_version!=$modx_version) {
  174. include(MODX_MANAGER_PATH.'includes/locale/' . $manager_language . '/system_settings.php');
  175. ?>
  176. <div class='sectionBody'><p><?php echo $_lang['settings_after_install']; ?></p></div>
  177. <?php } ?>
  178. <script type="text/javascript" src="media/script/tabpane.js"></script>
  179. <div class="tab-pane" id="settingsPane">
  180. <script type="text/javascript">
  181. tpSettings = new WebFXTabPane( document.getElementById( "settingsPane" ), <?php echo $modx->config['remember_last_tab'] == 0 ? 'false' : 'true'; ?> );
  182. </script>
  183. <!-- Site Settings -->
  184. <div class="tab-page" id="tabPage2">
  185. <h2 class="tab"><?php echo $_lang["settings_site"] ?></h2>
  186. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage2" ) );</script>
  187. <table border="0" cellspacing="0" cellpadding="3">
  188. <tr>
  189. <td nowrap class="warning"><b><?php echo $_lang["sitename_title"] ?></b></td>
  190. <td ><input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 200px;" name="site_name" value="<?php echo isset($site_name) ? $site_name : "My MODx Site" ; ?>" /></td>
  191. </tr>
  192. <tr>
  193. <td width="200">&nbsp;</td>
  194. <td class='comment'><?php echo $_lang["sitename_message"] ?></td>
  195. </tr>
  196. <tr>
  197. <td colspan="2"><div class='split'></div></td>
  198. </tr>
  199. <tr>
  200. <td nowrap class="warning"><b><?php echo $_lang["language_title"]?></b></td>
  201. <td> <select name="manager_language" size="1" class="inputBox" onchange="documentDirty=true;">
  202. <?php echo get_lang_options(null, $manager_language);?>
  203. </select> </td>
  204. </tr>
  205. <tr>
  206. <td width="200">&nbsp;</td>
  207. <td class='comment'><?php echo $_lang["language_message"]?></td>
  208. </tr>
  209. <tr>
  210. <td colspan="2"><div class='split'></div></td>
  211. </tr>
  212. <tr>
  213. <td nowrap class="warning"><b><?php echo $_lang["charset_title"]?></b></td>
  214. <td> <select name="modx_charset" size="1" class="inputBox" style="width:250px;" onchange="documentDirty=true;">
  215. <?php include "charsets.php"; ?>
  216. </select> </td>
  217. </tr>
  218. <tr>
  219. <td width="200">&nbsp;</td>
  220. <td class='comment'><?php echo $_lang["charset_message"]?></td>
  221. </tr>
  222. <tr>
  223. <td colspan="2"><div class='split'></div></td>
  224. </tr>
  225. <tr>
  226. <tr>
  227. <td nowrap class="warning"><b><?php echo $_lang["xhtml_urls_title"] ?></b></td>
  228. <td><input onchange="documentDirty=true;" type="radio" name="xhtml_urls" value="1" <?php echo $xhtml_urls=='1' ? 'checked="checked"' : "" ; ?> />
  229. <?php echo $_lang["yes"]?><br />
  230. <input onchange="documentDirty=true;" type="radio" name="xhtml_urls" value="0" <?php echo ($xhtml_urls=='0' || !isset($xhtml_urls)) ? 'checked="checked"' : "" ; ?> />
  231. <?php echo $_lang["no"]?> </td>
  232. </tr>
  233. <tr>
  234. <td width="200">&nbsp;</td>
  235. <td class='comment'><?php echo $_lang["xhtml_urls_message"] ?></td>
  236. </tr>
  237. <tr>
  238. <td colspan="2"><div class='split'></div></td>
  239. </tr>
  240. <tr>
  241. <td nowrap class="warning"><b><?php echo $_lang["sitestart_title"] ?></b></td>
  242. <td><input onchange="documentDirty=true;" type='text' maxlength='10' size='5' name="site_start" value="<?php echo isset($site_start) ? $site_start : 1 ; ?>" /></td>
  243. </tr>
  244. <tr>
  245. <td width="200">&nbsp;</td>
  246. <td class='comment'><?php echo $_lang["sitestart_message"] ?></td>
  247. </tr>
  248. <tr>
  249. <td colspan="2"><div class='split'></div></td>
  250. </tr>
  251. <tr>
  252. <td nowrap class="warning"><b><?php echo $_lang["errorpage_title"] ?></b></td>
  253. <td><input onchange="documentDirty=true;" type='text' maxlength='10' size='5' name="error_page" value="<?php echo isset($error_page) ? $error_page : 1 ; ?>" /></td>
  254. </tr>
  255. <tr>
  256. <td width="200">&nbsp;</td>
  257. <td class='comment'><?php echo $_lang["errorpage_message"] ?></td>
  258. </tr>
  259. <tr>
  260. <td colspan="2"><div class='split'></div></td>
  261. </tr>
  262. <tr>
  263. <td nowrap class="warning"><b><?php echo $_lang["unauthorizedpage_title"] ?></b></td>
  264. <td><input onchange="documentDirty=true;" type='text' maxlength='10' size='5' name="unauthorized_page" value="<?php echo isset($unauthorized_page) ? $unauthorized_page : 1 ; ?>" /></td>
  265. </tr>
  266. <tr>
  267. <td width="200">&nbsp;</td>
  268. <td class='comment'><?php echo $_lang["unauthorizedpage_message"] ?></td>
  269. </tr>
  270. <tr>
  271. <td colspan="2"><div class='split'></div></td>
  272. </tr>
  273. <tr>
  274. <td nowrap class="warning"><b><?php echo $_lang["sitestatus_title"] ?></b></td>
  275. <td><input onchange="documentDirty=true;" type="radio" name="site_status" value="1" <?php echo ($site_status=='1' || !isset($site_status)) ? 'checked="checked"' : "" ; ?> />
  276. <?php echo $_lang["online"]?><br />
  277. <input onchange="documentDirty=true;" type="radio" name="site_status" value="0" <?php echo $site_status=='0' ? 'checked="checked"' : "" ; ?> />
  278. <?php echo $_lang["offline"]?> </td>
  279. </tr>
  280. <tr>
  281. <td width="200">&nbsp;</td>
  282. <td class='comment'><?php echo $_lang["sitestatus_message"] ?></td>
  283. </tr>
  284. <tr>
  285. <td colspan="2"><div class='split'></div></td>
  286. </tr>
  287. <tr>
  288. <td nowrap class="warning" valign="top"><b><?php echo $_lang["siteunavailable_page_title"] ?></b></td>
  289. <td><input onchange="documentDirty=true;" name="site_unavailable_page" type="text" maxlength="10" size="5" value="<?php echo isset($site_unavailable_page) ? $site_unavailable_page : "" ; ?>" /></td>
  290. </tr>
  291. <tr>
  292. <td width="200">&nbsp;</td>
  293. <td class='comment'><?php echo $_lang["siteunavailable_page_message"] ?></td>
  294. </tr>
  295. <tr>
  296. <td colspan="2"><div class='split'></div></td>
  297. </tr>
  298. <tr>
  299. <td nowrap class="warning" valign="top"><b><?php echo $_lang["siteunavailable_title"] ?></b>
  300. <br />
  301. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  302. <select name="reload_site_unavailable" id="reload_site_unavailable_select" onchange="confirmLangChange(this, 'siteunavailable_message_default', 'site_unavailable_message_textarea');">
  303. <?php echo get_lang_options('siteunavailable_message_default');?>
  304. </select>
  305. </td>
  306. <td> <textarea name="site_unavailable_message" id="site_unavailable_message_textarea" style="width:100%; height: 120px;"><?php echo $site_unavailable_message_view; ?></textarea>
  307. <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']);?>" />
  308. </td>
  309. </tr>
  310. <tr>
  311. <td width="200">&nbsp;</td>
  312. <td class='comment'><?php echo $_lang['siteunavailable_message'];?></td>
  313. </tr>
  314. <tr>
  315. <td colspan="2"><div class='split'></div></td>
  316. </tr>
  317. <tr>
  318. <td nowrap class="warning" valign="top"><b><?php echo $_lang["track_visitors_title"] ?></b></td>
  319. <td><input onchange="documentDirty=true;" type="radio" name="track_visitors" value="1" <?php echo ($track_visitors=='1' || !isset($track_visitors)) ? 'checked="checked"' : "" ; ?> />
  320. <?php echo $_lang["yes"]?><br />
  321. <input onchange="documentDirty=true;" type="radio" name="track_visitors" value="0" <?php echo $track_visitors=='0' ? 'checked="checked"' : "" ; ?> />
  322. <?php echo $_lang["no"]?> </td>
  323. </tr>
  324. <tr>
  325. <td width="200">&nbsp;</td>
  326. <td class='comment'><?php echo $_lang["track_visitors_message"] ?></td>
  327. </tr>
  328. <tr>
  329. <td colspan="2"><div class='split'></div></td>
  330. </tr>
  331. <tr>
  332. <td nowrap class="warning" valign="top"><b><?php echo $_lang["top_howmany_title"] ?></b></td>
  333. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="top_howmany" value="<?php echo isset($top_howmany) ? $top_howmany : 10 ; ?>" /></td>
  334. </tr>
  335. <tr>
  336. <td width="200">&nbsp;</td>
  337. <td class='comment'><?php echo $_lang["top_howmany_message"] ?></td>
  338. </tr>
  339. <tr>
  340. <td colspan="2"><div class='split'></div></td>
  341. </tr>
  342. <tr>
  343. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaulttemplate_logic_title"];?></b></td>
  344. <td>
  345. <p><?php echo $_lang["defaulttemplate_logic_general_message"];?></p>
  346. <input onchange="documentDirty=true;" type="radio" name="auto_template_logic" value="system"<?php if($auto_template_logic == 'system') {echo " checked='checked'";}?>/> <?php echo $_lang["defaulttemplate_logic_system_message"]; ?><br />
  347. <input onchange="documentDirty=true;" type="radio" name="auto_template_logic" value="parent"<?php if($auto_template_logic == 'parent') {echo " checked='checked'";}?>/> <?php echo $_lang["defaulttemplate_logic_parent_message"]; ?><br />
  348. <input onchange="documentDirty=true;" type="radio" name="auto_template_logic" value="sibling"<?php if($auto_template_logic == 'sibling') {echo " checked='checked'";}?>/> <?php echo $_lang["defaulttemplate_logic_sibling_message"]; ?><br />
  349. </td>
  350. </tr>
  351. <tr>
  352. <td colspan="2"><div class='split'></div></td>
  353. </tr>
  354. <tr>
  355. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaulttemplate_title"] ?></b></td>
  356. <td>
  357. <?php
  358. $sql = 'SELECT t.templatename, t.id, c.category FROM '.$table_prefix.'site_templates t LEFT JOIN '.$table_prefix.'categories c ON t.category = c.id ORDER BY c.category, t.templatename ASC';
  359. $rs = mysql_query($sql);
  360. ?>
  361. <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template;?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px">
  362. <?php
  363. $currentCategory = '';
  364. while ($row = mysql_fetch_assoc($rs)) {
  365. $thisCategory = $row['category'];
  366. if($thisCategory == null) {
  367. $thisCategory = $_lang["no_category"];
  368. }
  369. if($thisCategory != $currentCategory) {
  370. if($closeOptGroup) {
  371. echo "\t\t\t\t\t</optgroup>\n";
  372. }
  373. echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
  374. $closeOptGroup = true;
  375. } else {
  376. $closeOptGroup = false;
  377. }
  378. $selectedtext = $row['id'] == $default_template ? ' selected="selected"' : '';
  379. if ($selectedtext) {
  380. $oldTmpId = $row['id'];
  381. $oldTmpName = $row['templatename'];
  382. }
  383. echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n";
  384. $currentCategory = $thisCategory;
  385. }
  386. if($thisCategory != '') {
  387. echo "\t\t\t\t\t</optgroup>\n";
  388. }
  389. ?>
  390. </select>
  391. <br />
  392. <div id="template_reset_options_wrapper" style="display:none;">
  393. <input onchange="documentDirty=true;" type="radio" name="reset_template" value="1" /> <?php echo $_lang["template_reset_all"]; ?><br />
  394. <input onchange="documentDirty=true;" type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang["template_reset_specific"],$oldTmpName); ?>
  395. </div>
  396. <input type="hidden" name="old_template" value="<?php echo $oldTmpId; ?>" />
  397. </td>
  398. </tr>
  399. <tr>
  400. <td width="200">&nbsp;</td>
  401. <td class='comment'><?php echo $_lang["defaulttemplate_message"] ?></td>
  402. </tr>
  403. <tr>
  404. <td colspan="2"><div class='split'></div></td>
  405. </tr>
  406. <tr>
  407. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultpublish_title"] ?></b></td>
  408. <td> <input onchange="documentDirty=true;" type="radio" name="publish_default" value="1" <?php echo $publish_default=='1' ? 'checked="checked"' : "" ; ?> />
  409. <?php echo $_lang["yes"]?><br />
  410. <input onchange="documentDirty=true;" type="radio" name="publish_default" value="0" <?php echo ($publish_default=='0' || !isset($publish_default)) ? 'checked="checked"' : "" ; ?> />
  411. <?php echo $_lang["no"]?> </td>
  412. </tr>
  413. <tr>
  414. <td width="200">&nbsp;</td>
  415. <td class='comment'><?php echo $_lang["defaultpublish_message"] ?></td>
  416. </tr>
  417. <tr>
  418. <td colspan="2"><div class='split'></div></td>
  419. </tr>
  420. <tr>
  421. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultcache_title"] ?></b></td>
  422. <td> <input onchange="documentDirty=true;" type="radio" name="cache_default" value="1" <?php echo $cache_default=='1' ? 'checked="checked"' : "" ; ?> />
  423. <?php echo $_lang["yes"]?><br />
  424. <input onchange="documentDirty=true;" type="radio" name="cache_default" value="0" <?php echo ($cache_default=='0' || !isset($cache_default)) ? 'checked="checked"' : "" ; ?> />
  425. <?php echo $_lang["no"]?> </td>
  426. </tr>
  427. <tr>
  428. <td width="200">&nbsp;</td>
  429. <td class='comment'><?php echo $_lang["defaultcache_message"] ?></td>
  430. </tr>
  431. <tr>
  432. <td colspan="2"><div class='split'></div></td>
  433. </tr>
  434. <tr>
  435. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultsearch_title"] ?></b></td>
  436. <td> <input onchange="documentDirty=true;" type="radio" name="search_default" value="1" <?php echo $search_default=='1' ? 'checked="checked"' : "" ; ?> />
  437. <?php echo $_lang["yes"]?><br />
  438. <input onchange="documentDirty=true;" type="radio" name="search_default" value="0" <?php echo ($search_default=='0' || !isset($search_default)) ? 'checked="checked"' : "" ; ?> />
  439. <?php echo $_lang["no"]?> </td>
  440. </tr>
  441. <tr>
  442. <td width="200">&nbsp;</td>
  443. <td class='comment'><?php echo $_lang["defaultsearch_message"] ?></td>
  444. </tr>
  445. <tr>
  446. <td colspan="2"><div class='split'></div></td>
  447. </tr>
  448. <tr>
  449. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultmenuindex_title"] ?></b></td>
  450. <td> <input onchange="documentDirty=true;" type="radio" name="auto_menuindex" value="1" <?php echo ($auto_menuindex=='1' || !isset($auto_menuindex)) ? 'checked="checked"' : "" ; ?> />
  451. <?php echo $_lang["yes"]?><br />
  452. <input onchange="documentDirty=true;" type="radio" name="auto_menuindex" value="0" <?php echo ($auto_menuindex=='0') ? 'checked="checked"' : "" ; ?> />
  453. <?php echo $_lang["no"]?> </td>
  454. </tr>
  455. <tr>
  456. <td width="200">&nbsp;</td>
  457. <td class='comment'><?php echo $_lang["defaultmenuindex_message"] ?></td>
  458. </tr>
  459. <tr>
  460. <td colspan="2"><div class='split'></div></td>
  461. </tr>
  462. <tr>
  463. <td nowrap class="warning" valign="top"><b><?php echo $_lang["custom_contenttype_title"] ?></b></td>
  464. <td><input name="txt_custom_contenttype" type="text" maxlength="100" style="width: 200px;" value="" /> <input type="button" value="<?php echo $_lang["add"]; ?>" onclick='addContentType()' /><br />
  465. <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
  466. <select name="lst_custom_contenttype" style="width:200px;" size="5">
  467. <?php
  468. $custom_contenttype = (isset($custom_contenttype) ? $custom_contenttype : "text/css,text/html,text/javascript,text/plain,text/xml");
  469. $ct = explode(",",$custom_contenttype);
  470. for($i=0;$i<count($ct);$i++) {
  471. echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>";
  472. }
  473. ?>
  474. </select>
  475. <input name="custom_contenttype" type="hidden" value="<?php echo $custom_contenttype; ?>" />
  476. </td><td valign="top">&nbsp;<input name="removecontenttype" type="button" value="<?php echo $_lang["remove"]; ?>" onclick='removeContentType()' /></td></tr></table>
  477. </td>
  478. </tr>
  479. <tr>
  480. <td width="200">&nbsp;</td>
  481. <td class='comment'><?php echo $_lang["custom_contenttype_message"] ?></td>
  482. </tr>
  483. <tr>
  484. <td colspan="2"><div class='split'></div></td>
  485. <tr>
  486. <td nowrap class="warning"><b><?php echo $_lang["serveroffset_title"] ?></b></td>
  487. <td> <select name="server_offset_time" size="1" class="inputBox">
  488. <?php
  489. for($i=-24; $i<25; $i++) {
  490. $seconds = $i*60*60;
  491. $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
  492. ?>
  493. <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option>
  494. <?php
  495. }
  496. ?>
  497. </select> </td>
  498. </tr>
  499. <tr>
  500. <td width="200">&nbsp;</td>
  501. <td class='comment'><?php printf($_lang["serveroffset_message"], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></td>
  502. </tr>
  503. <tr>
  504. <td colspan="2"><div class='split'>&nbsp;</div></td>
  505. </tr>
  506. <tr>
  507. <td nowrap class="warning"><b><?php echo $_lang["server_protocol_title"] ?></b></td>
  508. <td> <input onchange="documentDirty=true;" type="radio" name="server_protocol" value="http" <?php echo ($server_protocol=='http' || !isset($server_protocol))? 'checked="checked"' : "" ; ?> />
  509. <?php echo $_lang["server_protocol_http"]?><br />
  510. <input onchange="documentDirty=true;" type="radio" name="server_protocol" value="https" <?php echo $server_protocol=='https' ? 'checked="checked"' : "" ; ?> />
  511. <?php echo $_lang["server_protocol_https"]?> </td>
  512. </tr>
  513. <tr>
  514. <td width="200">&nbsp;</td>
  515. <td class='comment'><?php echo $_lang["server_protocol_message"] ?></td>
  516. </tr>
  517. <tr>
  518. <td colspan="2"><div class='split'></div></td>
  519. </tr>
  520. <tr>
  521. <td nowrap class="warning"><b><?php echo $_lang["validate_referer_title"] ?></b></td>
  522. <td><input onchange="documentDirty=true;" type="radio" name="validate_referer" value="1" <?php echo ($validate_referer=='1' || !isset($validate_referer)) ? 'checked="checked"' : "" ; ?> />
  523. <?php echo $_lang["yes"]?><br />
  524. <input onchange="documentDirty=true;" type="radio" name="validate_referer" value="0" <?php echo $validate_referer=='0' ? 'checked="checked"' : "" ; ?> />
  525. <?php echo $_lang["no"]?> </td>
  526. </tr>
  527. <tr>
  528. <td width="200">&nbsp;</td>
  529. <td class='comment'><?php echo $_lang["validate_referer_message"] ?></td>
  530. </tr>
  531. <tr>
  532. <td colspan="2"><div class='split'></div></td>
  533. </tr>
  534. <tr>
  535. <td nowrap class="warning"><?php echo $_lang["rss_url_news_title"] ?></td>
  536. <td ><input onchange="documentDirty=true;" type='text' maxlength='350' style="width: 350px;" name="rss_url_news" value="<?php echo isset($rss_url_news) ? $rss_url_news : $_lang["rss_url_news_default"] ; ?>" /></td>
  537. </tr>
  538. <tr>
  539. <td width="200">&nbsp;</td>
  540. <td class='comment'><?php echo $_lang["rss_url_news_message"] ?></td>
  541. </tr>
  542. <tr>
  543. <td colspan="2"><div class='split'></div></td>
  544. </tr>
  545. <tr>
  546. <td nowrap class="warning"><?php echo $_lang["rss_url_security_title"] ?></td>
  547. <td ><input onchange="documentDirty=true;" type='text' maxlength='350' style="width: 350px;" name="rss_url_security" value="<?php echo isset($rss_url_security) ? $rss_url_security : $_lang["rss_url_security_default"] ; ?>" /></td>
  548. </tr>
  549. <tr>
  550. <td width="200">&nbsp;</td>
  551. <td class='comment'><?php echo $_lang["rss_url_security_message"] ?></td>
  552. </tr>
  553. <tr>
  554. <td colspan="2"><div class='split'></div></td>
  555. </tr>
  556. <tr class='row1'>
  557. <td colspan="2">
  558. <?php
  559. // invoke OnSiteSettingsRender event
  560. $evtOut = $modx->invokeEvent("OnSiteSettingsRender");
  561. if(is_array($evtOut)) echo implode("",$evtOut);
  562. ?>
  563. </td>
  564. </tr>
  565. </table>
  566. </div>
  567. <!-- Friendly URL settings -->
  568. <div class="tab-page" id="tabPage3">
  569. <h2 class="tab"><?php echo $_lang["settings_furls"] ?></h2>
  570. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage3" ) );</script>
  571. <table border="0" cellspacing="0" cellpadding="3">
  572. <tr>
  573. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendlyurls_title"] ?></b></td>
  574. <td> <input onchange="documentDirty=true;" type="radio" name="friendly_urls" value="1" <?php echo $friendly_urls=='1' ? 'checked="checked"' : "" ; ?> onclick='showHide(/furlRow/, 1);' />
  575. <?php echo $_lang["yes"]?><br />
  576. <input onchange="documentDirty=true;" type="radio" name="friendly_urls" value="0" <?php echo ($friendly_urls=='0' || !isset($friendly_urls)) ? 'checked="checked"' : "" ; ?> onclick='showHide(/furlRow/, 0);' />
  577. <?php echo $_lang["no"]?> </td>
  578. </tr>
  579. <tr>
  580. <td width="200">&nbsp;</td>
  581. <td class='comment'><?php echo $_lang["friendlyurls_message"] ?></td>
  582. </tr>
  583. <tr>
  584. <td colspan="2"><div class='split'></div></td>
  585. </tr>
  586. <tr id='furlRow1' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  587. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendlyurlsprefix_title"] ?></b></td>
  588. <td><input onchange="documentDirty=true;" type='text' maxlength='50' style="width: 200px;" name="friendly_url_prefix" value="<?php echo isset($friendly_url_prefix) ? $friendly_url_prefix : "p" ; ?>" /></td>
  589. </tr>
  590. <tr id='furlRow2' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  591. <td width="200">&nbsp;</td>
  592. <td class='comment'><?php echo $_lang["friendlyurlsprefix_message"] ?></td>
  593. </tr>
  594. <tr id='furlRow3' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  595. <td colspan="2"><div class='split'></div></td>
  596. </tr>
  597. <tr id='furlRow4' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  598. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendlyurlsuffix_title"] ?></b></td>
  599. <td><input onchange="documentDirty=true;" type='text' maxlength='50' style="width: 200px;" name="friendly_url_suffix" value="<?php echo isset($friendly_url_suffix) ? $friendly_url_suffix : ".html" ; ?>" /></td>
  600. </tr>
  601. <tr id='furlRow5' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  602. <td width="200">&nbsp;</td>
  603. <td class='comment'><?php echo $_lang["friendlyurlsuffix_message"] ?></td>
  604. </tr>
  605. <tr id='furlRow6' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  606. <td colspan="2"><div class='split'></div></td>
  607. </tr>
  608. <tr id='furlRow7' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  609. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendly_alias_title"] ?></b></td>
  610. <td> <input onchange="documentDirty=true;" type="radio" name="friendly_alias_urls" value="1" <?php echo $friendly_alias_urls=='1' ? 'checked="checked"' : "" ; ?> />
  611. <?php echo $_lang["yes"]?><br />
  612. <input onchange="documentDirty=true;" type="radio" name="friendly_alias_urls" value="0" <?php echo ($friendly_alias_urls=='0' || !isset($friendly_alias_urls)) ? 'checked="checked"' : "" ; ?> />
  613. <?php echo $_lang["no"]?> </td>
  614. </tr>
  615. <tr id='furlRow8' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  616. <td width="200">&nbsp;</td>
  617. <td class='comment'><?php echo $_lang["friendly_alias_message"] ?></td>
  618. </tr>
  619. <tr id='furlRow9' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  620. <td colspan="2"><div class='split'></div></td>
  621. </tr>
  622. <tr id='furlRow10' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  623. <td nowrap class="warning" valign="top"><b><?php echo $_lang["use_alias_path_title"] ?></b></td>
  624. <td> <input onchange="documentDirty=true;" type="radio" name="use_alias_path" value="1" <?php echo $use_alias_path=='1' ? 'checked="checked"' : "" ; ?> />
  625. <?php echo $_lang["yes"]?><br />
  626. <input onchange="documentDirty=true;" type="radio" name="use_alias_path" value="0" <?php echo ($use_alias_path=='0' || !isset($use_alias_path)) ? 'checked="checked"' : "" ; ?> />
  627. <?php echo $_lang["no"]?> </td>
  628. </tr>
  629. <tr id='furlRow11' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  630. <td width="200">&nbsp;</td>
  631. <td class='comment'><?php echo $_lang["use_alias_path_message"] ?></td>
  632. </tr>
  633. <tr id='furlRow12' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  634. <td colspan="2"><div class='split'></div></td>
  635. </tr>
  636. <tr id='furlRow16' class='row2' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  637. <td nowrap class="warning" valign="top"><b><?php echo $_lang["duplicate_alias_title"] ?></b></td>
  638. <td> <input onchange="documentDirty=true;" type="radio" name="allow_duplicate_alias" value="1" <?php echo $allow_duplicate_alias=='1' ? 'checked="checked"' : "" ; ?> />
  639. <?php echo $_lang["yes"]?><br />
  640. <input onchange="documentDirty=true;" type="radio" name="allow_duplicate_alias" value="0" <?php echo ($allow_duplicate_alias=='0' || !isset($allow_duplicate_alias)) ? 'checked="checked"' : "" ; ?> />
  641. <?php echo $_lang["no"]?> </td>
  642. </tr>
  643. <tr id='furlRow17' class='row2' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  644. <td width="200">&nbsp;</td>
  645. <td class='comment'><?php echo $_lang["duplicate_alias_message"] ?></td>
  646. </tr>
  647. <tr id='furlRow18' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  648. <td colspan="2"><div class='split'></div></td>
  649. </tr>
  650. <tr id='furlRow13' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  651. <td nowrap class="warning" valign="top"><b><?php echo $_lang["automatic_alias_title"] ?></b></td>
  652. <td> <input onchange="documentDirty=true;" type="radio" name="automatic_alias" value="1" <?php echo $automatic_alias=='1' ? 'checked="checked"' : "" ; ?> />
  653. <?php echo $_lang["yes"]?><br />
  654. <input onchange="documentDirty=true;" type="radio" name="automatic_alias" value="0" <?php echo ($automatic_alias=='0' || !isset($automatic_alias)) ? 'checked="checked"' : "" ; ?> />
  655. <?php echo $_lang["no"]?> </td>
  656. </tr>
  657. <tr id='furlRow14' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  658. <td width="200">&nbsp;</td>
  659. <td class='comment'><?php echo $_lang["automatic_alias_message"] ?></td>
  660. </tr>
  661. <tr id='furlRow15' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  662. <td colspan="2"><div class='split'></div></td>
  663. </tr>
  664. <tr class='row1'>
  665. <td colspan="2">
  666. <?php
  667. // invoke OnFriendlyURLSettingsRender event
  668. $evtOut = $modx->invokeEvent("OnFriendlyURLSettingsRender");
  669. if(is_array($evtOut)) echo implode("",$evtOut);
  670. ?>
  671. </td>
  672. </tr>
  673. </table>
  674. </div>
  675. <!-- User settings -->
  676. <div class="tab-page" id="tabPage4">
  677. <h2 class="tab"><?php echo $_lang["settings_users"] ?></h2>
  678. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage4" ) );</script>
  679. <table border="0" cellspacing="0" cellpadding="3">
  680. <tr>
  681. <td nowrap class="warning"><b><?php echo $_lang["udperms_title"] ?></b></td>
  682. <td> <input onchange="documentDirty=true;" type="radio" name="use_udperms" value="1" <?php echo $use_udperms=='1' ? 'checked="checked"' : "" ; ?> onclick='showHide(/udPerms/, 1);' />
  683. <?php echo $_lang["yes"]?><br />
  684. <input onchange="documentDirty=true;" type="radio" name="use_udperms" value="0" <?php echo ($use_udperms=='0' || !isset($use_udperms)) ? 'checked="checked"' : "" ; ?> onclick='showHide(/udPerms/, 0);' />
  685. <?php echo $_lang["no"]?> </td>
  686. </tr>
  687. <tr>
  688. <td width="200">&nbsp;</td>
  689. <td class='comment'><?php echo $_lang["udperms_message"] ?></td>
  690. </tr>
  691. <tr>
  692. <td colspan="2"><div class='split'></div></td>
  693. </tr>
  694. <tr id='udPermsRow1' class='row1' style="display: <?php echo $use_udperms==1 ? $displayStyle : 'none' ; ?>">
  695. <td nowrap class="warning"><b><?php echo $_lang["udperms_allowroot_title"] ?></b></td>
  696. <td> <input onchange="documentDirty=true;" type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot=='1' ? 'checked="checked"' : "" ; ?> />
  697. <?php echo $_lang["yes"]?><br />
  698. <input onchange="documentDirty=true;" type="radio" name="udperms_allowroot" value="0" <?php echo ($udperms_allowroot=='0' || !isset($udperms_allowroot)) ? 'checked="checked"' : "" ; ?> />
  699. <?php echo $_lang["no"]?> </td>
  700. </tr>
  701. <tr id='udPermsRow2' class='row1' style="display: <?php echo $use_udperms==1 ? $displayStyle : 'none' ; ?>">
  702. <td width="200">&nbsp;</td>
  703. <td class='comment'><?php echo $_lang["udperms_allowroot_message"] ?></td>
  704. </tr>
  705. <tr id='udPermsRow3' style="display: <?php echo $use_udperms==1 ? $displayStyle : 'none' ; ?>">
  706. <td colspan="2"><div class='split'></div></td>
  707. </tr>
  708. <tr>
  709. <td nowrap class="warning"><b><?php echo $_lang["failed_login_title"] ?></b></td>
  710. <td><input type="text" name="failed_login_attempts" style="width:50px" value="<?php echo isset($failed_login_attempts) ? $failed_login_attempts : "3" ; ?>" /></td>
  711. </tr>
  712. <tr>
  713. <td width="200">&nbsp;</td>
  714. <td class='comment'><?php echo $_lang["failed_login_message"] ?></td>
  715. </tr>
  716. <tr>
  717. <td colspan="2"><div class='split'></div></td>
  718. </tr>
  719. <tr>
  720. <td nowrap class="warning"><b><?php echo $_lang["blocked_minutes_title"] ?></b></td>
  721. <td><input type="text" name="blocked_minutes" style="width:100px" value="<?php echo isset($blocked_minutes) ? $blocked_minutes : "60" ; ?>" /></td>
  722. </tr>
  723. <tr>
  724. <td width="200">&nbsp;</td>
  725. <td class='comment'><?php echo $_lang["blocked_minutes_message"] ?></td>
  726. </tr>
  727. <tr>
  728. <td colspan="2"><div class='split'></div></td>
  729. </tr>
  730. <?php
  731. // Check for GD before allowing captcha to be enabled
  732. $gdAvailable = extension_loaded('gd');
  733. ?>
  734. <tr>
  735. <td nowrap class="warning"><b><?php echo $_lang["captcha_title"] ?></b></td>
  736. <td> <input onchange="documentDirty=true;" type="radio" name="use_captcha" value="1" <?php echo ($use_captcha=='1' && $gdAvailable) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> />
  737. <?php echo $_lang["yes"]?><br />
  738. <input onchange="documentDirty=true;" type="radio" name="use_captcha" value="0" <?php echo ($use_captcha=='0' || !isset($use_captcha) || !$gdAvailable) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> />
  739. <?php echo $_lang["no"]?> </td>
  740. </tr>
  741. <tr>
  742. <td width="200">&nbsp;</td>
  743. <td class='comment'><?php echo $_lang["captcha_message"] ?></td>
  744. </tr>
  745. <tr>
  746. <td colspan="2"><div class='split'></div></td>
  747. </tr>
  748. <tr>
  749. <td nowrap class="warning"><b><?php echo $_lang["captcha_words_title"] ?></b>
  750. <br />
  751. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  752. <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');">
  753. <?php echo get_lang_options('captcha_words_default');?>
  754. </select>
  755. </td>
  756. <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo isset($captcha_words) ? $captcha_words : $_lang["captcha_words_default"] ; ?>" />
  757. <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang["captcha_words_default"]);?>" />
  758. </td>
  759. </tr>
  760. <tr>
  761. <td width="200">&nbsp;</td>
  762. <td class='comment'><?php echo $_lang["captcha_words_message"] ?></td>
  763. </tr>
  764. <tr>
  765. <td colspan="2"><div class='split'></div></td>
  766. </tr>
  767. <tr>
  768. <td nowrap class="warning"><b><?php echo $_lang["emailsender_title"] ?></b></td>
  769. <td ><input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="emailsender" value="<?php echo isset($emailsender) ? $emailsender : "you@example.com" ; ?>" /></td>
  770. </tr>
  771. <tr>
  772. <td width="200">&nbsp;</td>
  773. <td class='comment'><?php echo $_lang["emailsender_message"] ?></td>
  774. </tr>
  775. <tr>
  776. <td colspan="2"><div class='split'></div></td>
  777. </tr>
  778. <tr>
  779. <td nowrap class="warning"><b><?php echo $_lang["emailsubject_title"] ?></b>
  780. <br />
  781. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  782. <select name="reload_emailsubject" id="reload_emailsubject_select" onchange="confirmLangChange(this, 'emailsubject_default', 'emailsubject_field');">
  783. <?php echo get_lang_options('emailsubject_default');?>
  784. </select>
  785. </td>
  786. <td ><input id="emailsubject_field" name="emailsubject" onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" value="<?php echo isset($emailsubject) ? $emailsubject : $_lang["emailsubject_default"] ; ?>" />
  787. <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']);?>" />
  788. </td>
  789. </tr>
  790. <tr>
  791. <td width="200">&nbsp;</td>
  792. <td class='comment'><?php echo $_lang["emailsubject_message"] ?></td>
  793. </tr>
  794. <tr>
  795. <td colspan="2"><div class='split'></div></td>
  796. </tr>
  797. <tr>
  798. <td nowrap class="warning" valign="top"><b><?php echo $_lang["signupemail_title"] ?></b>
  799. <br />
  800. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  801. <select name="reload_signupemail_message" id="reload_signupemail_message_select" onchange="confirmLangChange(this, 'system_email_signup', 'signupemail_message_textarea');">
  802. <?php echo get_lang_options('system_email_signup');?>
  803. </select>
  804. </td>
  805. <td> <textarea id="signupemail_message_textarea" name="signupemail_message" style="width:100%; height: 120px;"><?php echo isset($signupemail_message) ? $signupemail_message : $_lang["system_email_signup"] ?></textarea>
  806. <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']);?>" />
  807. </td>
  808. </tr>
  809. <tr>
  810. <td width="200">&nbsp;</td>
  811. <td class='comment'><?php echo $_lang["signupemail_message"] ?></td>
  812. </tr>
  813. <tr>
  814. <td colspan="2"><div class='split'></div></td>
  815. </tr>
  816. <tr>
  817. <td nowrap class="warning" valign="top"><b><?php echo $_lang["websignupemail_title"] ?></b>
  818. <br />
  819. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  820. <select name="reload_websignupemail_message" id="reload_websignupemail_message_select" onchange="confirmLangChange(this, 'system_email_websignup', 'websignupemail_message_textarea');">
  821. <?php echo get_lang_options('system_email_websignup');?>
  822. </select>
  823. </td>
  824. <td> <textarea id="websignupemail_message_textarea" name="websignupemail_message" style="width:100%; height: 120px;"><?php echo isset($websignupemail_message) ? $websignupemail_message : $_lang["system_email_websignup"] ?></textarea>
  825. <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']);?>" />
  826. </td>
  827. </tr>
  828. <tr>
  829. <td width="200">&nbsp;</td>
  830. <td class='comment'><?php echo $_lang["websignupemail_message"] ?></td>
  831. </tr>
  832. <tr>
  833. <td colspan="2"><div class='split'></div></td>
  834. </tr>
  835. <tr>
  836. <td nowrap class="warning" valign="top"><b><?php echo $_lang["webpwdreminder_title"] ?></b>
  837. <br />
  838. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  839. <select name="reload_system_email_webreminder_message" id="reload_system_email_webreminder_select" onchange="confirmLangChange(this, 'system_email_webreminder', 'system_email_webreminder_textarea');">
  840. <?php echo get_lang_options('system_email_webreminder');?>
  841. </select>
  842. </td>
  843. <td> <textarea id="system_email_webreminder_textarea" name="webpwdreminder_message" style="width:100%; height: 120px;"><?php echo isset($webpwdreminder_message) ? $webpwdreminder_message : $_lang["system_email_webreminder"]; ?></textarea>
  844. <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']);?>" />
  845. </td>
  846. </tr>
  847. <tr>
  848. <td width="200">&nbsp;</td>
  849. <td class='comment'><?php echo $_lang["webpwdreminder_message"] ?></td>
  850. </tr>
  851. <tr class='row1'>
  852. <td colspan="2">
  853. <?php
  854. // invoke OnUserSettingsRender event
  855. $evtOut = $modx->invokeEvent("OnUserSettingsRender");
  856. if(is_array($evtOut)) echo implode("",$evtOut);
  857. ?>
  858. </td>
  859. </tr>
  860. </table>
  861. </div>
  862. <!-- Interface & editor settings -->
  863. <div class="tab-page" id="tabPage5">
  864. <h2 class="tab"><?php echo $_lang["settings_ui"] ?></h2>
  865. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage5" ) );</script>
  866. <table border="0" cellspacing="0" cellpadding="3">
  867. <tr>
  868. <td nowrap class="warning"><b><?php echo $_lang["manager_theme"]?></b></td>
  869. <td> <select name="manager_theme" size="1" class="inputBox" onchange="documentDirty=true;document.forms['settings'].theme_refresher.value = Date.parse(new Date())">
  870. <?php
  871. $dir = dir("media/style/");
  872. while ($file = $dir->read()) {
  873. if($file!="." && $file!=".." && is_dir("media/style/$file") && substr($file,0,1) != '.') {
  874. $themename = $file;
  875. $selectedtext = $themename==$manager_theme ? "selected='selected'" : "" ;
  876. echo "<option value='$themename' $selectedtext>".ucwords(str_replace("_", " ", $themename))."</option>";
  877. }
  878. }
  879. $dir->close();
  880. ?>
  881. </select><input type="hidden" name="theme_refresher" value="" /></td>
  882. </tr>
  883. <tr>
  884. <td width="200">&nbsp;</td>
  885. <td class='comment'><?php echo $_lang["manager_theme_message"]?></td>
  886. </tr>
  887. <tr>
  888. <td colspan="2"><div class='split'></div></td>
  889. </tr>
  890. <tr>
  891. <td nowrap class="warning"><b><?php echo $_lang["warning_visibility"] ?></b></td>
  892. <td> <input onchange="documentDirty=true;" type="radio" name="warning_visibility" value="0" <?php echo $warning_visibility=='0' ? 'checked="checked"' : ""; ?> />
  893. <?php echo $_lang["administrators"]?><br />
  894. <input onchange="documentDirty=true;" type="radio" name="warning_visibility" value="1" <?php echo (!isset($warning_visibility) || $warning_visibility=='1') ? 'checked="checked"' : ""; ?> />
  895. <?php echo $_lang["everybody"]?></td>
  896. </tr>
  897. <tr>
  898. <td width="200">&nbsp;</td>
  899. <td class='comment'><?php echo $_lang["warning_visibility_message"]?></td>
  900. </tr>
  901. <tr>
  902. <td colspan="2"><div class='split'></div></td>
  903. </tr>
  904. <tr>
  905. <td nowrap class="warning"><b><?php echo $_lang["tree_page_click"] ?></b></td>
  906. <td> <input onchange="documentDirty=true;" type="radio" name="tree_page_click" value="27" <?php echo ($tree_page_click=='27' || !isset($tree_page_click)) ? 'checked="checked"' : ""; ?> />
  907. <?php echo $_lang["edit_resource"]?><br />
  908. <input onchange="documentDirty=true;" type="radio" name="tree_page_click" value="3" <?php echo ($tree_page_click=='3') ? 'checked="checked"' : ""; ?> />
  909. <?php echo $_lang["doc_data_title"]?></td>
  910. </tr>
  911. <tr>
  912. <td width="200">&nbsp;</td>
  913. <td class='comment'><?php echo $_lang["tree_page_click_message"]?></td>
  914. </tr>
  915. <tr>
  916. <td colspan="2"><div class='split'></div></td>
  917. </tr>
  918. <?php
  919. $remember_last_tab_checked2 = '';
  920. $remember_last_tab_checked1 = '';
  921. $remember_last_tab_checked0 = '';
  922. switch($remember_last_tab)
  923. {
  924. case '2':
  925. $remember_last_tab_checked2 = 'checked="checked"';
  926. break;
  927. case '1':
  928. $remember_last_tab_checked1 = 'checked="checked"';
  929. break;
  930. default:
  931. $remember_last_tab_checked0 = 'checked="checked"';
  932. }
  933. ?>
  934. <tr>
  935. <td nowrap class="warning"><b><?php echo $_lang["remember_last_tab"] ?></b></td>
  936. <td> <input onchange="documentDirty=true;" type="radio" name="remember_last_tab" value="2" <?php echo $remember_last_tab_checked2; ?> />
  937. <?php echo $_lang["yes"]?> (Full)<br />
  938. <input onchange="documentDirty=true;" type="radio" name="remember_last_tab" value="1" <?php echo $remember_last_tab_checked1; ?> />
  939. <?php echo $_lang["yes"]?> (Stay mode)<br />
  940. <input onchange="documentDirty=true;" type="radio" name="remember_last_tab" value="0" <?php echo $remember_last_tab_checked0; ?> />
  941. <?php echo $_lang["no"]?></td>
  942. </tr>
  943. <tr>
  944. <td width="200">&nbsp;</td>
  945. <td class='comment'><?php echo $_lang["remember_last_tab_message"]?></td>
  946. </tr>
  947. <tr>
  948. <td colspan="2"><div class='split'></div></td>
  949. </tr>
  950. <tr>
  951. <td nowrap class="warning"><b><?php echo $_lang["tree_show_protected"] ?></b></td>
  952. <td> <input onchange="documentDirty=true;" type="radio" name="tree_show_protected" value="1" <?php echo (!isset($tree_show_protected) || $tree_show_protected=='0') ? '' : 'checked="checked" '; ?>/>
  953. <?php echo $_lang["yes"]?><br />
  954. <input onchange="documentDirty=true;" type="radio" name="tree_show_protected" value="0" <?php echo (!isset($tree_show_protected) || $tree_show_protected=='0') ? 'checked="checked" ' : ''; ?>/>
  955. <?php echo $_lang["no"]?></td>
  956. </tr>
  957. <tr>
  958. <td width="200">&nbsp;</td>
  959. <td class='comment'><?php echo $_lang["tree_show_protected_message"]?></td>
  960. </tr>
  961. <tr>
  962. <td colspan="2"><div class='split'></div></td>
  963. </tr>
  964. <tr>
  965. <td nowrap class="warning"><b><?php echo $_lang["show_meta"] ?></b></td>
  966. <td> <input onchange="documentDirty=true;" type="radio" name="show_meta" value="1" <?php echo $show_meta=='1' ? 'checked="checked"' : ""; ?> />
  967. <?php echo $_lang["yes"]?><br />
  968. <input onchange="documentDirty=true;" type="radio" name="show_meta" value="0" <?php echo ($show_meta=='0' || !isset($show_meta)) ? 'checked="checked"' : ""; ?> />
  969. <?php echo $_lang["no"]?></td>
  970. </tr>
  971. <tr>
  972. <td width="200">&nbsp;</td>
  973. <td class='comment'><?php echo $_lang["show_meta_message"]?></td>
  974. </tr>
  975. <tr>
  976. <td colspan="2"><div class='split'></div></td>
  977. </tr>
  978. <tr>
  979. <td nowrap class="warning"><b><?php echo $_lang["datepicker_offset"] ?></b></td>
  980. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="datepicker_offset" value="<?php echo isset($datepicker_offset) ? $datepicker_offset : '-10' ; ?>" /></td>
  981. </tr>
  982. <tr>
  983. <td width="200">&nbsp;</td>
  984. <td class='comment'><?php echo $_lang["datepicker_offset_message"]?></td>
  985. </tr>
  986. <tr>
  987. <td colspan="2"><div class='split'></div></td>
  988. </tr>
  989. <tr>
  990. <td nowrap class="warning"><b><?php echo $_lang["datetime_format"]?></b></td>
  991. <td> <select name="datetime_format" size="1" class="inputBox">
  992. <?php
  993. $datetime_format_list = array('dd-mm-YYYY', 'mm/dd/YYYY', 'YYYY/mm/dd');
  994. $str = '';
  995. foreach($datetime_format_list as $value)
  996. {
  997. $selectedtext = ($datetime_format == $value) ? ' selected' : '';
  998. $str .= '<option value="' . $value . '"' . $selectedtext . '>';
  999. $str .= $value . '</option>' . PHP_EOL;
  1000. }
  1001. echo $str;
  1002. ?>
  1003. </select></td>
  1004. </tr>
  1005. <tr>
  1006. <td width="200">&nbsp;</td>
  1007. <td class='comment'><?php echo $_lang["datetime_format_message"]?></td>
  1008. </tr>
  1009. <tr>
  1010. <td colspan="2"><div class='split'></div></td>
  1011. </tr>
  1012. <tr>
  1013. <td nowrap class="warning"><b><?php echo $_lang["nologentries_title"]?></b></td>
  1014. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="number_of_logs" value="<?php echo isset($number_of_logs) ? $number_of_logs : 100 ; ?>" /></td>
  1015. </tr>
  1016. <tr>
  1017. <td width="200">&nbsp;</td>
  1018. <td class='comment'><?php echo $_lang["nologentries_message"]?></td>
  1019. </tr>
  1020. <tr>
  1021. <td colspan="2"><div class='split'></div></td>
  1022. </tr>
  1023. <tr>
  1024. <td nowrap class="warning"><b><?php echo $_lang["mail_check_timeperiod_title"] ?></b></td>
  1025. <td><input type="text" name="mail_check_timeperiod" onchange="documentDirty=true;" size="5" value="<?php echo isset($mail_check_timeperiod) ? $mail_check_timeperiod : "60" ; ?>" /></td>
  1026. </tr>
  1027. <tr>
  1028. <td width="200">&nbsp;</td>
  1029. <td class='comment'><?php echo $_lang["mail_check_timeperiod_message"] ?></td>
  1030. </tr>
  1031. <tr>
  1032. <td colspan="2"><div class='split'></div></td>
  1033. </tr>
  1034. <tr>
  1035. <td nowrap class="warning"><b><?php echo $_lang["nomessages_title"]?></b></td>
  1036. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="number_of_messages" value="<?php echo isset($number_of_messages) ? $number_of_messages : 30 ; ?>" /></td>
  1037. </tr>
  1038. <tr>
  1039. <td width="200">&nbsp;</td>
  1040. <td class='comment'><?php echo $_lang["nomessages_message"]?></td>
  1041. </tr>
  1042. <tr>
  1043. <td colspan="2"><div class='split'></div></td>
  1044. </tr>
  1045. <tr>
  1046. <td nowrap class="warning"><b><?php echo $_lang["noresults_title"]?></b></td>
  1047. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="number_of_results" value="<?php echo isset($number_of_results) ? $number_of_results : 30 ; ?>" /></td>
  1048. </tr>
  1049. <tr>
  1050. <td width="200">&nbsp;</td>
  1051. <td class='comment'><?php echo $_lang["noresults_message"]?></td>
  1052. </tr>
  1053. <tr>
  1054. <td colspan="2"><div class='split'></div></td>
  1055. </tr>
  1056. <tr>
  1057. <td nowrap class="warning"><b><?php echo $_lang["rb_title"]?></b></td>
  1058. <td> <input onchange="documentDirty=true;" type="radio" name="use_browser" value="1" <?php echo ($use_browser=='1' || !isset($use_browser)) ? 'checked="checked"' : "" ; ?> onclick="showHide(/rbRow/, 1);" />
  1059. <?php echo $_lang["yes"]?><br />
  1060. <input onchange="documentDirty=true;" type="radio" name="use_browser" value="0" <?php echo $use_browser=='0' ? 'checked="checked"' : "" ; ?> onclick="showHide(/rbRow/, 0);" />
  1061. <?php echo $_lang["no"]?> </td>
  1062. </tr>
  1063. <tr>
  1064. <td width="200">&nbsp;</td>
  1065. <td class='comment'><?php echo $_lang["rb_message"]?></td>
  1066. </tr>
  1067. <tr>
  1068. <td colspan="2"><div class='split'></div></td>
  1069. </tr>
  1070. <tr id='rbRow19' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1071. <td nowrap class="warning"><b><?php echo $_lang["settings_strip_image_paths_title"]?></b></td>
  1072. <td><input onchange="documentDirty=true;" type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths=='1' ? 'checked="checked"' : "" ; ?> />
  1073. <?php echo $_lang["yes"]?><br />
  1074. <input onchange="documentDirty=true;" type="radio" name="strip_image_paths" value="0" <?php echo ($strip_image_paths=='0' || !isset($strip_image_paths)) ? 'checked="checked"' : "" ; ?> />
  1075. <?php echo $_lang["no"]?> </td>
  1076. </tr>
  1077. <tr id='rbRow20' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1078. <td width="200">&nbsp;</td>
  1079. <td class='comment'><?php echo $_lang["settings_strip_image_paths_message"]?></td>
  1080. </tr>
  1081. <tr id='rbRow21' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1082. <td colspan="2"><div class='split'></div></td>
  1083. </tr>
  1084. <?php if(!isset($use_browser)) $use_browser=1; ?>
  1085. <tr id='rbRow1' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1086. <td nowrap class="warning"><b><?php echo $_lang["rb_webuser_title"]?></b></td>
  1087. <td><input onchange="documentDirty=true;" type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser=='1' ? 'checked="checked"' : "" ; ?> />
  1088. <?php echo $_lang["yes"]?><br />
  1089. <input onchange="documentDirty=true;" type="radio" name="rb_webuser" value="0" <?php echo ($rb_webuser=='0' || !isset($rb_webuser)) ? 'checked="checked"' : "" ; ?> />
  1090. <?php echo $_lang["no"]?> </td>
  1091. </tr>
  1092. <tr id='rbRow2' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1093. <td width="200">&nbsp;</td>
  1094. <td class="comment"><?php echo $_lang["rb_webuser_message"]?></td>
  1095. </tr>
  1096. <tr id='rbRow3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1097. <td colspan="2"><div class='split'></div></td>
  1098. </tr>
  1099. <tr id='rbRow4' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1100. <td nowrap class="warning"><b><?php echo $_lang["rb_base_dir_title"]?></b></td>
  1101. <td><?php
  1102. function getResourceBaseDir() {
  1103. global $base_path;
  1104. return $base_path."assets/";
  1105. }
  1106. ?>
  1107. <?php echo $_lang['default']; ?> <span id="default_rb_base_dir"><?php echo getResourceBaseDir()?></span><br />
  1108. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="rb_base_dir" id="rb_base_dir" value="<?php echo isset($rb_base_dir) ? $rb_base_dir : getResourceBaseDir() ; ?>" /> <input type="button" onclick="reset_path('rb_base_dir');" value="<?php echo $_lang["reset"]; ?>" name="reset_rb_base_dir">
  1109. </td>
  1110. </tr>
  1111. <tr id='rbRow5' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1112. <td width="200">&nbsp;</td>
  1113. <td class='comment'><?php echo $_lang["rb_base_dir_message"]?></td>
  1114. </tr>
  1115. <tr id='rbRow6' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1116. <td colspan="2"><div class='split'></div></td>
  1117. </tr>
  1118. <tr id='rbRow7' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1119. <td nowrap class="warning"><b><?php echo $_lang["rb_base_url_title"]?></b></td>
  1120. <td> <?php
  1121. function getResourceBaseUrl() {
  1122. global $site_url;
  1123. return $site_url . "assets/";
  1124. }
  1125. ?>
  1126. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="rb_base_url" value="<?php echo isset($rb_base_url) ? $rb_base_url : getResourceBaseUrl() ; ?>" />
  1127. </td>
  1128. </tr>
  1129. <tr id='rbRow8' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1130. <td width="200">&nbsp;</td>
  1131. <td class='comment'><?php echo $_lang["rb_base_url_message"]?></td>
  1132. </tr>
  1133. <tr id='rbRow9' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1134. <td colspan="2"><div class='split'></div></td>
  1135. </tr>
  1136. <tr id='rbRow10' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1137. <td nowrap class="warning"><b><?php echo $_lang["uploadable_images_title"]?></b></td>
  1138. <td>
  1139. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_images" value="<?php echo isset($upload_images) ? $upload_images : "jpg,gif,png,ico,bmp,psd" ; ?>" />
  1140. </td>
  1141. </tr>
  1142. <tr id='rbRow11' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1143. <td width="200">&nbsp;</td>
  1144. <td class='comment'><?php echo $_lang["uploadable_images_message"]?></td>
  1145. </tr>
  1146. <tr id='rbRow12' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1147. <td colspan="2"><div class='split'></div></td>
  1148. </tr>
  1149. <tr id='rbRow13' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1150. <td nowrap class="warning"><b><?php echo $_lang["uploadable_media_title"]?></b></td>
  1151. <td>
  1152. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_media" value="<?php echo isset($upload_media) ? $upload_media : "mp3,wav,au,wmv,avi,mpg,mpeg" ; ?>" />
  1153. </td>
  1154. </tr>
  1155. <tr id='rbRow14' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1156. <td width="200">&nbsp;</td>
  1157. <td class='comment'><?php echo $_lang["uploadable_media_message"]?></td>
  1158. </tr>
  1159. <tr id='rbRow15' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1160. <td colspan="2"><div class='split'></div></td>
  1161. </tr>
  1162. <tr id='rbRow16' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1163. <td nowrap class="warning"><b><?php echo $_lang["uploadable_flash_title"]?></b></td>
  1164. <td>
  1165. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_flash" value="<?php echo isset($upload_flash) ? $upload_flash : "swf,fla" ; ?>" />
  1166. </td>
  1167. </tr>
  1168. <tr id='rbRow17' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1169. <td width="200">&nbsp;</td>
  1170. <td class='comment'><?php echo $_lang["uploadable_flash_message"]?></td>
  1171. </tr>
  1172. <tr id='rbRow171' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1173. <td colspan="2"><div class='split'></div></td>
  1174. </tr>
  1175. <tr id='rbRow172' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1176. <td nowrap class="warning"><b><?php echo $_lang["clean_uploaded_filename"]?></b></td>
  1177. <td> <input onchange="documentDirty=true;" type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename=='1' ? 'checked="checked"' : "" ; ?> />
  1178. <?php echo $_lang["yes"]?><br />
  1179. <input onchange="documentDirty=true;" type="radio" name="clean_uploaded_filename" value="0" <?php echo ($clean_uploaded_filename=='0' || !isset($clean_uploaded_filename)) ? 'checked="checked"' : "" ; ?> />
  1180. <?php echo $_lang["no"]?> </td>
  1181. </tr>
  1182. <tr id='rbRow17' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1183. <td width="200">&nbsp;</td>
  1184. <td class='comment'><?php echo $_lang["clean_uploaded_filename_message"];?></td>
  1185. </tr>
  1186. <tr id='rbRow18' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1187. <td colspan="2"><div class='split'></div></td>
  1188. </tr>
  1189. <tr>
  1190. <td nowrap class="warning"><b><?php echo $_lang["use_editor_title"]?></b></td>
  1191. <td> <input onchange="documentDirty=true;" type="radio" name="use_editor" value="1" <?php echo ($use_editor=='1' || !isset($use_editor)) ? 'checked="checked"' : "" ; ?> onclick="showHide(/editorRow/, 1); checkCustomIcons();" />
  1192. <?php echo $_lang["yes"]?><br />
  1193. <input onchange="documentDirty=true;" type="radio" name="use_editor" value="0" <?php echo $use_editor=='0' ? 'checked="checked"' : "" ; ?> onclick="showHide(/editorRow/, 0);" />
  1194. <?php echo $_lang["no"]?> </td>
  1195. </tr>
  1196. <tr>
  1197. <td width="200">&nbsp;</td>
  1198. <td class='comment'><?php echo $_lang["use_editor_message"]?></td>
  1199. </tr>
  1200. <tr>
  1201. <td colspan="2"><div class='split'></div></td>
  1202. </tr>
  1203. <?php if(!isset($use_editor)) $use_editor=1; ?>
  1204. <tr id='editorRow0' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1205. <td nowrap class="warning"><b><?php echo $_lang["which_editor_title"]?></b></td>
  1206. <td>
  1207. <select name="which_editor" onchange="documentDirty=true;">
  1208. <?php
  1209. // invoke OnRichTextEditorRegister event
  1210. $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
  1211. echo "<option value='none'".($which_editor=='none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n";
  1212. if(is_array($evtOut)) for($i=0;$i<count($evtOut);$i++) {
  1213. $editor = $evtOut[$i];
  1214. echo "<option value='$editor'".($which_editor==$editor ? " selected='selected'" : "").">$editor</option>\n";
  1215. }
  1216. ?>
  1217. </select>
  1218. </td>
  1219. </tr>
  1220. <tr id='editorRow1' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1221. <td width="200">&nbsp;</td>
  1222. <td class='comment'><?php echo $_lang["which_editor_message"]?></td>
  1223. </tr>
  1224. <tr id='editorRow3' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1225. <td colspan="2"><div class='split'></div></td>
  1226. </tr>
  1227. <tr id='editorRow4' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1228. <td nowrap class="warning"><b><?php echo $_lang["fe_editor_lang_title"]?></b></td>
  1229. <td> <select name="fe_editor_lang" size="1" class="inputBox" onchange="documentDirty=true;">
  1230. <?php echo get_lang_options(null, $fe_editor_lang);?>
  1231. </select> </td>
  1232. </tr>
  1233. <tr id='editorRow5' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1234. <td width="200">&nbsp;</td>
  1235. <td class='comment'><?php echo $_lang["fe_editor_lang_message"]?></td>
  1236. </tr>
  1237. <tr id='editorRow2' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1238. <td colspan="2"><div class='split'></div></td>
  1239. </tr>
  1240. <tr id='editorRow14' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1241. <td nowrap class="warning"><b><?php echo $_lang["editor_css_path_title"]?></b></td>
  1242. <td><input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="editor_css_path" value="<?php echo isset($editor_css_path) ? $editor_css_path : "" ; ?>" />
  1243. </td>
  1244. </tr>
  1245. <tr id='editorRow15' class='row3' style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1246. <td width="200">&nbsp;</td>
  1247. <td class='comment'><?php echo $_lang["editor_css_path_message"]?></td>
  1248. </tr>
  1249. <tr id='editorRow16' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1250. <td colspan="2"><div class='split'></div></td>
  1251. </tr>
  1252. <tr class='row1'>
  1253. <td colspan="2">
  1254. <?php
  1255. // invoke OnInterfaceSettingsRender event
  1256. $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
  1257. if(is_array($evtOut)) echo implode("",$evtOut);
  1258. ?>
  1259. </td>
  1260. </tr>
  1261. </table>
  1262. </div>
  1263. <!-- Miscellaneous settings -->
  1264. <div class="tab-page" id="tabPage7">
  1265. <h2 class="tab"><?php echo $_lang["settings_misc"] ?></h2>
  1266. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage7" ) );</script>
  1267. <table border="0" cellspacing="0" cellpadding="3">
  1268. <tr>
  1269. <td nowrap class="warning"><b><?php echo $_lang["filemanager_path_title"]?></b></td>
  1270. <td>
  1271. <?php echo $_lang['default']; ?> <span id="default_filemanager_path"><?php echo $base_path; ?></span><br />
  1272. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="filemanager_path" id="filemanager_path" value="<?php echo isset($filemanager_path) ? $filemanager_path : $base_path; ?>" /> <input type="button" onclick="reset_path('filemanager_path');" value="<?php echo $_lang["reset"]; ?>" name="reset_filemanager_path">
  1273. </td>
  1274. </tr>
  1275. <tr>
  1276. <td width="200">&nbsp;</td>
  1277. <td class='comment'><?php echo $_lang["filemanager_path_message"]?></td>
  1278. </tr>
  1279. <tr>
  1280. <td colspan="2"><div class='split'></div></td>
  1281. </tr>
  1282. <tr>
  1283. <td nowrap class="warning"><b><?php echo $_lang["uploadable_files_title"]?></b></td>
  1284. <td>
  1285. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_files" value="<?php echo isset($upload_files) ? $upload_files : "txt,php,html,htm,xml,js,css,cache,zip,gz,rar,z,tgz,tar,htaccess,pdf" ; ?>" />
  1286. </td>
  1287. </tr>
  1288. <tr>
  1289. <td width="200">&nbsp;</td>
  1290. <td class='comment'><?php echo $_lang["uploadable_files_message"]?></td>
  1291. </tr>
  1292. <tr>
  1293. <td colspan="2"><div class='split'></div></td>
  1294. </tr>
  1295. <tr>
  1296. <td nowrap class="warning"><b><?php echo $_lang["upload_maxsize_title"]?></b></td>
  1297. <td>
  1298. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_maxsize" value="<?php echo isset($upload_maxsize) ? $upload_maxsize : "1048576" ; ?>" />
  1299. </td>
  1300. </tr>
  1301. <tr>
  1302. <td width="200">&nbsp;</td>
  1303. <td class='comment'><?php echo $_lang["upload_maxsize_message"]?></td>
  1304. </tr>
  1305. <tr>
  1306. <td colspan="2"><div class='split'></div></td>
  1307. </tr>
  1308. <tr>
  1309. <td nowrap class="warning"><b><?php echo $_lang["new_file_permissions_title"]?></b></td>
  1310. <td>
  1311. <input onchange="documentDirty=true;" type='text' maxlength='4' style="width: 50px;" name="new_file_permissions" value="<?php echo isset($new_file_permissions) ? $new_file_permissions : "0644" ; ?>" />
  1312. </td>
  1313. </tr>
  1314. <tr>
  1315. <td width="200">&nbsp;</td>
  1316. <td class='comment'><?php echo $_lang["new_file_permissions_message"]?></td>
  1317. </tr>
  1318. <tr>
  1319. <td colspan="2"><div class='split'></div></td>
  1320. </tr>
  1321. <tr>
  1322. <td nowrap class="warning"><b><?php echo $_lang["new_folder_permissions_title"]?></b></td>
  1323. <td>
  1324. <input onchange="documentDirty=true;" type='text' maxlength='4' style="width: 50px;" name="new_folder_permissions" value="<?php echo isset($new_folder_permissions) ? $new_folder_permissions : "0755" ; ?>" />
  1325. </td>
  1326. </tr>
  1327. <tr>
  1328. <td width="200">&nbsp;</td>
  1329. <td class='comment'><?php echo $_lang["new_folder_permissions_message"]?></td>
  1330. </tr>
  1331. <tr>
  1332. <td colspan="2"><div class='split'></div></td>
  1333. <tr class='row1'>
  1334. <td colspan="2">
  1335. <?php
  1336. // invoke OnMiscSettingsRender event
  1337. $evtOut = $modx->invokeEvent("OnMiscSettingsRender");
  1338. if(is_array($evtOut)) echo implode("",$evtOut);
  1339. ?>
  1340. </td>
  1341. </tr>
  1342. </table>
  1343. </div>
  1344. </div>
  1345. </div>
  1346. </form>
  1347. <?php
  1348. /**
  1349. * get_lang_keys
  1350. *
  1351. * @return array of keys from a language file
  1352. */
  1353. function get_lang_keys($filename) {
  1354. $file = MODX_MANAGER_PATH.'includes/lang' . DIRECTORY_SEPARATOR . $filename;
  1355. if(is_file($file) && is_readable($file)) {
  1356. include($file);
  1357. return array_keys($_lang);
  1358. } else {
  1359. return array();
  1360. }
  1361. }
  1362. /**
  1363. * get_langs_by_key
  1364. *
  1365. * @return array of languages that define the key in their file
  1366. */
  1367. function get_langs_by_key($key) {
  1368. global $lang_keys;
  1369. $lang_return = array();
  1370. foreach($lang_keys as $lang=>$keys) {
  1371. if(in_array($key, $keys)) {
  1372. $lang_return[] = $lang;
  1373. }
  1374. }
  1375. return $lang_return;
  1376. }
  1377. /**
  1378. * get_lang_options
  1379. *
  1380. * returns html option list of languages
  1381. *
  1382. * @param string $key specify language key to return options of langauges that override it, default return all languages
  1383. * @param string $selected_lang specify language to select in option list, default none
  1384. * @return html option list
  1385. */
  1386. function get_lang_options($key=null, $selected_lang=null) {
  1387. global $lang_keys, $_lang;
  1388. $lang_options = '';
  1389. if($key) {
  1390. $languages = get_langs_by_key($key);
  1391. sort($languages);
  1392. $lang_options .= '<option value="">'.$_lang['language_title'].'</option>';
  1393. foreach($languages as $language_name) {
  1394. $uclanguage_name = ucwords(str_replace("_", " ", $language_name));
  1395. $lang_options .= '<option value="'.$language_name.'">'.$uclanguage_name.'</option>';
  1396. }
  1397. return $lang_options;
  1398. } else {
  1399. $languages = array_keys($lang_keys);
  1400. sort($languages);
  1401. foreach($languages as $language_name) {
  1402. $uclanguage_name = ucwords(str_replace("_", " ", $language_name));
  1403. $sel = $language_name == $selected_lang ? ' selected="selected"' : '';
  1404. $lang_options .= '<option value="'.$language_name.'" '.$sel.'>'.$uclanguage_name.'</option>';
  1405. }
  1406. return $lang_options;
  1407. }
  1408. }
  1409. ?>