国内流行的内容管理系统(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.

241 lines
9.5KB

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