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

224 lines
9.7KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="<?php echo $cfg_soft_lang; ?>">
  5. <title>系统配置参数</title>
  6. <script src="../static/js/dedeajax2.js"></script>
  7. <script src="../static/js/jquery.js"></script>
  8. <script>
  9. var searchconfig = false;
  10. function Nav() {
  11. if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE';
  12. else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF';
  13. else return "OT";
  14. }
  15. function $Obj(objname) {
  16. return document.getElementById(objname);
  17. }
  18. function ShowConfig(em, allgr) {
  19. if (searchconfig) location.reload();
  20. for (var i = 1; i <= allgr; i++) {
  21. if (i == em) $Obj('td' + i).style.display = (Nav() == 'IE' ? 'block' : 'table');
  22. else $Obj('td' + i).style.display = 'none';
  23. }
  24. $Obj('addvar').style.display = 'none';
  25. }
  26. function ShowHide(objname) {
  27. var obj = $Obj(objname);
  28. if (obj.style.display != "none") obj.style.display = "none";
  29. else obj.style.display = (Nav() == 'IE' ? 'block' : 'table-row');
  30. }
  31. function backSearch() {
  32. location.reload();
  33. }
  34. function getSearch() {
  35. var searchKeywords = $Obj('keywds').value;
  36. searchKeywords = searchKeywords.replace(/^cfg_/, "");
  37. var myajax = new DedeAjax($Obj('_search'));
  38. myajax.SendGet('sys_info.php?dopost=search&keywords=' + searchKeywords)
  39. $Obj('_searchback').innerHTML = '<button class="btn btn-success btn-sm" name="searchbackBtn" type="button" id="searchbackBtn" onclick="backSearch()">返回</button>'
  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 rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css">
  51. <link rel="stylesheet" href="css/base.css">
  52. <style>
  53. .btn+.btn{margin-left:10px}
  54. </style>
  55. </head>
  56. <body background="images/allbg.gif" leftmargin="8" topmargin="8">
  57. <div style="min-width:780px">
  58. <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D6D6D6" align="center" class="table maintable table-bordered mt-3">
  59. <tr>
  60. <td height="30" background="images/tbg.gif" style="padding-left:10px"><b>系统配置参数:</b></td>
  61. </tr>
  62. <tr>
  63. <td height="30" bgcolor="#ffffff" align="left">
  64. <?php
  65. $ds = file(DEDEADMIN.'/inc/configgroup.txt');
  66. $totalGroup = count($ds);
  67. $i = 0;
  68. foreach($ds as $dl)
  69. {
  70. $dl = trim($dl);
  71. if(empty($dl)) continue;
  72. $dls = explode(',',$dl);
  73. $i++;
  74. if($i>1) echo "<a href='javascript:ShowConfig($i,$totalGroup)' class='btn btn-success btn-sm'>{$dls[1]}</a>";
  75. else {
  76. echo "<a href='javascript:ShowConfig($i,$totalGroup)' class='btn btn-success btn-sm'>{$dls[1]}</a>";
  77. }
  78. }
  79. ?>
  80. <a href="javascript:;" onClick="ShowHide('addvar')" class="btn btn-success btn-sm">添加新变量</a>
  81. </td>
  82. </tr>
  83. <tr id="addvar" style="display:none">
  84. <td height="26" bgcolor="#ffffff" align="center">
  85. <form name="fadd" action="sys_info.php" method="post">
  86. <input type='hidden' name='dopost' value='add'>
  87. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>" />
  88. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  89. <tr>
  90. <td width="12%" height="26">变量名称:</td>
  91. <td width="38%" align="left"><input name="nvarname" type="text" id="nvarname" class="npvar" style="width:80%" /></td>
  92. <td width="12%" align="center">变量值:</td>
  93. <td width="38%" align="left"><input name="nvarvalue" type="text" id="nvarvalue" class="npvar" style="width:80%" /></td>
  94. </tr>
  95. <tr>
  96. <td width="10%" height="26">变量类型:</td>
  97. <td colspan='3' align="left"><input name="vartype" type="radio" value="string" class='np' 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">
  111. <?php
  112. echo "<select name='vargroup' class='npvar'>\r\n";
  113. foreach($ds as $dl){
  114. $dl = trim($dl);
  115. if(empty($dl)) continue;
  116. $dls = explode(',',$dl);
  117. echo "<option value='{$dls[0]}'>{$dls[1]}</option>\r\n";
  118. }
  119. echo "</select>\r\n";
  120. ?>
  121. <button type="submit" class="btn btn-success btn-sm">保存变量</button>
  122. </td>
  123. </tr>
  124. </table>
  125. </form>
  126. </td>
  127. </tr>
  128. </table>
  129. <table width="98%" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px" bgcolor="#D6D6D6" 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;配置搜索:
  133. <input type="text" name="keywds" id="keywds" />
  134. <button type="button" onclick="getSearch()" class="btn btn-success btn-sm">搜索</button>
  135. &nbsp;<span id="_searchback"></span>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td bgcolor="#FFFFFF" width="100%">
  140. <form action="sys_info.php" method="post" name="form1">
  141. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>" />
  142. <input type="hidden" name="dopost" value="save">
  143. <div id="_search"></div>
  144. <div id="_mainsearch">
  145. <?php
  146. $n = 0;
  147. if(!isset($gp)) $gp = 1;
  148. foreach($ds as $dl)
  149. {
  150. $dl = trim($dl);
  151. if(empty($dl)) continue;
  152. $dls = explode(',',$dl);
  153. $n++;
  154. ?>
  155. <table width="100%" style="<?php if($n!=$gp) echo 'display:none'; ?>" id="td<?php echo $n?>" border="0" 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. } else {
  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">
  178. <?php
  179. if($row['type']=='bool')
  180. {
  181. $c1='';
  182. $c2 = '';
  183. $row['value']=='Y' ? $c1=" checked" : $c2=" checked";
  184. echo "<label><input type='radio' class='np' name='edit___{$row['varname']}' value='Y'$c1> 是 </label> ";
  185. echo "<label><input type='radio' class='np' name='edit___{$row['varname']}' value='N'$c2> 否 </label> ";
  186. } else if($row['type']=='bstring') {
  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. echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:30%'>";
  190. } else {
  191. $addstr='';
  192. if ($row['varname']=='cfg_cookie_encode') {
  193. $addstr=' <a href="javascript:resetCookieEncode();" class="btn btn-success btn-sm">重新生成</a>';
  194. }
  195. echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value=\"".dede_htmlspecialchars($row['value'])."\" style='width:80%'>{$addstr}";
  196. }
  197. ?>
  198. </td>
  199. <td><?php echo $row['varname']?></td>
  200. </tr>
  201. <?php
  202. }
  203. ?>
  204. </table>
  205. <?php
  206. }
  207. ?>
  208. </div>
  209. <table width="100%" border="0" cellspacing="1" cellpadding="1" style="border:1px solid #cfcfcf;border-top:none" class="table table-borderless">
  210. <tr bgcolor="#F9FCEF">
  211. <td width="4%"></td>
  212. <td width="96%">
  213. <button type="submit" class="btn btn-success">确定</button>&nbsp;
  214. <button type="button" onClick="document.form1.reset()" class="btn btn-success">重置</button>
  215. </td>
  216. </tr>
  217. </table>
  218. </form>
  219. </td>
  220. </tr>
  221. </table>
  222. </div>
  223. </body>
  224. </html>