PageRenderTime 49ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 1ms

/manager/actions/mutate_settings.dynamic.php

https://github.com/garryn/evolution
PHP | 1397 lines | 1323 code | 35 blank | 39 comment | 92 complexity | 43b7aa56b548d78a6b73aafefe10cfb9 MD5 | raw file
  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']=='mz') || ($_SESSION['browser']=='op') || ($_SESSION['browser']=='sf') ) ? "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. $validate_referrer_off_val = $modx->db->getValue('SELECT setting_value FROM '.$modx->getFullTableName('system_settings').' WHERE setting_name=\'validate_referer\'');
  46. $validate_referrer_off_val = $validate_referrer_off_val === '00' ? '00' : '0'; // storing the double zero is a trick to hide the warning message from the manager
  47. /* check the file paths */
  48. $settings['filemanager_path'] = $filemanager_path = trim($settings['filemanager_path']) == '' ? MODX_BASE_PATH : $settings['filemanager_path'];
  49. $settings['rb_base_dir'] = $rb_base_dir = trim($settings['rb_base_dir']) == '' ? MODX_BASE_PATH.'assets/' : $settings['rb_base_dir'];
  50. $settings['rb_base_url'] = $rb_base_url = trim($settings['rb_base_url']) == '' ? 'assets/' : $settings['rb_base_url'];
  51. ?>
  52. <script type="text/javascript">
  53. function checkIM() {
  54. im_on = document.settings.im_plugin[0].checked; // check if im_plugin is on
  55. if(im_on==true) {
  56. showHide(/imRow/, 1);
  57. }
  58. };
  59. function checkCustomIcons() {
  60. if(document.settings.editor_toolbar.selectedIndex!=3) {
  61. showHide(/custom/,0);
  62. }
  63. };
  64. function showHide(what, onoff){
  65. var all = document.getElementsByTagName( "*" );
  66. var l = all.length;
  67. var buttonRe = what;
  68. var id, el, stylevar;
  69. if(onoff==1) {
  70. stylevar = "<?php echo $displayStyle; ?>";
  71. } else {
  72. stylevar = "none";
  73. }
  74. for ( var i = 0; i < l; i++ ) {
  75. el = all[i]
  76. id = el.id;
  77. if ( id == "" ) continue;
  78. if (buttonRe.test(id)) {
  79. el.style.display = stylevar;
  80. }
  81. }
  82. };
  83. function addContentType(){
  84. var i,o,exists=false;
  85. var txt = document.settings.txt_custom_contenttype;
  86. var lst = document.settings.lst_custom_contenttype;
  87. for(i=0;i<lst.options.length;i++)
  88. {
  89. if(lst.options[i].value==txt.value) {
  90. exists=true;
  91. break;
  92. }
  93. }
  94. if (!exists) {
  95. o = new Option(txt.value,txt.value);
  96. lst.options[lst.options.length]= o;
  97. updateContentType();
  98. }
  99. txt.value='';
  100. }
  101. function removeContentType(){
  102. var i;
  103. var lst = document.settings.lst_custom_contenttype;
  104. for(i=0;i<lst.options.length;i++) {
  105. if(lst.options[i].selected) {
  106. lst.remove(i);
  107. break;
  108. }
  109. }
  110. updateContentType();
  111. }
  112. function updateContentType(){
  113. var i,o,ol=[];
  114. var lst = document.settings.lst_custom_contenttype;
  115. var ct = document.settings.custom_contenttype;
  116. while(lst.options.length) {
  117. ol[ol.length] = lst.options[0].value;
  118. lst.options[0]= null;
  119. }
  120. if(ol.sort) ol.sort();
  121. ct.value = ol.join(",");
  122. for(i=0;i<ol.length;i++) {
  123. o = new Option(ol[i],ol[i]);
  124. lst.options[lst.options.length]= o;
  125. }
  126. documentDirty = true;
  127. }
  128. /**
  129. * @param element el were language selection comes from
  130. * @param string lkey language key to look up
  131. * @param id elupd html element to update with results
  132. * @param string default_str default value of string for loaded manager language - allows some level of confirmation of change from default
  133. */
  134. function confirmLangChange(el, lkey, elupd){
  135. lang_current = document.getElementById(elupd).value;
  136. lang_default = document.getElementById(lkey+'_hidden').value;
  137. changed = lang_current != lang_default;
  138. proceed = true;
  139. if(changed) {
  140. proceed = confirm('<?php echo $_lang['confirm_setting_language_change']; ?>');
  141. }
  142. if(proceed) {
  143. //document.getElementById(elupd).value = '';
  144. lang = el.options[el.selectedIndex].value;
  145. var myAjax = new Ajax('index.php?a=118', {
  146. method: 'post',
  147. data: 'action=get&lang='+lang+'&key='+lkey
  148. }).request();
  149. myAjax.addEvent('onComplete', function(resp){
  150. document.getElementById(elupd).value = resp;
  151. });
  152. }
  153. }
  154. </script>
  155. <form name="settings" action="index.php?a=30" method="post">
  156. <h1><?php echo $_lang['settings_title']; ?></h1>
  157. <div id="actions">
  158. <ul class="actionButtons">
  159. <li id="Button1">
  160. <a href="#" onclick="documentDirty=false; document.settings.submit();">
  161. <img src="<?php echo $_style["icons_save"]?>" /> <?php echo $_lang['save']; ?>
  162. </a>
  163. </li>
  164. <li id="Button5">
  165. <a href="#" onclick="documentDirty=false;document.location.href='index.php?a=2';">
  166. <img src="<?php echo $_style["icons_cancel"]?>" /> <?php echo $_lang['cancel']; ?>
  167. </a>
  168. </li>
  169. </ul>
  170. </div>
  171. <div style="margin: 0 10px 0 20px">
  172. <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
  173. <input type="hidden" name="settings_version" value="<?php echo $modx_version; ?>" />
  174. <!-- this field is used to check site settings have been entered/ updated after install or upgrade -->
  175. <?php if(!isset($settings_version) || $settings_version!=$modx_version) { ?>
  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'] == 1 ? 'true' : 'false'; ?> );
  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"' : "" ; ?> onclick='showHide(/logRow/, 1);' />
  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"' : "" ; ?> onclick='showHide(/logRow/, 0);' />
  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 id='logRow1' class='row1' style="display: <?php echo $track_visitors==1 ? $displayStyle : 'none' ; ?>">
  332. <td nowrap class="warning" valign="top"><b><?php echo $_lang["resolve_hostnames_title"] ?></b></td>
  333. <td> <input onchange="documentDirty=true;" type="radio" name="resolve_hostnames" value="1" <?php echo ($resolve_hostnames=='1' || !isset($resolve_hostnames)) ? 'checked="checked"' : "" ; ?> />
  334. <?php echo $_lang["yes"]?><br />
  335. <input onchange="documentDirty=true;" type="radio" name="resolve_hostnames" value="0" <?php echo $resolve_hostnames=='0' ? 'checked="checked"' : "" ; ?> />
  336. <?php echo $_lang["no"]?> </td>
  337. </tr>
  338. <tr id='logRow2' class='row1' style="display: <?php echo $track_visitors==1 ? $displayStyle : 'none' ; ?>">
  339. <td width="200">&nbsp;</td>
  340. <td class='comment'><?php echo $_lang["resolve_hostnames_message"] ?></td>
  341. </tr>
  342. <tr id='logRow3' style="display: <?php echo $track_visitors==1 ? $displayStyle : 'none' ; ?>">
  343. <td colspan="2"><div class='split'></div></td>
  344. </tr>
  345. <tr>
  346. <td nowrap class="warning" valign="top"><b><?php echo $_lang["top_howmany_title"] ?></b></td>
  347. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="top_howmany" value="<?php echo isset($top_howmany) ? $top_howmany : 10 ; ?>" /></td>
  348. </tr>
  349. <tr>
  350. <td width="200">&nbsp;</td>
  351. <td class='comment'><?php echo $_lang["top_howmany_message"] ?></td>
  352. </tr>
  353. <tr>
  354. <td colspan="2"><div class='split'></div></td>
  355. </tr>
  356. <tr>
  357. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaulttemplate_title"] ?></b></td>
  358. <td>
  359. <?php
  360. $sql = "select templatename, id from $dbase.`".$table_prefix."site_templates`";
  361. $rs = mysql_query($sql);
  362. ?>
  363. <select name="default_template" class="inputBox" onchange='documentDirty=true;' style="width:150px">
  364. <?php
  365. while ($row = mysql_fetch_assoc($rs)) {
  366. $selectedtext = $row['id']==$default_template ? "selected='selected'" : "" ;
  367. if ($selectedtext) {
  368. $oldTmpId = $row['id'];
  369. $oldTmpName = $row['templatename'];
  370. }
  371. ?>
  372. <option value="<?php echo $row['id']; ?>" <?php echo $selectedtext; ?>><?php echo $row['templatename']; ?></option>
  373. <?php
  374. }
  375. ?>
  376. </select>
  377. <br />
  378. <br />
  379. <input onchange="documentDirty=true;" type="radio" name="reset_template" value="1" /> <?php echo $_lang["template_reset_all"]; ?><br />
  380. <input onchange="documentDirty=true;" type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang["template_reset_specific"],$oldTmpName); ?>
  381. <input type="hidden" name="old_template" value="<?php echo $oldTmpId; ?>" />
  382. </td>
  383. </tr>
  384. <tr>
  385. <td width="200">&nbsp;</td>
  386. <td class='comment'><?php echo $_lang["defaulttemplate_message"] ?></td>
  387. </tr>
  388. <tr>
  389. <td colspan="2"><div class='split'></div></td>
  390. </tr>
  391. <tr>
  392. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultpublish_title"] ?></b></td>
  393. <td> <input onchange="documentDirty=true;" type="radio" name="publish_default" value="1" <?php echo $publish_default=='1' ? 'checked="checked"' : "" ; ?> />
  394. <?php echo $_lang["yes"]?><br />
  395. <input onchange="documentDirty=true;" type="radio" name="publish_default" value="0" <?php echo ($publish_default=='0' || !isset($publish_default)) ? 'checked="checked"' : "" ; ?> />
  396. <?php echo $_lang["no"]?> </td>
  397. </tr>
  398. <tr>
  399. <td width="200">&nbsp;</td>
  400. <td class='comment'><?php echo $_lang["defaultpublish_message"] ?></td>
  401. </tr>
  402. <tr>
  403. <td colspan="2"><div class='split'></div></td>
  404. </tr>
  405. <tr>
  406. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultcache_title"] ?></b></td>
  407. <td> <input onchange="documentDirty=true;" type="radio" name="cache_default" value="1" <?php echo $cache_default=='1' ? 'checked="checked"' : "" ; ?> />
  408. <?php echo $_lang["yes"]?><br />
  409. <input onchange="documentDirty=true;" type="radio" name="cache_default" value="0" <?php echo ($cache_default=='0' || !isset($cache_default)) ? 'checked="checked"' : "" ; ?> />
  410. <?php echo $_lang["no"]?> </td>
  411. </tr>
  412. <tr>
  413. <td width="200">&nbsp;</td>
  414. <td class='comment'><?php echo $_lang["defaultcache_message"] ?></td>
  415. </tr>
  416. <tr>
  417. <td colspan="2"><div class='split'></div></td>
  418. </tr>
  419. <tr>
  420. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultsearch_title"] ?></b></td>
  421. <td> <input onchange="documentDirty=true;" type="radio" name="search_default" value="1" <?php echo $search_default=='1' ? 'checked="checked"' : "" ; ?> />
  422. <?php echo $_lang["yes"]?><br />
  423. <input onchange="documentDirty=true;" type="radio" name="search_default" value="0" <?php echo ($search_default=='0' || !isset($search_default)) ? 'checked="checked"' : "" ; ?> />
  424. <?php echo $_lang["no"]?> </td>
  425. </tr>
  426. <tr>
  427. <td width="200">&nbsp;</td>
  428. <td class='comment'><?php echo $_lang["defaultsearch_message"] ?></td>
  429. </tr>
  430. <tr>
  431. <td colspan="2"><div class='split'></div></td>
  432. </tr>
  433. <tr>
  434. <td nowrap class="warning" valign="top"><b><?php echo $_lang["defaultmenuindex_title"] ?></b></td>
  435. <td> <input onchange="documentDirty=true;" type="radio" name="auto_menuindex" value="1" <?php echo ($auto_menuindex=='1' || !isset($auto_menuindex)) ? 'checked="checked"' : "" ; ?> />
  436. <?php echo $_lang["yes"]?><br />
  437. <input onchange="documentDirty=true;" type="radio" name="auto_menuindex" value="0" <?php echo ($auto_menuindex=='0') ? 'checked="checked"' : "" ; ?> />
  438. <?php echo $_lang["no"]?> </td>
  439. </tr>
  440. <tr>
  441. <td width="200">&nbsp;</td>
  442. <td class='comment'><?php echo $_lang["defaultmenuindex_message"] ?></td>
  443. </tr>
  444. <tr>
  445. <td colspan="2"><div class='split'></div></td>
  446. </tr>
  447. <tr>
  448. <td nowrap class="warning" valign="top"><b><?php echo $_lang["custom_contenttype_title"] ?></b></td>
  449. <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 />
  450. <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
  451. <select name="lst_custom_contenttype" style="width:200px;" size="5">
  452. <?php
  453. $custom_contenttype = (isset($custom_contenttype) ? $custom_contenttype : "text/css,text/html,text/javascript,text/plain,text/xml");
  454. $ct = explode(",",$custom_contenttype);
  455. for($i=0;$i<count($ct);$i++) {
  456. echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>";
  457. }
  458. ?>
  459. </select>
  460. <input name="custom_contenttype" type="hidden" value="<?php echo $custom_contenttype; ?>" />
  461. </td><td valign="top">&nbsp;<input name="removecontenttype" type="button" value="<?php echo $_lang["remove"]; ?>" onclick='removeContentType()' /></td></tr></table>
  462. </td>
  463. </tr>
  464. <tr>
  465. <td width="200">&nbsp;</td>
  466. <td class='comment'><?php echo $_lang["custom_contenttype_message"] ?></td>
  467. </tr>
  468. <tr>
  469. <td colspan="2"><div class='split'></div></td>
  470. <tr>
  471. <td nowrap class="warning"><b><?php echo $_lang["serveroffset_title"] ?></b></td>
  472. <td> <select name="server_offset_time" size="1" class="inputBox">
  473. <?php
  474. for($i=-24; $i<25; $i++) {
  475. $seconds = $i*60*60;
  476. $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
  477. ?>
  478. <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option>
  479. <?php
  480. }
  481. ?>
  482. </select> </td>
  483. </tr>
  484. <tr>
  485. <td width="200">&nbsp;</td>
  486. <td class='comment'><?php printf($_lang["serveroffset_message"], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></td>
  487. </tr>
  488. <tr>
  489. <td colspan="2"><div class='split'>&nbsp;</div></td>
  490. </tr>
  491. <tr>
  492. <td nowrap class="warning"><b><?php echo $_lang["server_protocol_title"] ?></b></td>
  493. <td> <input onchange="documentDirty=true;" type="radio" name="server_protocol" value="http" <?php echo ($server_protocol=='http' || !isset($server_protocol))? 'checked="checked"' : "" ; ?> />
  494. <?php echo $_lang["server_protocol_http"]?><br />
  495. <input onchange="documentDirty=true;" type="radio" name="server_protocol" value="https" <?php echo $server_protocol=='https' ? 'checked="checked"' : "" ; ?> />
  496. <?php echo $_lang["server_protocol_https"]?> </td>
  497. </tr>
  498. <tr>
  499. <td width="200">&nbsp;</td>
  500. <td class='comment'><?php echo $_lang["server_protocol_message"] ?></td>
  501. </tr>
  502. <tr>
  503. <td colspan="2"><div class='split'></div></td>
  504. </tr>
  505. <tr>
  506. <td nowrap class="warning"><b><?php echo $_lang["validate_referer_title"] ?></b></td>
  507. <td><input onchange="documentDirty=true;" type="radio" name="validate_referer" value="1" <?php echo ($validate_referer=='1' || !isset($validate_referer)) ? 'checked="checked"' : "" ; ?> />
  508. <?php echo $_lang["yes"]?><br />
  509. <input onchange="documentDirty=true;" type="radio" name="validate_referer" value="<?php echo $validate_referrer_off_val;?>" <?php echo $validate_referer=='0' ? 'checked="checked"' : "" ; ?> />
  510. <?php echo $_lang["no"]?> </td>
  511. </tr>
  512. <tr>
  513. <td width="200">&nbsp;</td>
  514. <td class='comment'><?php echo $_lang["validate_referer_message"] ?></td>
  515. </tr>
  516. <tr>
  517. <td colspan="2"><div class='split'></div></td>
  518. </tr>
  519. <tr>
  520. <td nowrap class="warning"><?php echo $_lang["rss_url_news_title"] ?></td>
  521. <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>
  522. </tr>
  523. <tr>
  524. <td width="200">&nbsp;</td>
  525. <td class='comment'><?php echo $_lang["rss_url_news_message"] ?></td>
  526. </tr>
  527. <tr>
  528. <td colspan="2"><div class='split'></div></td>
  529. </tr>
  530. <tr>
  531. <td nowrap class="warning"><?php echo $_lang["rss_url_security_title"] ?></td>
  532. <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>
  533. </tr>
  534. <tr>
  535. <td width="200">&nbsp;</td>
  536. <td class='comment'><?php echo $_lang["rss_url_security_message"] ?></td>
  537. </tr>
  538. <tr>
  539. <td colspan="2"><div class='split'></div></td>
  540. </tr>
  541. <tr class='row1'>
  542. <td colspan="2">
  543. <?php
  544. // invoke OnSiteSettingsRender event
  545. $evtOut = $modx->invokeEvent("OnSiteSettingsRender");
  546. if(is_array($evtOut)) echo implode("",$evtOut);
  547. ?>
  548. </td>
  549. </tr>
  550. </table>
  551. </div>
  552. <!-- Friendly URL settings -->
  553. <div class="tab-page" id="tabPage3">
  554. <h2 class="tab"><?php echo $_lang["settings_furls"] ?></h2>
  555. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage3" ) );</script>
  556. <table border="0" cellspacing="0" cellpadding="3">
  557. <tr>
  558. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendlyurls_title"] ?></b></td>
  559. <td> <input onchange="documentDirty=true;" type="radio" name="friendly_urls" value="1" <?php echo $friendly_urls=='1' ? 'checked="checked"' : "" ; ?> onclick='showHide(/furlRow/, 1);' />
  560. <?php echo $_lang["yes"]?><br />
  561. <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);' />
  562. <?php echo $_lang["no"]?> </td>
  563. </tr>
  564. <tr>
  565. <td width="200">&nbsp;</td>
  566. <td class='comment'><?php echo $_lang["friendlyurls_message"] ?></td>
  567. </tr>
  568. <tr>
  569. <td colspan="2"><div class='split'></div></td>
  570. </tr>
  571. <tr id='furlRow1' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  572. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendlyurlsprefix_title"] ?></b></td>
  573. <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>
  574. </tr>
  575. <tr id='furlRow2' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  576. <td width="200">&nbsp;</td>
  577. <td class='comment'><?php echo $_lang["friendlyurlsprefix_message"] ?></td>
  578. </tr>
  579. <tr id='furlRow3' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  580. <td colspan="2"><div class='split'></div></td>
  581. </tr>
  582. <tr id='furlRow4' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  583. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendlyurlsuffix_title"] ?></b></td>
  584. <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>
  585. </tr>
  586. <tr id='furlRow5' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  587. <td width="200">&nbsp;</td>
  588. <td class='comment'><?php echo $_lang["friendlyurlsuffix_message"] ?></td>
  589. </tr>
  590. <tr id='furlRow6' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  591. <td colspan="2"><div class='split'></div></td>
  592. </tr>
  593. <tr id='furlRow7' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  594. <td nowrap class="warning" valign="top"><b><?php echo $_lang["friendly_alias_title"] ?></b></td>
  595. <td> <input onchange="documentDirty=true;" type="radio" name="friendly_alias_urls" value="1" <?php echo $friendly_alias_urls=='1' ? 'checked="checked"' : "" ; ?> />
  596. <?php echo $_lang["yes"]?><br />
  597. <input onchange="documentDirty=true;" type="radio" name="friendly_alias_urls" value="0" <?php echo ($friendly_alias_urls=='0' || !isset($friendly_alias_urls)) ? 'checked="checked"' : "" ; ?> />
  598. <?php echo $_lang["no"]?> </td>
  599. </tr>
  600. <tr id='furlRow8' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  601. <td width="200">&nbsp;</td>
  602. <td class='comment'><?php echo $_lang["friendly_alias_message"] ?></td>
  603. </tr>
  604. <tr id='furlRow9' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  605. <td colspan="2"><div class='split'></div></td>
  606. </tr>
  607. <tr id='furlRow10' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  608. <td nowrap class="warning" valign="top"><b><?php echo $_lang["use_alias_path_title"] ?></b></td>
  609. <td> <input onchange="documentDirty=true;" type="radio" name="use_alias_path" value="1" <?php echo $use_alias_path=='1' ? 'checked="checked"' : "" ; ?> />
  610. <?php echo $_lang["yes"]?><br />
  611. <input onchange="documentDirty=true;" type="radio" name="use_alias_path" value="0" <?php echo ($use_alias_path=='0' || !isset($use_alias_path)) ? 'checked="checked"' : "" ; ?> />
  612. <?php echo $_lang["no"]?> </td>
  613. </tr>
  614. <tr id='furlRow11' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  615. <td width="200">&nbsp;</td>
  616. <td class='comment'><?php echo $_lang["use_alias_path_message"] ?></td>
  617. </tr>
  618. <tr id='furlRow12' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  619. <td colspan="2"><div class='split'></div></td>
  620. </tr>
  621. <tr id='furlRow16' class='row2' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  622. <td nowrap class="warning" valign="top"><b><?php echo $_lang["duplicate_alias_title"] ?></b></td>
  623. <td> <input onchange="documentDirty=true;" type="radio" name="allow_duplicate_alias" value="1" <?php echo $allow_duplicate_alias=='1' ? 'checked="checked"' : "" ; ?> />
  624. <?php echo $_lang["yes"]?><br />
  625. <input onchange="documentDirty=true;" type="radio" name="allow_duplicate_alias" value="0" <?php echo ($allow_duplicate_alias=='0' || !isset($allow_duplicate_alias)) ? 'checked="checked"' : "" ; ?> />
  626. <?php echo $_lang["no"]?> </td>
  627. </tr>
  628. <tr id='furlRow17' class='row2' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  629. <td width="200">&nbsp;</td>
  630. <td class='comment'><?php echo $_lang["duplicate_alias_message"] ?></td>
  631. </tr>
  632. <tr id='furlRow18' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  633. <td colspan="2"><div class='split'></div></td>
  634. </tr>
  635. <tr id='furlRow13' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  636. <td nowrap class="warning" valign="top"><b><?php echo $_lang["automatic_alias_title"] ?></b></td>
  637. <td> <input onchange="documentDirty=true;" type="radio" name="automatic_alias" value="1" <?php echo $automatic_alias=='1' ? 'checked="checked"' : "" ; ?> />
  638. <?php echo $_lang["yes"]?><br />
  639. <input onchange="documentDirty=true;" type="radio" name="automatic_alias" value="0" <?php echo ($automatic_alias=='0' || !isset($automatic_alias)) ? 'checked="checked"' : "" ; ?> />
  640. <?php echo $_lang["no"]?> </td>
  641. </tr>
  642. <tr id='furlRow14' class='row1' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  643. <td width="200">&nbsp;</td>
  644. <td class='comment'><?php echo $_lang["automatic_alias_message"] ?></td>
  645. </tr>
  646. <tr id='furlRow15' style="display: <?php echo $friendly_urls==1 ? $displayStyle : 'none' ; ?>">
  647. <td colspan="2"><div class='split'></div></td>
  648. </tr>
  649. <tr class='row1'>
  650. <td colspan="2">
  651. <?php
  652. // invoke OnFriendlyURLSettingsRender event
  653. $evtOut = $modx->invokeEvent("OnFriendlyURLSettingsRender");
  654. if(is_array($evtOut)) echo implode("",$evtOut);
  655. ?>
  656. </td>
  657. </tr>
  658. </table>
  659. </div>
  660. <!-- User settings -->
  661. <div class="tab-page" id="tabPage4">
  662. <h2 class="tab"><?php echo $_lang["settings_users"] ?></h2>
  663. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage4" ) );</script>
  664. <table border="0" cellspacing="0" cellpadding="3">
  665. <tr>
  666. <td nowrap class="warning"><b><?php echo $_lang["udperms_title"] ?></b></td>
  667. <td> <input onchange="documentDirty=true;" type="radio" name="use_udperms" value="1" <?php echo $use_udperms=='1' ? 'checked="checked"' : "" ; ?> onclick='showHide(/udPerms/, 1);' />
  668. <?php echo $_lang["yes"]?><br />
  669. <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);' />
  670. <?php echo $_lang["no"]?> </td>
  671. </tr>
  672. <tr>
  673. <td width="200">&nbsp;</td>
  674. <td class='comment'><?php echo $_lang["udperms_message"] ?></td>
  675. </tr>
  676. <tr>
  677. <td colspan="2"><div class='split'></div></td>
  678. </tr>
  679. <tr id='udPermsRow1' class='row1' style="display: <?php echo $use_udperms==1 ? $displayStyle : 'none' ; ?>">
  680. <td nowrap class="warning"><b><?php echo $_lang["udperms_allowroot_title"] ?></b></td>
  681. <td> <input onchange="documentDirty=true;" type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot=='1' ? 'checked="checked"' : "" ; ?> />
  682. <?php echo $_lang["yes"]?><br />
  683. <input onchange="documentDirty=true;" type="radio" name="udperms_allowroot" value="0" <?php echo ($udperms_allowroot=='0' || !isset($udperms_allowroot)) ? 'checked="checked"' : "" ; ?> />
  684. <?php echo $_lang["no"]?> </td>
  685. </tr>
  686. <tr id='udPermsRow2' class='row1' style="display: <?php echo $use_udperms==1 ? $displayStyle : 'none' ; ?>">
  687. <td width="200">&nbsp;</td>
  688. <td class='comment'><?php echo $_lang["udperms_allowroot_message"] ?></td>
  689. </tr>
  690. <tr id='udPermsRow3' style="display: <?php echo $use_udperms==1 ? $displayStyle : 'none' ; ?>">
  691. <td colspan="2"><div class='split'></div></td>
  692. </tr>
  693. <tr>
  694. <td nowrap class="warning"><b><?php echo $_lang["failed_login_title"] ?></b></td>
  695. <td><input type="text" name="failed_login_attempts" style="width:50px" value="<?php echo isset($failed_login_attempts) ? $failed_login_attempts : "3" ; ?>" /></td>
  696. </tr>
  697. <tr>
  698. <td width="200">&nbsp;</td>
  699. <td class='comment'><?php echo $_lang["failed_login_message"] ?></td>
  700. </tr>
  701. <tr>
  702. <td colspan="2"><div class='split'></div></td>
  703. </tr>
  704. <tr>
  705. <td nowrap class="warning"><b><?php echo $_lang["blocked_minutes_title"] ?></b></td>
  706. <td><input type="text" name="blocked_minutes" style="width:100px" value="<?php echo isset($blocked_minutes) ? $blocked_minutes : "60" ; ?>" /></td>
  707. </tr>
  708. <tr>
  709. <td width="200">&nbsp;</td>
  710. <td class='comment'><?php echo $_lang["blocked_minutes_message"] ?></td>
  711. </tr>
  712. <tr>
  713. <td colspan="2"><div class='split'></div></td>
  714. </tr>
  715. <?php
  716. // Check for GD before allowing captcha to be enabled
  717. $gdAvailable = extension_loaded('gd');
  718. ?>
  719. <tr>
  720. <td nowrap class="warning"><b><?php echo $_lang["captcha_title"] ?></b></td>
  721. <td> <input onchange="documentDirty=true;" type="radio" name="use_captcha" value="1" <?php echo ($use_captcha=='1' && $gdAvailable) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> />
  722. <?php echo $_lang["yes"]?><br />
  723. <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"' : '';?> />
  724. <?php echo $_lang["no"]?> </td>
  725. </tr>
  726. <tr>
  727. <td width="200">&nbsp;</td>
  728. <td class='comment'><?php echo $_lang["captcha_message"] ?></td>
  729. </tr>
  730. <tr>
  731. <td colspan="2"><div class='split'></div></td>
  732. </tr>
  733. <tr>
  734. <td nowrap class="warning"><b><?php echo $_lang["captcha_words_title"] ?></b>
  735. <br />
  736. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  737. <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');">
  738. <?php echo get_lang_options('captcha_words_default');?>
  739. </select>
  740. </td>
  741. <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"] ; ?>" />
  742. <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang["captcha_words_default"]);?>" />
  743. </td>
  744. </tr>
  745. <tr>
  746. <td width="200">&nbsp;</td>
  747. <td class='comment'><?php echo $_lang["captcha_words_message"] ?></td>
  748. </tr>
  749. <tr>
  750. <td colspan="2"><div class='split'></div></td>
  751. </tr>
  752. <tr>
  753. <td nowrap class="warning"><b><?php echo $_lang["emailsender_title"] ?></b></td>
  754. <td ><input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="emailsender" value="<?php echo isset($emailsender) ? $emailsender : "you@example.com" ; ?>" /></td>
  755. </tr>
  756. <tr>
  757. <td width="200">&nbsp;</td>
  758. <td class='comment'><?php echo $_lang["emailsender_message"] ?></td>
  759. </tr>
  760. <tr>
  761. <td colspan="2"><div class='split'></div></td>
  762. </tr>
  763. <tr>
  764. <td nowrap class="warning"><b><?php echo $_lang["emailsubject_title"] ?></b>
  765. <br />
  766. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  767. <select name="reload_emailsubject" id="reload_emailsubject_select" onchange="confirmLangChange(this, 'emailsubject_default', 'emailsubject_field');">
  768. <?php echo get_lang_options('emailsubject_default');?>
  769. </select>
  770. </td>
  771. <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"] ; ?>" />
  772. <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']);?>" />
  773. </td>
  774. </tr>
  775. <tr>
  776. <td width="200">&nbsp;</td>
  777. <td class='comment'><?php echo $_lang["emailsubject_message"] ?></td>
  778. </tr>
  779. <tr>
  780. <td colspan="2"><div class='split'></div></td>
  781. </tr>
  782. <tr>
  783. <td nowrap class="warning" valign="top"><b><?php echo $_lang["signupemail_title"] ?></b>
  784. <br />
  785. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  786. <select name="reload_signupemail_message" id="reload_signupemail_message_select" onchange="confirmLangChange(this, 'system_email_signup', 'signupemail_message_textarea');">
  787. <?php echo get_lang_options('system_email_signup');?>
  788. </select>
  789. </td>
  790. <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>
  791. <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']);?>" />
  792. </td>
  793. </tr>
  794. <tr>
  795. <td width="200">&nbsp;</td>
  796. <td class='comment'><?php echo $_lang["signupemail_message"] ?></td>
  797. </tr>
  798. <tr>
  799. <td colspan="2"><div class='split'></div></td>
  800. </tr>
  801. <tr>
  802. <td nowrap class="warning" valign="top"><b><?php echo $_lang["websignupemail_title"] ?></b>
  803. <br />
  804. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  805. <select name="reload_websignupemail_message" id="reload_websignupemail_message_select" onchange="confirmLangChange(this, 'system_email_websignup', 'websignupemail_message_textarea');">
  806. <?php echo get_lang_options('system_email_websignup');?>
  807. </select>
  808. </td>
  809. <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>
  810. <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']);?>" />
  811. </td>
  812. </tr>
  813. <tr>
  814. <td width="200">&nbsp;</td>
  815. <td class='comment'><?php echo $_lang["websignupemail_message"] ?></td>
  816. </tr>
  817. <tr>
  818. <td colspan="2"><div class='split'></div></td>
  819. </tr>
  820. <tr>
  821. <td nowrap class="warning" valign="top"><b><?php echo $_lang["webpwdreminder_title"] ?></b>
  822. <br />
  823. <p><?php echo $_lang["update_settings_from_language"]; ?></p>
  824. <select name="reload_system_email_webreminder_message" id="reload_system_email_webreminder_select" onchange="confirmLangChange(this, 'system_email_webreminder', 'system_email_webreminder_textarea');">
  825. <?php echo get_lang_options('system_email_webreminder');?>
  826. </select>
  827. </td>
  828. <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>
  829. <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']);?>" />
  830. </td>
  831. </tr>
  832. <tr>
  833. <td width="200">&nbsp;</td>
  834. <td class='comment'><?php echo $_lang["webpwdreminder_message"] ?></td>
  835. </tr>
  836. <tr class='row1'>
  837. <td colspan="2">
  838. <?php
  839. // invoke OnUserSettingsRender event
  840. $evtOut = $modx->invokeEvent("OnUserSettingsRender");
  841. if(is_array($evtOut)) echo implode("",$evtOut);
  842. ?>
  843. </td>
  844. </tr>
  845. </table>
  846. </div>
  847. <!-- Interface & editor settings -->
  848. <div class="tab-page" id="tabPage5">
  849. <h2 class="tab"><?php echo $_lang["settings_ui"] ?></h2>
  850. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage5" ) );</script>
  851. <table border="0" cellspacing="0" cellpadding="3">
  852. <tr>
  853. <td nowrap class="warning"><b><?php echo $_lang["manager_theme"]?></b></td>
  854. <td> <select name="manager_theme" size="1" class="inputBox" onchange="documentDirty=true;document.forms['settings'].theme_refresher.value = Date.parse(new Date())">
  855. <?php
  856. $dir = dir("media/style/");
  857. while ($file = $dir->read()) {
  858. if($file!="." && $file!=".." && is_dir("media/style/$file") && substr($file,0,1) != '.') {
  859. $themename = $file;
  860. $selectedtext = $themename==$manager_theme ? "selected='selected'" : "" ;
  861. echo "<option value='$themename' $selectedtext>".ucwords(str_replace("_", " ", $themename))."</option>";
  862. }
  863. }
  864. $dir->close();
  865. ?>
  866. </select><input type="hidden" name="theme_refresher" value="" /></td>
  867. </tr>
  868. <tr>
  869. <td width="200">&nbsp;</td>
  870. <td class='comment'><?php echo $_lang["manager_theme_message"]?></td>
  871. </tr>
  872. <tr>
  873. <td colspan="2"><div class='split'></div></td>
  874. </tr>
  875. <tr>
  876. <td nowrap class="warning"><b><?php echo $_lang["warning_visibility"] ?></b></td>
  877. <td> <input onchange="documentDirty=true;" type="radio" name="warning_visibility" value="0" <?php echo $warning_visibility=='0' ? 'checked="checked"' : ""; ?> />
  878. <?php echo $_lang["administrators"]?><br />
  879. <input onchange="documentDirty=true;" type="radio" name="warning_visibility" value="1" <?php echo (!isset($warning_visibility) || $warning_visibility=='1') ? 'checked="checked"' : ""; ?> />
  880. <?php echo $_lang["everybody"]?></td>
  881. </tr>
  882. <tr>
  883. <td width="200">&nbsp;</td>
  884. <td class='comment'><?php echo $_lang["warning_visibility_message"]?></td>
  885. </tr>
  886. <tr>
  887. <td colspan="2"><div class='split'></div></td>
  888. </tr>
  889. <tr>
  890. <td nowrap class="warning"><b><?php echo $_lang["tree_page_click"] ?></b></td>
  891. <td> <input onchange="documentDirty=true;" type="radio" name="tree_page_click" value="27" <?php echo $tree_page_click=='27' ? 'checked="checked"' : ""; ?> />
  892. <?php echo $_lang["edit_resource"]?><br />
  893. <input onchange="documentDirty=true;" type="radio" name="tree_page_click" value="3" <?php echo ($tree_page_click=='3' || !isset($tree_page_click)) ? 'checked="checked"' : ""; ?> />
  894. <?php echo $_lang["doc_data_title"]?></td>
  895. </tr>
  896. <tr>
  897. <td width="200">&nbsp;</td>
  898. <td class='comment'><?php echo $_lang["tree_page_click_message"]?></td>
  899. </tr>
  900. <tr>
  901. <td colspan="2"><div class='split'></div></td>
  902. </tr>
  903. <tr>
  904. <td nowrap class="warning"><b><?php echo $_lang["remember_last_tab"] ?></b></td>
  905. <td> <input onchange="documentDirty=true;" type="radio" name="remember_last_tab" value="1" <?php echo $remember_last_tab=='1' ? 'checked="checked"' : ""; ?> />
  906. <?php echo $_lang["yes"]?><br />
  907. <input onchange="documentDirty=true;" type="radio" name="remember_last_tab" value="0" <?php echo (!isset($remember_last_tab) || $remember_last_tab=='0') ? 'checked="checked"' : ""; ?> />
  908. <?php echo $_lang["no"]?></td>
  909. </tr>
  910. <tr>
  911. <td width="200">&nbsp;</td>
  912. <td class='comment'><?php echo $_lang["remember_last_tab_message"]?></td>
  913. </tr>
  914. <tr>
  915. <td colspan="2"><div class='split'></div></td>
  916. </tr>
  917. <tr>
  918. <td nowrap class="warning"><b><?php echo $_lang["tree_show_protected"] ?></b></td>
  919. <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" '; ?>/>
  920. <?php echo $_lang["yes"]?><br />
  921. <input onchange="documentDirty=true;" type="radio" name="tree_show_protected" value="0" <?php echo (!isset($tree_show_protected) || $tree_show_protected=='0') ? 'checked="checked" ' : ''; ?>/>
  922. <?php echo $_lang["no"]?></td>
  923. </tr>
  924. <tr>
  925. <td width="200">&nbsp;</td>
  926. <td class='comment'><?php echo $_lang["tree_show_protected_message"]?></td>
  927. </tr>
  928. <tr>
  929. <td colspan="2"><div class='split'></div></td>
  930. </tr>
  931. <tr>
  932. <td nowrap class="warning"><b><?php echo $_lang["show_meta"] ?></b></td>
  933. <td> <input onchange="documentDirty=true;" type="radio" name="show_meta" value="1" <?php echo $show_meta=='1' ? 'checked="checked"' : ""; ?> />
  934. <?php echo $_lang["yes"]?><br />
  935. <input onchange="documentDirty=true;" type="radio" name="show_meta" value="0" <?php echo ($show_meta=='0' || !isset($show_meta)) ? 'checked="checked"' : ""; ?> />
  936. <?php echo $_lang["no"]?></td>
  937. </tr>
  938. <tr>
  939. <td width="200">&nbsp;</td>
  940. <td class='comment'><?php echo $_lang["show_meta_message"]?></td>
  941. </tr>
  942. <tr>
  943. <td colspan="2"><div class='split'></div></td>
  944. </tr>
  945. <tr>
  946. <td nowrap class="warning"><b><?php echo $_lang["datepicker_offset"] ?></b></td>
  947. <td><input onchange="documentDirty=true;" type='text' maxlength='50' size="5" name="datepicker_offset" value="<?php echo isset($datepicker_offset) ? $datepicker_offset : '-10' ; ?>" /></td>
  948. </tr>
  949. <tr>
  950. <td width="200">&nbsp;</td>
  951. <td class='comment'><?php echo $_lang["datepicker_offset_message"]?></td>
  952. </tr>
  953. <tr>
  954. <td colspan="2"><div class='split'></div></td>
  955. </tr>
  956. <tr>
  957. <td nowrap class="warning"><b><?php echo $_lang["datetime_format"]?></b></td>
  958. <td> <select name="datetime_format" size="1" class="inputBox">
  959. <?php
  960. $datetime_format_list = array('dd-mm-YYYY', 'mm/dd/YYYY', 'YYYY/mm/dd');
  961. $str = '';
  962. foreach($datetime_format_list as $value)
  963. {
  964. $selectedtext = ($datetime_format == $value) ? ' selected' : '';
  965. $str .= '<option value="' . $value . '"' . $selectedtext . '>';
  966. $str .= $value . '</option>' . PHP_EOL;
  967. }
  968. echo $str;
  969. ?>
  970. </select></td>
  971. </tr>
  972. <tr>
  973. <td width="200">&nbsp;</td>
  974. <td class='comment'><?php echo $_lang["datetime_format_message"]?></td>
  975. </tr>
  976. <tr>
  977. <td colspan="2"><div class='split'></div></td>
  978. </tr>
  979. <tr>
  980. <td nowrap class="warning"><b><?php echo $_lang["nologentries_title"]?></b></td>
  981. <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>
  982. </tr>
  983. <tr>
  984. <td width="200">&nbsp;</td>
  985. <td class='comment'><?php echo $_lang["nologentries_message"]?></td>
  986. </tr>
  987. <tr>
  988. <td colspan="2"><div class='split'></div></td>
  989. </tr>
  990. <tr>
  991. <td nowrap class="warning"><b><?php echo $_lang["mail_check_timeperiod_title"] ?></b></td>
  992. <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>
  993. </tr>
  994. <tr>
  995. <td width="200">&nbsp;</td>
  996. <td class='comment'><?php echo $_lang["mail_check_timeperiod_message"] ?></td>
  997. </tr>
  998. <tr>
  999. <td colspan="2"><div class='split'></div></td>
  1000. </tr>
  1001. <tr>
  1002. <td nowrap class="warning"><b><?php echo $_lang["nomessages_title"]?></b></td>
  1003. <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>
  1004. </tr>
  1005. <tr>
  1006. <td width="200">&nbsp;</td>
  1007. <td class='comment'><?php echo $_lang["nomessages_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["noresults_title"]?></b></td>
  1014. <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>
  1015. </tr>
  1016. <tr>
  1017. <td width="200">&nbsp;</td>
  1018. <td class='comment'><?php echo $_lang["noresults_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["settings_strip_image_paths_title"]?></b></td>
  1025. <td><input onchange="documentDirty=true;" type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths=='1' ? 'checked="checked"' : "" ; ?> />
  1026. <?php echo $_lang["yes"]?><br />
  1027. <input onchange="documentDirty=true;" type="radio" name="strip_image_paths" value="0" <?php echo ($strip_image_paths=='0' || !isset($strip_image_paths)) ? 'checked="checked"' : "" ; ?> />
  1028. <?php echo $_lang["no"]?> </td>
  1029. </tr>
  1030. <tr>
  1031. <td width="200">&nbsp;</td>
  1032. <td class='comment'><?php echo $_lang["settings_strip_image_paths_message"]?></td>
  1033. </tr>
  1034. <tr>
  1035. <td colspan="2"><div class='split'></div></td>
  1036. </tr>
  1037. <tr>
  1038. <td nowrap class="warning"><b><?php echo $_lang["rb_title"]?></b></td>
  1039. <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);" />
  1040. <?php echo $_lang["yes"]?><br />
  1041. <input onchange="documentDirty=true;" type="radio" name="use_browser" value="0" <?php echo $use_browser=='0' ? 'checked="checked"' : "" ; ?> onclick="showHide(/rbRow/, 0);" />
  1042. <?php echo $_lang["no"]?> </td>
  1043. </tr>
  1044. <tr>
  1045. <td width="200">&nbsp;</td>
  1046. <td class='comment'><?php echo $_lang["rb_message"]?></td>
  1047. </tr>
  1048. <tr>
  1049. <td colspan="2"><div class='split'></div></td>
  1050. </tr>
  1051. <?php if(!isset($use_browser)) $use_browser=1; ?>
  1052. <tr id='rbRow1' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1053. <td nowrap class="warning"><b><?php echo $_lang["rb_webuser_title"]?></b></td>
  1054. <td><input onchange="documentDirty=true;" type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser=='1' ? 'checked="checked"' : "" ; ?> />
  1055. <?php echo $_lang["yes"]?><br />
  1056. <input onchange="documentDirty=true;" type="radio" name="rb_webuser" value="0" <?php echo ($rb_webuser=='0' || !isset($rb_webuser)) ? 'checked="checked"' : "" ; ?> />
  1057. <?php echo $_lang["no"]?> </td>
  1058. </tr>
  1059. <tr id='rbRow2' class="row3" style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1060. <td width="200">&nbsp;</td>
  1061. <td class="comment"><?php echo $_lang["rb_webuser_message"]?></td>
  1062. </tr>
  1063. <tr id='rbRow3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1064. <td colspan="2"><div class='split'></div></td>
  1065. </tr>
  1066. <tr id='rbRow4' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1067. <td nowrap class="warning"><b><?php echo $_lang["rb_base_dir_title"]?></b></td>
  1068. <td><?php
  1069. function getResourceBaseDir() {
  1070. global $base_path;
  1071. return $base_path."assets/";
  1072. }
  1073. ?>
  1074. <?php echo $_lang['default']; ?> <span id="default_rb_base_dir"><?php echo getResourceBaseDir()?></span><br />
  1075. <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">
  1076. </td>
  1077. </tr>
  1078. <tr id='rbRow5' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1079. <td width="200">&nbsp;</td>
  1080. <td class='comment'><?php echo $_lang["rb_base_dir_message"]?></td>
  1081. </tr>
  1082. <tr id='rbRow6' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1083. <td colspan="2"><div class='split'></div></td>
  1084. </tr>
  1085. <tr id='rbRow7' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1086. <td nowrap class="warning"><b><?php echo $_lang["rb_base_url_title"]?></b></td>
  1087. <td> <?php
  1088. function getResourceBaseUrl() {
  1089. global $site_url;
  1090. return $site_url . "assets/";
  1091. }
  1092. ?>
  1093. <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() ; ?>" />
  1094. </td>
  1095. </tr>
  1096. <tr id='rbRow8' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1097. <td width="200">&nbsp;</td>
  1098. <td class='comment'><?php echo $_lang["rb_base_url_message"]?></td>
  1099. </tr>
  1100. <tr id='rbRow9' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1101. <td colspan="2"><div class='split'></div></td>
  1102. </tr>
  1103. <tr id='rbRow10' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1104. <td nowrap class="warning"><b><?php echo $_lang["uploadable_images_title"]?></b></td>
  1105. <td>
  1106. <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" ; ?>" />
  1107. </td>
  1108. </tr>
  1109. <tr id='rbRow11' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1110. <td width="200">&nbsp;</td>
  1111. <td class='comment'><?php echo $_lang["uploadable_images_message"]?></td>
  1112. </tr>
  1113. <tr id='rbRow12' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1114. <td colspan="2"><div class='split'></div></td>
  1115. </tr>
  1116. <tr id='rbRow13' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1117. <td nowrap class="warning"><b><?php echo $_lang["uploadable_media_title"]?></b></td>
  1118. <td>
  1119. <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" ; ?>" />
  1120. </td>
  1121. </tr>
  1122. <tr id='rbRow14' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1123. <td width="200">&nbsp;</td>
  1124. <td class='comment'><?php echo $_lang["uploadable_media_message"]?></td>
  1125. </tr>
  1126. <tr id='rbRow15' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1127. <td colspan="2"><div class='split'></div></td>
  1128. </tr>
  1129. <tr id='rbRow16' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1130. <td nowrap class="warning"><b><?php echo $_lang["uploadable_flash_title"]?></b></td>
  1131. <td>
  1132. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_flash" value="<?php echo isset($upload_flash) ? $upload_flash : "swf,fla" ; ?>" />
  1133. </td>
  1134. </tr>
  1135. <tr id='rbRow17' class='row3' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1136. <td width="200">&nbsp;</td>
  1137. <td class='comment'><?php echo $_lang["uploadable_flash_message"]?></td>
  1138. </tr>
  1139. <tr id='rbRow18' style="display: <?php echo $use_browser==1 ? $displayStyle : 'none' ; ?>">
  1140. <td colspan="2"><div class='split'></div></td>
  1141. </tr>
  1142. <tr>
  1143. <td nowrap class="warning"><b><?php echo $_lang["use_editor_title"]?></b></td>
  1144. <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();" />
  1145. <?php echo $_lang["yes"]?><br />
  1146. <input onchange="documentDirty=true;" type="radio" name="use_editor" value="0" <?php echo $use_editor=='0' ? 'checked="checked"' : "" ; ?> onclick="showHide(/editorRow/, 0);" />
  1147. <?php echo $_lang["no"]?> </td>
  1148. </tr>
  1149. <tr>
  1150. <td width="200">&nbsp;</td>
  1151. <td class='comment'><?php echo $_lang["use_editor_message"]?></td>
  1152. </tr>
  1153. <tr>
  1154. <td colspan="2"><div class='split'></div></td>
  1155. </tr>
  1156. <?php if(!isset($use_editor)) $use_editor=1; ?>
  1157. <tr id='editorRow0' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1158. <td nowrap class="warning"><b><?php echo $_lang["which_editor_title"]?></b></td>
  1159. <td>
  1160. <select name="which_editor" onchange="documentDirty=true;">
  1161. <?php
  1162. // invoke OnRichTextEditorRegister event
  1163. $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
  1164. echo "<option value='none'".($which_editor=='none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n";
  1165. if(is_array($evtOut)) for($i=0;$i<count($evtOut);$i++) {
  1166. $editor = $evtOut[$i];
  1167. echo "<option value='$editor'".($which_editor==$editor ? " selected='selected'" : "").">$editor</option>\n";
  1168. }
  1169. ?>
  1170. </select>
  1171. </td>
  1172. </tr>
  1173. <tr id='editorRow1' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1174. <td width="200">&nbsp;</td>
  1175. <td class='comment'><?php echo $_lang["which_editor_message"]?></td>
  1176. </tr>
  1177. <tr id='editorRow3' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1178. <td colspan="2"><div class='split'></div></td>
  1179. </tr>
  1180. <tr id='editorRow4' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1181. <td nowrap class="warning"><b><?php echo $_lang["fe_editor_lang_title"]?></b></td>
  1182. <td> <select name="fe_editor_lang" size="1" class="inputBox" onchange="documentDirty=true;">
  1183. <?php echo get_lang_options(null, $fe_editor_lang);?>
  1184. </select> </td>
  1185. </tr>
  1186. <tr id='editorRow5' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1187. <td width="200">&nbsp;</td>
  1188. <td class='comment'><?php echo $_lang["fe_editor_lang_message"]?></td>
  1189. </tr>
  1190. <tr id='editorRow2' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1191. <td colspan="2"><div class='split'></div></td>
  1192. </tr>
  1193. <tr id='editorRow14' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1194. <td nowrap class="warning"><b><?php echo $_lang["editor_css_path_title"]?></b></td>
  1195. <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 : "" ; ?>" />
  1196. </td>
  1197. </tr>
  1198. <tr id='editorRow15' class='row3' style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1199. <td width="200">&nbsp;</td>
  1200. <td class='comment'><?php echo $_lang["editor_css_path_message"]?></td>
  1201. </tr>
  1202. <tr id='editorRow16' class="row3" style="display: <?php echo $use_editor==1 ? $displayStyle : 'none' ; ?>">
  1203. <td colspan="2"><div class='split'></div></td>
  1204. </tr>
  1205. <tr class='row1'>
  1206. <td colspan="2">
  1207. <?php
  1208. // invoke OnInterfaceSettingsRender event
  1209. $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
  1210. if(is_array($evtOut)) echo implode("",$evtOut);
  1211. ?>
  1212. </td>
  1213. </tr>
  1214. </table>
  1215. </div>
  1216. <!-- Miscellaneous settings -->
  1217. <div class="tab-page" id="tabPage7">
  1218. <h2 class="tab"><?php echo $_lang["settings_misc"] ?></h2>
  1219. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabPage7" ) );</script>
  1220. <table border="0" cellspacing="0" cellpadding="3">
  1221. <tr>
  1222. <td nowrap class="warning"><b><?php echo $_lang["filemanager_path_title"]?></b></td>
  1223. <td>
  1224. <?php echo $_lang['default']; ?> <span id="default_filemanager_path"><?php echo $base_path; ?></span><br />
  1225. <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">
  1226. </td>
  1227. </tr>
  1228. <tr>
  1229. <td width="200">&nbsp;</td>
  1230. <td class='comment'><?php echo $_lang["filemanager_path_message"]?></td>
  1231. </tr>
  1232. <tr>
  1233. <td colspan="2"><div class='split'></div></td>
  1234. </tr>
  1235. <tr>
  1236. <td nowrap class="warning"><b><?php echo $_lang["uploadable_files_title"]?></b></td>
  1237. <td>
  1238. <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" ; ?>" />
  1239. </td>
  1240. </tr>
  1241. <tr>
  1242. <td width="200">&nbsp;</td>
  1243. <td class='comment'><?php echo $_lang["uploadable_files_message"]?></td>
  1244. </tr>
  1245. <tr>
  1246. <td colspan="2"><div class='split'></div></td>
  1247. </tr>
  1248. <tr>
  1249. <td nowrap class="warning"><b><?php echo $_lang["upload_maxsize_title"]?></b></td>
  1250. <td>
  1251. <input onchange="documentDirty=true;" type='text' maxlength='255' style="width: 250px;" name="upload_maxsize" value="<?php echo isset($upload_maxsize) ? $upload_maxsize : "1048576" ; ?>" />
  1252. </td>
  1253. </tr>
  1254. <tr>
  1255. <td width="200">&nbsp;</td>
  1256. <td class='comment'><?php echo $_lang["upload_maxsize_message"]?></td>
  1257. </tr>
  1258. <tr>
  1259. <td colspan="2"><div class='split'></div></td>
  1260. </tr>
  1261. <tr>
  1262. <td nowrap class="warning"><b><?php echo $_lang["new_file_permissions_title"]?></b></td>
  1263. <td>
  1264. <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" ; ?>" />
  1265. </td>
  1266. </tr>
  1267. <tr>
  1268. <td width="200">&nbsp;</td>
  1269. <td class='comment'><?php echo $_lang["new_file_permissions_message"]?></td>
  1270. </tr>
  1271. <tr>
  1272. <td colspan="2"><div class='split'></div></td>
  1273. </tr>
  1274. <tr>
  1275. <td nowrap class="warning"><b><?php echo $_lang["new_folder_permissions_title"]?></b></td>
  1276. <td>
  1277. <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" ; ?>" />
  1278. </td>
  1279. </tr>
  1280. <tr>
  1281. <td width="200">&nbsp;</td>
  1282. <td class='comment'><?php echo $_lang["new_folder_permissions_message"]?></td>
  1283. </tr>
  1284. <tr>
  1285. <td colspan="2"><div class='split'></div></td>
  1286. <tr class='row1'>
  1287. <td colspan="2">
  1288. <?php
  1289. // invoke OnMiscSettingsRender event
  1290. $evtOut = $modx->invokeEvent("OnMiscSettingsRender");
  1291. if(is_array($evtOut)) echo implode("",$evtOut);
  1292. ?>
  1293. </td>
  1294. </tr>
  1295. </table>
  1296. </div>
  1297. </div>
  1298. </div>
  1299. </form>
  1300. <?php
  1301. /**
  1302. * get_lang_keys
  1303. *
  1304. * @return array of keys from a language file
  1305. */
  1306. function get_lang_keys($filename) {
  1307. $file = MODX_MANAGER_PATH.'includes/lang' . DIRECTORY_SEPARATOR . $filename;
  1308. if(is_file($file) && is_readable($file)) {
  1309. include($file);
  1310. return array_keys($_lang);
  1311. } else {
  1312. return array();
  1313. }
  1314. }
  1315. /**
  1316. * get_langs_by_key
  1317. *
  1318. * @return array of languages that define the key in their file
  1319. */
  1320. function get_langs_by_key($key) {
  1321. global $lang_keys;
  1322. $lang_return = array();
  1323. foreach($lang_keys as $lang=>$keys) {
  1324. if(in_array($key, $keys)) {
  1325. $lang_return[] = $lang;
  1326. }
  1327. }
  1328. return $lang_return;
  1329. }
  1330. /**
  1331. * get_lang_options
  1332. *
  1333. * returns html option list of languages
  1334. *
  1335. * @param string $key specify language key to return options of langauges that override it, default return all languages
  1336. * @param string $selected_lang specify language to select in option list, default none
  1337. * @return html option list
  1338. */
  1339. function get_lang_options($key=null, $selected_lang=null) {
  1340. global $lang_keys, $_lang;
  1341. $lang_options = '';
  1342. if($key) {
  1343. $languages = get_langs_by_key($key);
  1344. sort($languages);
  1345. $lang_options .= '<option value="">'.$_lang['language_title'].'</option>';
  1346. foreach($languages as $language_name) {
  1347. $uclanguage_name = ucwords(str_replace("_", " ", $language_name));
  1348. $lang_options .= '<option value="'.$language_name.'">'.$uclanguage_name.'</option>';
  1349. }
  1350. return $lang_options;
  1351. } else {
  1352. $languages = array_keys($lang_keys);
  1353. sort($languages);
  1354. foreach($languages as $language_name) {
  1355. $uclanguage_name = ucwords(str_replace("_", " ", $language_name));
  1356. $sel = $language_name == $selected_lang ? ' selected="selected"' : '';
  1357. $lang_options .= '<option value="'.$language_name.'" '.$sel.'>'.$uclanguage_name.'</option>';
  1358. }
  1359. return $lang_options;
  1360. }
  1361. }
  1362. ?>