国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

238 lines
9.3KB

  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
  6. <title>系统配置参数</title>
  7. <script language="javascript" src="../static/js/dedeajax2.js"></script>
  8. <script language="javascript" src="../static/js/jquery.js"></script>
  9. <script language="javascript">
  10. var searchconfig = false;
  11. function Nav() {
  12. if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE';
  13. else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF';
  14. else return "OT";
  15. }
  16. function $Obj(objname) {
  17. return document.getElementById(objname);
  18. }
  19. function ShowConfig(em, allgr) {
  20. if (searchconfig) location.reload();
  21. for (var i = 1; i <= allgr; i++) {
  22. if (i == em) $Obj('td' + i).style.display = (Nav() == 'IE' ? 'block' : 'table');
  23. else $Obj('td' + i).style.display = 'none';
  24. }
  25. $Obj('addvar').style.display = 'none';
  26. }
  27. function ShowHide(objname) {
  28. var obj = $Obj(objname);
  29. if (obj.style.display != "none") obj.style.display = "none";
  30. else obj.style.display = (Nav() == 'IE' ? 'block' : 'table-row');
  31. }
  32. function backSearch() {
  33. location.reload();
  34. }
  35. function getSearch() {
  36. var searchKeywords = $Obj('keywds').value;
  37. var myajax = new DedeAjax($Obj('_search'));
  38. myajax.SendGet('sys_info.php?dopost=search&keywords=' + searchKeywords)
  39. $Obj('_searchback').innerHTML = '<input name="searchbackBtn" type="button" value="返回" id="searchbackBtn" onclick="backSearch()"/>'
  40. $Obj('_mainsearch').innerHTML = '';
  41. searchconfig = true;
  42. }
  43. function resetCookieEncode() {
  44. jQuery.get("sys_info.php?dopost=make_encode", function (data) {
  45. jQuery("#edit___cfg_cookie_encode").val(data);
  46. });
  47. }
  48. </script>
  49. <link rel="stylesheet" href="../static/css/bootstrap.min.css">
  50. <link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  51. <link href="css/base.css" rel="stylesheet" type="text/css">
  52. </head>
  53. <body background='images/allbg.gif' leftmargin='8' topmargin='8'>
  54. <div style="min-width:780px">
  55. <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D6D6D6" align="center" class="table maintable table-bordered mt-3">
  56. <tr>
  57. <td height="28" background="images/tbg.gif" style="padding-left:10px;"><b>DedeCMS系统配置参数:</b></td>
  58. </tr>
  59. <tr>
  60. <td height="24" bgcolor="#ffffff" align="center"><?php
  61. $ds = file(DEDEADMIN.'/inc/configgroup.txt');
  62. $totalGroup = count($ds);
  63. $i = 0;
  64. foreach($ds as $dl)
  65. {
  66. $dl = trim($dl);
  67. if(empty($dl)) continue;
  68. $dls = explode(',',$dl);
  69. $i++;
  70. if($i>1) echo " | <a href='javascript:ShowConfig($i,$totalGroup)'>{$dls[1]}</a> ";
  71. else{
  72. echo " <a href='javascript:ShowConfig($i,$totalGroup)'>{$dls[1]}</a> ";
  73. }
  74. }
  75. ?>
  76. | <a href="#" onClick="ShowHide('addvar')">添加新变量</a></td>
  77. </tr>
  78. <tr id="addvar" style="display:none">
  79. <td height="24" bgcolor="#ffffff" align="center">
  80. <form name="fadd" action="sys_info.php" method="post">
  81. <input type='hidden' name='dopost' value='add'>
  82. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>" />
  83. <table width="98%" border="0" cellspacing="0" cellpadding="0">
  84. <tr>
  85. <td width="12%" height="26">变量名称:</td>
  86. <td width="38%" align="left"><input name="nvarname" type="text" id="nvarname" class="npvar"
  87. style="width:80%" /></td>
  88. <td width="12%" align="center">变量值:</td>
  89. <td width="38%" align="left"><input name="nvarvalue" type="text" id="nvarvalue" class="npvar"
  90. style="width:80%" /></td>
  91. </tr>
  92. <tr>
  93. <td width="10%" height="26">变量类型:</td>
  94. <td colspan='3' align="left"><input name="vartype" type="radio" value="string" class='np'
  95. checked='checked' />
  96. 文本
  97. <input name="vartype" type="radio" value="number" class='np' />
  98. 数字
  99. <input type="radio" name="vartype" value="bool" class='np' />
  100. 布尔(Y/N)
  101. <input type="radio" name="vartype" value="bstring" class='np' />
  102. 多行文本 </td>
  103. </tr>
  104. <tr>
  105. <td height="26">参数说明:</td>
  106. <td align="left"><input type="text" name="varmsg" id="varmsg" class="npvar" style="width:80%" /></td>
  107. <td align="center">所属组:</td>
  108. <td align="left"><?php
  109. echo "<select name='vargroup' class='npvar'>\r\n";
  110. foreach($ds as $dl){
  111. $dl = trim($dl);
  112. if(empty($dl)) continue;
  113. $dls = explode(',',$dl);
  114. echo "<option value='{$dls[0]}'>{$dls[1]}</option>\r\n";
  115. }
  116. echo "</select>\r\n";
  117. ?>
  118. <button type="submit" class="btn btn-secondary btn-sm">保存变量</button>
  119. </td>
  120. </tr>
  121. </table>
  122. </form>
  123. </td>
  124. </tr>
  125. </table>
  126. <table width="98%" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px" bgcolor="#D6D6D6"
  127. align="center" class="table maintable table-bordered mt-3">
  128. <tr>
  129. <td height="28" align="right" background="images/tbg.gif" style="border:1px solid #cfcfcf;border-bottom:none;">
  130. &nbsp;&nbsp;&nbsp;配置搜索:
  131. <input type="text" name="keywds" id="keywds" />
  132. <button type="button" onclick="getSearch()" class="btn btn-secondary btn-sm">搜索</button>
  133. &nbsp;<span id="_searchback"></span></td>
  134. </tr>
  135. <tr>
  136. <td bgcolor="#FFFFFF" width="100%">
  137. <form action="sys_info.php" method="post" name="form1">
  138. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>" />
  139. <input type="hidden" name="dopost" value="save">
  140. <div id="_search"></div>
  141. <div id="_mainsearch">
  142. <?php
  143. $n = 0;
  144. if(!isset($gp)) $gp = 1;
  145. foreach($ds as $dl)
  146. {
  147. $dl = trim($dl);
  148. if(empty($dl)) continue;
  149. $dls = explode(',',$dl);
  150. $n++;
  151. ?>
  152. <table width="100%" style='<?php if($n!=$gp) echo "display:none"; ?>' id="td<?php echo $n?>" border="0"
  153. cellspacing="1" cellpadding="1" bgcolor="#cfcfcf">
  154. <tr align="center" bgcolor="#FBFCE2" >
  155. <td width="300">参数说明</td>
  156. <td>参数值</td>
  157. <td width="220">变量名</td>
  158. </tr>
  159. <?php
  160. $dsql->SetQuery("Select * From `#@__sysconfig` where groupid='{$dls[0]}' order by aid asc");
  161. $dsql->Execute();
  162. $i = 1;
  163. while($row = $dsql->GetArray())
  164. {
  165. if($i%2==0)
  166. {
  167. $bgcolor = "#F9FCEF";
  168. }
  169. else
  170. {
  171. $bgcolor = "#ffffff";
  172. }
  173. $i++;
  174. ?>
  175. <tr align="center" bgcolor="<?php echo $bgcolor?>">
  176. <td width="300"><?php echo $row['info']; ?>: </td>
  177. <td align="left" style="padding:8px;"><?php
  178. if($row['type']=='bool')
  179. {
  180. $c1='';
  181. $c2 = '';
  182. $row['value']=='Y' ? $c1=" checked" : $c2=" checked";
  183. echo "<label><input type='radio' class='np' name='edit___{$row['varname']}' value='Y'$c1> 是 </label> ";
  184. echo "<label><input type='radio' class='np' name='edit___{$row['varname']}' value='N'$c2> 否 </label> ";
  185. }else if($row['type']=='bstring')
  186. {
  187. echo "<textarea name='edit___{$row['varname']}' row='4' id='edit___{$row['varname']}' class='textarea_info' style='width:98%;height:50px'>".dede_htmlspecialchars($row['value'])."</textarea>";
  188. }else if($row['type']=='number')
  189. {
  190. echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:30%'>";
  191. }else
  192. {
  193. $addstr='';
  194. if ($row['varname']=='cfg_cookie_encode') {
  195. $addstr=' <a href="javascript:resetCookieEncode();" class="btn btn-secondary btn-sm">重新生成</a>';
  196. }
  197. echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value=\"".dede_htmlspecialchars($row['value'])."\" style='width:80%'>{$addstr}";
  198. }
  199. ?></td>
  200. <td><?php echo $row['varname']?></td>
  201. </tr>
  202. <?php
  203. }
  204. ?>
  205. </table>
  206. <?php
  207. }
  208. ?>
  209. </div>
  210. <table width="100%" border="0" cellspacing="1" cellpadding="1"
  211. style="border:1px solid #cfcfcf;border-top:none;" class="table table-borderless">
  212. <tr bgcolor="#F9FCEF">
  213. <td height="50" colspan="3">
  214. <table width="98%" border="0" cellspacing="1" cellpadding="1">
  215. <tr>
  216. <td width="11%">&nbsp;</td>
  217. <td width="11%">
  218. <button type="submit" class="btn btn-secondary">确定</button>
  219. </td>
  220. <td width="78%"><button type="button" onClick="document.form1.reset()" class="btn btn-secondary">重置</button></td>
  221. </tr>
  222. </table>
  223. </td>
  224. </tr>
  225. </table>
  226. </form>
  227. </td>
  228. </tr>
  229. </table>
  230. </div>
  231. </body>
  232. </html>