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