@@ -1,5 +1,4 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 图片选择框 | * 图片选择框 | ||||
* | * | ||||
@@ -25,8 +24,6 @@ if (strlen($activepath) < strlen($cfg_medias_dir)) { | |||||
} | } | ||||
$inpath = $cfg_basedir . $activepath; | $inpath = $cfg_basedir . $activepath; | ||||
$activeurl = '..' . $activepath; | $activeurl = '..' . $activepath; | ||||
if (empty($f)) { | if (empty($f)) { | ||||
$f = 'form1.picname'; | $f = 'form1.picname'; | ||||
} | } | ||||
@@ -45,124 +42,106 @@ if (!empty($CKEditor)) { | |||||
if (!empty($CKEditorFuncNum)) { | if (!empty($CKEditorFuncNum)) { | ||||
$addparm .= '&CKEditorFuncNum=' . $CKEditorFuncNum; | $addparm .= '&CKEditorFuncNum=' . $CKEditorFuncNum; | ||||
} | } | ||||
if (!empty($noeditor)) { | if (!empty($noeditor)) { | ||||
$addparm .= '&noeditor=yes'; | $addparm .= '&noeditor=yes'; | ||||
} | } | ||||
?> | ?> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta http-equiv='Content-Type' content='text/html; charset=<?php echo $cfg_soft_lang; ?>'> | |||||
<meta charset="<?php echo $cfg_soft_lang; ?>"> | |||||
<title>图片浏览器</title> | <title>图片浏览器</title> | ||||
<link rel="stylesheet" href="../../static/css/bootstrap.min.css"> | <link rel="stylesheet" href="../../static/css/bootstrap.min.css"> | ||||
<link href="../../static/font-awesome/css/font-awesome.min.css" rel="stylesheet"> | |||||
<link href='../css/base.css' rel='stylesheet' type='text/css'> | |||||
<link rel="stylesheet" href="../../static/font-awesome/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../css/base.css"> | |||||
<style> | <style> | ||||
.linerow { | |||||
border-bottom: 1px solid #CBD8AC; | |||||
} | |||||
.napisdiv { | |||||
left: 40; | |||||
top: 3; | |||||
width: 150px; | |||||
height: 100px; | |||||
position: absolute; | |||||
z-index: 3; | |||||
display: none; | |||||
} | |||||
html{background:#f2f2f2} | |||||
body{margin:0;line-height:22px;font:12px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif} | |||||
a{text-decoration:none!important} | |||||
table{background:#fff} | |||||
.bg{margin:10px;border-radius:2px;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.linerow{border-bottom:1px solid #eee!important} | |||||
.napisdiv{left:40;top:10;width:150px;height:100px;position:absolute;z-index:3;display:none} | |||||
</style> | </style> | ||||
<script> | <script> | ||||
function nullLink() { | |||||
return; | |||||
} | |||||
function ChangeImage(surl) { | |||||
document.getElementById('picview').src = surl; | |||||
} | |||||
function nullLink() { | |||||
return; | |||||
} | |||||
function ChangeImage(surl) { | |||||
document.getElementById('picview').src = surl; | |||||
} | |||||
</script> | </script> | ||||
</head> | </head> | ||||
<body background='img/allbg.gif' leftmargin='0' topmargin='0'> | |||||
<body class="bg"> | |||||
<div id="floater" class="napisdiv"> | <div id="floater" class="napisdiv"> | ||||
<a href="javascript:nullLink();" onClick="document.getElementById('floater').style.display='none';"><img src='img/picviewnone.gif' id='picview' border='0' alt='单击关闭预览'></a> | |||||
<a href="javascript:nullLink();" onClick="document.getElementById('floater').style.display='none';"><img src='img/picviewnone.gif' id='picview' border='0' alt='关闭预览'></a> | |||||
</div> | </div> | ||||
<SCRIPT language=JavaScript src="../js/float.js"></SCRIPT> | |||||
<SCRIPT language=JavaScript> | |||||
function nullLink() { | |||||
return; | |||||
} | |||||
function ChangeImage(surl) { | |||||
document.getElementById('floater').style.display = 'block'; | |||||
document.getElementById('picview').src = surl; | |||||
} | |||||
function TNav() { | |||||
if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; | |||||
else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; | |||||
else return "OT"; | |||||
} | |||||
// 获取地址参数 | |||||
function getUrlParam(paramName) { | |||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i'); | |||||
var match = window.location.search.match(reParam); | |||||
return (match && match.length > 1) ? match[1] : ''; | |||||
<script src="../js/float.js"></script> | |||||
<script> | |||||
function nullLink() { | |||||
return; | |||||
} | |||||
function ChangeImage(surl) { | |||||
document.getElementById('floater').style.display = 'block'; | |||||
document.getElementById('picview').src = surl; | |||||
} | |||||
function TNav() { | |||||
if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; | |||||
else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; | |||||
else return "OT"; | |||||
} | |||||
//获取地址参数 | |||||
function getUrlParam(paramName) { | |||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i'); | |||||
var match = window.location.search.match(reParam); | |||||
return (match && match.length > 1) ? match[1] : ''; | |||||
} | |||||
function ReturnImg(reimg) { | |||||
var funcNum = getUrlParam('CKEditorFuncNum'); | |||||
if (funcNum > 1) { | |||||
var fileUrl = reimg; | |||||
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl); | |||||
} | } | ||||
function ReturnImg(reimg) { | |||||
var funcNum = getUrlParam('CKEditorFuncNum'); | |||||
if (funcNum > 1) { | |||||
var fileUrl = reimg; | |||||
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl); | |||||
} | |||||
if (window.opener.document.<?php echo $f ?> != null) { | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
if (window.opener.document.getElementById('div<?php echo $v ?>')) { | |||||
if (TNav() == 'IE') { | |||||
//window.opener.document.getElementById('div<?php echo $v ?>').filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = reimg; | |||||
window.opener.document.getElementById('div<?php echo $v ?>').src = reimg; | |||||
window.opener.document.getElementById('div<?php echo $v ?>').style.width = '150px'; | |||||
window.opener.document.getElementById('div<?php echo $v ?>').style.height = '100px'; | |||||
} else | |||||
window.opener.document.getElementById('div<?php echo $v ?>').style.backgroundImage = "url(" + reimg + ")"; | |||||
if (window.opener.document.<?php echo $f ?> != null) { | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
if (window.opener.document.getElementById('div<?php echo $v ?>')) { | |||||
if (TNav() == 'IE') { | |||||
//window.opener.document.getElementById('div<?php echo $v ?>').filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = reimg; | |||||
window.opener.document.getElementById('div<?php echo $v ?>').src = reimg; | |||||
window.opener.document.getElementById('div<?php echo $v ?>').style.width = '150px'; | |||||
window.opener.document.getElementById('div<?php echo $v ?>').style.height = '100px'; | |||||
} else | |||||
window.opener.document.getElementById('div<?php echo $v ?>').style.backgroundImage = "url(" + reimg + ")"; | |||||
} else if (window.opener.document.getElementById('<?php echo $v ?>')) { | } else if (window.opener.document.getElementById('<?php echo $v ?>')) { | ||||
window.opener.document.getElementById('<?php echo $v ?>').src = reimg; | |||||
} | |||||
// 适配新的缩略图 | |||||
if (window.opener.document.getElementById('litPic')) { | |||||
window.opener.document.getElementById('litPic').src = reimg; | |||||
} | |||||
if (document.all) window.opener = true; | |||||
window.opener.document.getElementById('<?php echo $v ?>').src = reimg; | |||||
} | |||||
//适配新的缩略图 | |||||
if (window.opener.document.getElementById('litPic')) { | |||||
window.opener.document.getElementById('litPic').src = reimg; | |||||
} | } | ||||
window.close(); | |||||
if (document.all) window.opener = true; | |||||
} | } | ||||
</SCRIPT> | |||||
<table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#CBD8AC' class="table maintable table-borderless" style="margin:0 auto"> | |||||
<tr bgcolor='#FFFFFF'> | |||||
<td colspan='4'> | |||||
<table width='100%' border='0' cellspacing='0' cellpadding='2'> | |||||
<tr bgcolor="#CCCCCC"> | |||||
<td width="8%" align="center" class='linerow' bgcolor='#EEF4EA'><strong>预览</strong></td> | |||||
<td width="47%" align="center" background="img/wbg.gif" class='linerow'><strong>点击名称选择图片</strong></td> | |||||
<td width="15%" align="center" bgcolor='#EEF4EA' class='linerow'><strong>文件大小</strong></td> | |||||
<td width="30%" align="center" background="img/wbg.gif" class='linerow'><strong>最后修改时间</strong></td> | |||||
window.close(); | |||||
} | |||||
</script> | |||||
<table width="100%" border="0" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> | |||||
<tr> | |||||
<td colspan="4"> | |||||
<table width="100%" border="0" cellspacing="0" cellpadding="2"> | |||||
<tr> | |||||
<td width="10%" class="linerow">预览</td> | |||||
<td width="40%" class="linerow">选择图片</td> | |||||
<td width="20%" class="linerow">文件大小</td> | |||||
<td width="30%" class="linerow">修改时间</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td class='linerow' colspan='4' bgcolor='#F9FBF0'> | |||||
点击“V”预览图片,点击图片名选择图片,显示图片后点击该图片关闭预览。 | |||||
</td> | |||||
<td class="linerow" colspan="4">点击V预览图片,点击图片名选择图片,显示图片后点击该图片关闭预览</td> | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
$dh = dir($inpath); | $dh = dir($inpath); | ||||
$ty1 = ""; | $ty1 = ""; | ||||
$ty2 = ""; | $ty2 = ""; | ||||
while ($file = $dh->read()) { | while ($file = $dh->read()) { | ||||
//-----计算文件大小和创建时间 | |||||
//计算文件大小和创建时间 | |||||
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | ||||
$filesize = filesize("$inpath/$file"); | $filesize = filesize("$inpath/$file"); | ||||
$filesize = $filesize / 1024; | $filesize = $filesize / 1024; | ||||
@@ -175,96 +154,83 @@ if (!empty($noeditor)) { | |||||
$filesize = $ty1 . "." . substr($ty2, 0, 1); | $filesize = $ty1 . "." . substr($ty2, 0, 1); | ||||
} | } | ||||
$filetime = filemtime("$inpath/$file"); | $filetime = filemtime("$inpath/$file"); | ||||
$filetime = MyDate("Y-m-d H:i:s", $filetime); | |||||
$filetime = MyDate("Y-m-d H:i", $filetime); | |||||
} | } | ||||
if ($file == ".") continue; | if ($file == ".") continue; | ||||
else if ($file == "..") { | else if ($file == "..") { | ||||
if ($activepath == "") continue; | if ($activepath == "") continue; | ||||
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | ||||
$line = "\n<tr> | $line = "\n<tr> | ||||
<td class='linerow' colspan='2'> | |||||
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=" . urlencode($tmp) . $addparm . "'><img src=img/dir2.gif border=0 width=16 height=16 align=absmiddle>上级目录</a></td> | |||||
<td colspan='2' class='linerow'> 当前目录:$activepath</td> | |||||
</tr> | |||||
"; | |||||
<td class='linerow' colspan='2'> | |||||
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=" . urlencode($tmp) . $addparm . "'><img src='img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>"; | |||||
echo $line; | echo $line; | ||||
} else if (is_dir("$inpath/$file")) { | } else if (is_dir("$inpath/$file")) { | ||||
if (preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录 | if (preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录 | ||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | if (preg_match("#^\.(.*)$#i", $file)) continue; | ||||
$line = "\n<tr> | $line = "\n<tr> | ||||
<td bgcolor='#F9FBF0' class='linerow' colspan='2'> | |||||
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=" . urlencode("$activepath/$file") . $addparm . "'><img src=img/dir.gif border=0 width=16 height=16 align=absmiddle>$file</a></td> | |||||
<td class='linerow'> </td> | |||||
<td bgcolor='#F9FBF0' class='linerow'> </td> | |||||
</tr>"; | |||||
<td class='linerow' colspan='2'> | |||||
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=" . urlencode("$activepath/$file") . $addparm . "'><img src='img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | |||||
<td class='linerow'></td> | |||||
</tr>"; | |||||
echo "$line"; | echo "$line"; | ||||
} else if (preg_match("#\.(" . $cfg_imgtype . ")#i", $file)) { | } else if (preg_match("#\.(" . $cfg_imgtype . ")#i", $file)) { | ||||
$reurl = "$activeurl/$file"; | $reurl = "$activeurl/$file"; | ||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
$reurl = $reurl; | $reurl = $reurl; | ||||
if ($file == $comeback) $lstyle = " style='color:red' "; | if ($file == $comeback) $lstyle = " style='color:red' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "\n<tr> | $line = "\n<tr> | ||||
<td align='center' class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif' width='16' height='16' border='0' align=absmiddle></a> | |||||
</td> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src=img/gif.gif border=0 width=16 height=16 align=absmiddle>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif'></a> | |||||
</td> | |||||
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='img/gif.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | echo "$line"; | ||||
} else if (preg_match("#\.(jpg)#i", $file)) { | } else if (preg_match("#\.(jpg)#i", $file)) { | ||||
$reurl = "$activeurl/$file"; | $reurl = "$activeurl/$file"; | ||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
$reurl = $reurl; | $reurl = $reurl; | ||||
if ($file == $comeback) $lstyle = " style='color:red' "; | if ($file == $comeback) $lstyle = " style='color:red' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "\n<tr> | $line = "\n<tr> | ||||
<td align='center' class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif' width='16' height='16' border='0' align=absmiddle></a> | |||||
</td> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src=img/jpg.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif'></a></td> | |||||
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='img/jpg.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | echo "$line"; | ||||
} | } | ||||
} //End Loop | } //End Loop | ||||
$dh->close(); | $dh->close(); | ||||
?> | ?> | ||||
<tr> | <tr> | ||||
<td colspan='4' bgcolor='#E8F1DE'> | |||||
<table width='100%'> | |||||
<form action='select_images_post.php' method='POST' enctype="multipart/form-data" name='myform'> | |||||
<td colspan="4"> | |||||
<table width="100%"> | |||||
<form action="select_images_post.php" method="POST" enctype="multipart/form-data" name="myform"> | |||||
<?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; | <?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; | ||||
echo $noeditor; ?> | echo $noeditor; ?> | ||||
<input type='hidden' name='activepath' value='<?php echo $activepath ?>'> | |||||
<input type='hidden' name='f' value='<?php echo $f ?>'> | |||||
<input type='hidden' name='v' value='<?php echo $v ?>'> | |||||
<input type='hidden' name='imgstick' value='<?php echo $imgstick ?>'> | |||||
<input type='hidden' name='CKEditorFuncNum' value='<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>'> | |||||
<input type='hidden' name='job' value='upload'> | |||||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | |||||
<input type="hidden" name="f" value="<?php echo $f ?>"> | |||||
<input type="hidden" name="v" value="<?php echo $v ?>"> | |||||
<input type="hidden" name="imgstick" value="<?php echo $imgstick ?>"> | |||||
<input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>"> | |||||
<input type="hidden" name="job" value="upload"> | |||||
<tr> | <tr> | ||||
<td background="img/tbg.gif" bgcolor="#99CC00"> | |||||
上 传: <input type='file' name='imgfile' style='width:200px' /> | |||||
<label><input type='checkbox' name='needwatermark' value='1' class='np' <?php if ($photo_markup == '1') echo "checked"; ?> /> 水印 </label> | |||||
<label><input type='checkbox' name='resize' value='1' class='np' /> 缩小 </label> | |||||
宽:<input type='text' style='width:46px' name='iwidth' value='<?php echo $cfg_ddimg_width ?>' /> | |||||
高:<input type='text' style='width:46px' name='iheight' value='<?php echo $cfg_ddimg_height ?>' /> | |||||
<button type='submit' name='sb1' class="btn btn-success btn-sm">确定</button> | |||||
<td> | |||||
上传:<input type="file" name="imgfile" style="width:160px"> | |||||
<label><input type="checkbox" name="needwatermark" value="1" class="np" <?php if ($photo_markup == '1') echo "checked"; ?> /> 水印 </label> | |||||
<label><input type="checkbox" name="resize" value="1" class="np"> 缩小 </label> | |||||
宽:<input type="text" name="iwidth" value="<?php echo $cfg_ddimg_width ?>" style="width:46px"> | |||||
高:<input type="text" name="iheight" value="<?php echo $cfg_ddimg_height ?>" style="width:46px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">确定</button> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</form> | </form> | ||||
</table> | </table> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -272,5 +238,4 @@ if (!empty($noeditor)) { | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
</body> | </body> | ||||
</html> | </html> |
@@ -1,5 +1,4 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 软件选择框 | * 软件选择框 | ||||
* | * | ||||
@@ -41,73 +40,69 @@ if (!empty($noeditor)) { | |||||
} | } | ||||
?> | ?> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta http-equiv='Content-Type' content='text/html; charset=<?php echo $cfg_soft_lang; ?>'> | |||||
<meta charset="<?php echo $cfg_soft_lang; ?>"> | |||||
<title>软件管理器</title> | <title>软件管理器</title> | ||||
<link rel="stylesheet" href="../../static/css/bootstrap.min.css"> | <link rel="stylesheet" href="../../static/css/bootstrap.min.css"> | ||||
<link href="../../static/font-awesome/css/font-awesome.min.css" rel="stylesheet"> | |||||
<link href='../css/base.css' rel='stylesheet' type='text/css'> | |||||
<link rel="stylesheet" href="../../static/font-awesome/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../css/base.css"> | |||||
<style> | <style> | ||||
.linerow { | |||||
border-bottom: 1px solid #CBD8AC; | |||||
} | |||||
html{background:#f2f2f2} | |||||
body{margin:0;line-height:22px;font:12px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif} | |||||
a{text-decoration:none!important} | |||||
table{background:#fff} | |||||
.bg{margin:10px;border-radius:2px;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.linerow{border-bottom:1px solid #eee!important} | |||||
</style> | </style> | ||||
</head> | </head> | ||||
<body background='img/allbg.gif' leftmargin='5' topmargin='0'> | |||||
<SCRIPT language='JavaScript'> | |||||
function nullLink() { | |||||
return; | |||||
<body class="bg"> | |||||
<script> | |||||
function nullLink() { | |||||
return; | |||||
} | |||||
function ReturnValue(reimg) { | |||||
if (window.opener.document.<?php echo $f ?> != null) { | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
} | |||||
var funcNum = <?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>; | |||||
if (window.opener.CKEDITOR != null && funcNum != 1) { | |||||
window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | |||||
} | } | ||||
function ReturnValue(reimg) { | |||||
if (window.opener.document.<?php echo $f ?> != null) { | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
} | |||||
var funcNum = <?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>; | |||||
if (window.opener.CKEDITOR != null && funcNum != 1) { | |||||
window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | |||||
} | |||||
if (window.opener.CKEDITOR.instances.<?php echo $f ?>) { | |||||
let addonHTML = `<a href='${reimg}' target='_blank'><img src='<?php echo $cfg_cmspath ?>/static/img/addon.gif' border='0' />附件:${reimg}</a>`; | |||||
window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | |||||
} | |||||
window.close(); | |||||
if (window.opener.CKEDITOR.instances.<?php echo $f ?>) { | |||||
let addonHTML = `<a href='${reimg}' target='_blank'><img src='<?php echo $cfg_cmspath ?>/static/img/addon.gif'>附件:${reimg}</a>`; | |||||
window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | |||||
} | } | ||||
</SCRIPT> | |||||
<table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#CBD8AC' align="center" class="table maintable table-borderless"> | |||||
window.close(); | |||||
} | |||||
</script> | |||||
<table width="100%" border="0" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> | |||||
<tr> | <tr> | ||||
<td colspan='3' bgcolor='#E8F1DE' background="img/tbg.gif" height='28'> | |||||
<form action='select_soft_post.php' method='POST' enctype="multipart/form-data" name='myform'> | |||||
<input type='hidden' name='activepath' value='<?php echo $activepath ?>' /> | |||||
<input type='hidden' name='f' value='<?php echo $f ?>' /> | |||||
<input type='hidden' name='job' value='upload' /> | |||||
上 传: <input type='file' name='uploadfile' size='25' /> | |||||
<td colspan="3" height="30"> | |||||
<form action="select_soft_post.php" method="POST" enctype="multipart/form-data" name='myform'> | |||||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | |||||
<input type="hidden" name="f" value="<?php echo $f ?>"> | |||||
<input type="hidden" name="job" value="upload"> | |||||
上传:<input type="file" name="uploadfile" size="24"> | |||||
| | ||||
改 名:<input type='test' name='newname' style='width:90px' /> | |||||
改名:<input type="text" name="newname" style="width:160px"> | |||||
| | ||||
<button type='submit' name='sb1' class="btn btn-success btn-sm">确定</button> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">确定</button> | |||||
</form> | </form> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr bgcolor='#FFFFFF'> | |||||
<td colspan='3'> | |||||
<!-- 开始文件列表 --> | |||||
<table width='100%' border='0' cellspacing='0' cellpadding='2'> | |||||
<tr bgcolor="#CCCCCC" height="24"> | |||||
<td width="55%" align="center" background="img/wbg.gif" class='linerow'><strong>点击名称选择文件</strong></td> | |||||
<td width="15%" align="center" bgcolor='#EEF4EA' class='linerow'><strong>文件大小</strong></td> | |||||
<td width="30%" align="center" background="img/wbg.gif" class='linerow'><strong>最后修改时间</strong></td> | |||||
<tr> | |||||
<td colspan="3"> | |||||
<table width="100%" border="0" cellspacing="0" cellpadding="2"> | |||||
<tr height="28"> | |||||
<td width="50%" class="linerow">选择文件</td> | |||||
<td width="20%" class="linerow">文件大小</td> | |||||
<td width="30%" class="linerow">修改时间</td> | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
$dh = dir($inpath); | $dh = dir($inpath); | ||||
$ty1 = $ty2 = ''; | $ty1 = $ty2 = ''; | ||||
while ($file = $dh->read()) { | while ($file = $dh->read()) { | ||||
//-----计算文件大小和创建时间 | |||||
//计算文件大小和创建时间 | |||||
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | ||||
$filesize = filesize("$inpath/$file"); | $filesize = filesize("$inpath/$file"); | ||||
$filesize = $filesize / 1024; | $filesize = $filesize / 1024; | ||||
@@ -120,76 +115,61 @@ if (!empty($noeditor)) { | |||||
$filesize = $ty1 . "." . substr($ty2, 0, 1); | $filesize = $ty1 . "." . substr($ty2, 0, 1); | ||||
} | } | ||||
$filetime = filemtime("$inpath/$file"); | $filetime = filemtime("$inpath/$file"); | ||||
$filetime = MyDate("Y-m-d H:i:s", $filetime); | |||||
$filetime = MyDate("Y-m-d H:i", $filetime); | |||||
} | } | ||||
//------判断文件类型并作处理 | |||||
//判断文件类型并作处理 | |||||
if ($file == ".") continue; | if ($file == ".") continue; | ||||
else if ($file == "..") { | else if ($file == "..") { | ||||
if ($activepath == "") continue; | if ($activepath == "") continue; | ||||
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | ||||
$line = "\n<tr height='24'> | |||||
<td class='linerow'> <a href='select_soft.php?f=$f&activepath=" . urlencode($tmp) . $addparm . "'><img src=img/dir2.gif border=0 width=16 height=16 align=absmiddle>上级目录</a></td> | |||||
<td colspan='2' class='linerow'> 当前目录:$activepath</td> | |||||
</tr>\r\n"; | |||||
$line = "\n<tr height='28'> | |||||
<td class='linerow'><a href='select_soft.php?f=$f&activepath=" . urlencode($tmp) . $addparm . "'><img src='img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>\r\n"; | |||||
echo $line; | echo $line; | ||||
} else if (is_dir("$inpath/$file")) { | } else if (is_dir("$inpath/$file")) { | ||||
if (preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录 | if (preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录 | ||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | if (preg_match("#^\.(.*)$#i", $file)) continue; | ||||
$line = "\n<tr height='24'> | |||||
<td bgcolor='#F9FBF0' class='linerow'> | |||||
<a href=select_soft.php?f=$f&activepath=" . urlencode("$activepath/$file") . $addparm . "><img src=img/dir.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>-</td> | |||||
<td bgcolor='#F9FBF0' class='linerow'>-</td> | |||||
</tr>"; | |||||
$line = "\n<tr height='28'> | |||||
<td class='linerow'><a href=select_soft.php?f=$f&activepath=" . urlencode("$activepath/$file") . $addparm . "><img src='img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | |||||
<td class='linerow'></td> | |||||
</tr>"; | |||||
echo "$line"; | echo "$line"; | ||||
} else if (preg_match("#\.(zip|rar|tgr.gz)#i", $file)) { | } else if (preg_match("#\.(zip|rar|tgr.gz)#i", $file)) { | ||||
if ($file == $comeback) $lstyle = " style='color:red' "; | if ($file == $comeback) $lstyle = " style='color:red' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$reurl = "$activeurl/$file"; | $reurl = "$activeurl/$file"; | ||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
$reurl = $reurl; | $reurl = $reurl; | ||||
$line = "\n<tr height='24'> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/zip.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
$line = "\n<tr height='28'> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/zip.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | echo "$line"; | ||||
} else { | } else { | ||||
if ($file == $comeback) $lstyle = " style='color:red' "; | if ($file == $comeback) $lstyle = " style='color:red' "; | ||||
else $lstyle = ''; | else $lstyle = ''; | ||||
$reurl = "$activeurl/$file"; | $reurl = "$activeurl/$file"; | ||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
$reurl = $reurl; | $reurl = $reurl; | ||||
$line = "\n<tr height='24'> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/exe.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
$line = "\n<tr height='28'> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/exe.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | echo "$line"; | ||||
} | } | ||||
} //End Loop | |||||
}//End Loop | |||||
$dh->close(); | $dh->close(); | ||||
?> | ?> | ||||
<!-- 文件列表完 --> | |||||
</table> | </table> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td colspan='3' bgcolor='#E8F1DE' height='26'> 请点击要选择的文件,红色字样的为刚上传的文件。</td> | |||||
<td colspan="3" height="30">请点击要选择的文件,红色字样的为刚上传的文件</td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
</body> | </body> | ||||
</html> | </html> |
@@ -1,5 +1,4 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 模板选择框 | * 模板选择框 | ||||
* | * | ||||
@@ -11,235 +10,192 @@ | |||||
*/ | */ | ||||
require_once(dirname(__FILE__) . "/config.php"); | require_once(dirname(__FILE__) . "/config.php"); | ||||
if (empty($activepath)) { | if (empty($activepath)) { | ||||
$activepath = ''; | |||||
$activepath = ''; | |||||
} | } | ||||
$cfg_txttype = 'htm|html|tpl|txt|dtp'; | $cfg_txttype = 'htm|html|tpl|txt|dtp'; | ||||
$activepath = str_replace('.', '', $activepath); | $activepath = str_replace('.', '', $activepath); | ||||
$activepath = preg_replace("#\/{1,}#", '/', $activepath); | $activepath = preg_replace("#\/{1,}#", '/', $activepath); | ||||
$templetdir = $cfg_templets_dir; | $templetdir = $cfg_templets_dir; | ||||
if (strlen($activepath) < strlen($templetdir)) { | if (strlen($activepath) < strlen($templetdir)) { | ||||
$activepath = $templetdir; | |||||
$activepath = $templetdir; | |||||
} | } | ||||
$inpath = $cfg_basedir . $activepath; | $inpath = $cfg_basedir . $activepath; | ||||
$activeurl = '..' . $activepath; | $activeurl = '..' . $activepath; | ||||
if (!is_dir($inpath)) { | if (!is_dir($inpath)) { | ||||
die('No Exsits Path'); | |||||
die('No Exsits Path'); | |||||
} | } | ||||
if (empty($f)) { | if (empty($f)) { | ||||
$f = 'form1.enclosure'; | |||||
$f = 'form1.enclosure'; | |||||
} | } | ||||
if (empty($comeback)) { | if (empty($comeback)) { | ||||
$comeback = ''; | |||||
$comeback = ''; | |||||
} | } | ||||
?> | ?> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta http-equiv='Content-Type' content='text/html; charset=<?php echo $cfg_soft_lang; ?>'> | |||||
<title>模板管理器</title> | |||||
<link rel="stylesheet" href="../../static/css/bootstrap.min.css"> | |||||
<link href="../../static/font-awesome/css/font-awesome.min.css" rel="stylesheet"> | |||||
<link href='../css/base.css' rel='stylesheet' type='text/css'> | |||||
<style> | |||||
.linerow { | |||||
border-bottom: 1px solid #CBD8AC; | |||||
} | |||||
</style> | |||||
<meta charset="<?php echo $cfg_soft_lang; ?>"> | |||||
<title>模板管理器</title> | |||||
<link rel="stylesheet" href="../../static/css/bootstrap.min.css"> | |||||
<link rel="stylesheet" href="../../static/font-awesome/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../css/base.css"> | |||||
<style> | |||||
html{background:#f2f2f2} | |||||
body{margin:0;line-height:22px;font:12px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif} | |||||
a{text-decoration:none!important} | |||||
table{background:#fff} | |||||
.bg{margin:10px;border-radius:2px;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.linerow{border-bottom:1px solid #eee!important} | |||||
</style> | |||||
</head> | </head> | ||||
<body background='img/allbg.gif' leftmargin='0' topmargin='0'> | |||||
<SCRIPT language='JavaScript'> | |||||
<body class="bg"> | |||||
<script> | |||||
function nullLink() { | function nullLink() { | ||||
return; | |||||
return; | |||||
} | } | ||||
function ReturnValue(reimg) { | function ReturnValue(reimg) { | ||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
if (document.all) window.opener = true; | |||||
window.close(); | |||||
window.opener.document.<?php echo $f ?>.value = reimg; | |||||
if (document.all) window.opener = true; | |||||
window.close(); | |||||
} | } | ||||
</SCRIPT> | |||||
<!-- 开始文件列表 --> | |||||
<table width='100%' border='0' align="center" cellspacing='0' cellpadding='2' class="table maintable table-bordered mt-3"> | |||||
<tr bgcolor="#CCCCCC"> | |||||
<td width="55%" align="center" background="img/wbg.gif" class='linerow'><strong>点击名称选择文件</strong></td> | |||||
<td width="15%" align="center" bgcolor='#EEF4EA' class='linerow'><strong>文件大小</strong></td> | |||||
<td width="30%" align="center" background="img/wbg.gif" class='linerow'><strong>最后修改时间</strong></td> | |||||
</tr> | |||||
<?php | |||||
$dh = dir($inpath); | |||||
$ty1 = ""; | |||||
$ty2 = ""; | |||||
while ($file = $dh->read()) { | |||||
//-----计算文件大小和创建时间 | |||||
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | |||||
$filesize = filesize("$inpath/$file"); | |||||
$filesize = $filesize / 1024; | |||||
if ($filesize != "") | |||||
if ($filesize < 0.1) { | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1 . "." . substr($ty2, 0, 2); | |||||
} else { | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1 . "." . substr($ty2, 0, 1); | |||||
} | |||||
$filetime = filemtime("$inpath/$file"); | |||||
$filetime = MyDate("Y-m-d H:i:s", $filetime); | |||||
} | |||||
//------判断文件类型并作处理 | |||||
if ($file == ".") continue; | |||||
else if ($file == "..") { | |||||
if ($activepath == "") continue; | |||||
$tmp = preg_replace("#[\/][^\/]*$#", "", $activepath); | |||||
$line = "\n<tr> | |||||
<td class='linerow'> <a href='select_templets.php?f=$f&activepath=" . urlencode($tmp) . "'><img src=img/dir2.gif border=0 width=16 height=16 align=absmiddle>上级目录</a></td> | |||||
<td colspan='2' class='linerow'> 当前目录:$activepath</td> | |||||
</tr>\r\n"; | |||||
echo $line; | |||||
} else if (is_dir("$inpath/$file")) { | |||||
if (preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录 | |||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | |||||
$line = "\n<tr> | |||||
<td bgcolor='#F9FBF0' class='linerow'> | |||||
<a href=select_templets.php?f=$f&activepath=" . urlencode("$activepath/$file") . "><img src=img/dir.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>-</td> | |||||
<td bgcolor='#F9FBF0' class='linerow'>-</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(htm|html)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/htm.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(css)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/css.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(js)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/js.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(jpg)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/jpg.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(gif|png)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/gif.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(txt)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow' bgcolor='#F9FBF0'> | |||||
<a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src=img/txt.gif border=0 width=16 height=16 align=absmiddle>$file</a> | |||||
</td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} | |||||
} //End Loop | |||||
$dh->close(); | |||||
?> | |||||
<!-- 文件列表完 --> | |||||
<tr> | |||||
<td colspan='3' bgcolor='#E8F1DE'> | |||||
<table width='100%'> | |||||
<form action='select_templets_post.php' method='POST' enctype="multipart/form-data" name='myform'> | |||||
<input type='hidden' name='activepath' value='<?php echo $activepath ?>'> | |||||
<input type='hidden' name='f' value='<?php echo $f ?>'> | |||||
<input type='hidden' name='job' value='upload'> | |||||
</script> | |||||
<table width="100%" border="0" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> | |||||
<tr> | |||||
<td width="50%" class="linerow">选择文件</td> | |||||
<td width="20%" class="linerow">文件大小</td> | |||||
<td width="30%" class="linerow">修改时间</td> | |||||
</tr> | |||||
<?php | |||||
$dh = dir($inpath); | |||||
$ty1 = ""; | |||||
$ty2 = ""; | |||||
while ($file = $dh->read()) { | |||||
//计算文件大小和创建时间 | |||||
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | |||||
$filesize = filesize("$inpath/$file"); | |||||
$filesize = $filesize / 1024; | |||||
if ($filesize != "") | |||||
if ($filesize < 0.1) { | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1 . "." . substr($ty2, 0, 2); | |||||
} else { | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1 . "." . substr($ty2, 0, 1); | |||||
} | |||||
$filetime = filemtime("$inpath/$file"); | |||||
$filetime = MyDate("Y-m-d H:i", $filetime); | |||||
} | |||||
//判断文件类型并作处理 | |||||
if ($file == ".") continue; | |||||
else if ($file == "..") { | |||||
if ($activepath == "") continue; | |||||
$tmp = preg_replace("#[\/][^\/]*$#", "", $activepath); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href='select_templets.php?f=$f&activepath=" . urlencode($tmp) . "'><img src='img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>\r\n"; | |||||
echo $line; | |||||
} else if (is_dir("$inpath/$file")) { | |||||
if (preg_match("#^_(.*)$#i", $file)) continue; | |||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=select_templets.php?f=$f&activepath=" . urlencode("$activepath/$file") . "><img src='img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | |||||
<td class='linerow'></td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(htm|html)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/htm.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(css)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/css.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(js)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/js.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(jpg)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/jpg.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(gif|png)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/gif.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(txt)#i", $file)) { | |||||
if ($file == $comeback) $lstyle = " style='color:red' "; | |||||
else $lstyle = ""; | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||||
$reurl = preg_replace("#" . $templetdir . "\/#", "", $reurl); | |||||
$line = "\n<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='img/txt.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td class='linerow'>$filetime</td></tr>"; | |||||
echo "$line"; | |||||
} | |||||
}//End Loop | |||||
$dh->close(); | |||||
?> | |||||
<tr> | <tr> | ||||
<td background="img/tbg.gif" bgcolor="#99CC00"> | |||||
上 传: <input type='file' name='uploadfile' style='width:320px'> | |||||
改名:<input type='text' name='filename' value='' style='width:100px'> | |||||
<button type='submit' name='sb1' class="btn btn-success btn-sm">确定</button> | |||||
</td> | |||||
<td colspan="3"> | |||||
<table width="100%"> | |||||
<form action="select_templets_post.php" method="POST" enctype="multipart/form-data" name="myform"> | |||||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | |||||
<input type="hidden" name="f" value='<?php echo $f ?>'> | |||||
<input type="hidden" name="job" value="upload"> | |||||
<tr> | |||||
<td> | |||||
上传:<input type="file" name="uploadfile" style="width:260px"> | |||||
改名:<input type="text" name="filename" style="width:160px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">确定</button> | |||||
</td> | |||||
</tr> | |||||
</form> | |||||
</table> | |||||
</td> | |||||
</tr> | </tr> | ||||
</form> | |||||
</table> | </table> | ||||
</td> | |||||
</tr> | |||||
</table> | |||||
</body> | |||||
</body> | |||||
</html> | </html> |
@@ -1,144 +1,110 @@ | |||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | ||||
<title>DedeBIZ menu</title> | <title>DedeBIZ menu</title> | ||||
<link rel="stylesheet" href="css/base.css" type="text/css" /> | <link rel="stylesheet" href="css/base.css" type="text/css" /> | ||||
<script language="javascript" type="text/javascript" src="../static/js/dedeajax2.js"></script> | <script language="javascript" type="text/javascript" src="../static/js/dedeajax2.js"></script> | ||||
<script src="../static/js/jquery.js" language="javascript" type="text/javascript"></script> | <script src="../static/js/jquery.js" language="javascript" type="text/javascript"></script> | ||||
<?php | <?php | ||||
echo "<script language='javascript'>var curopenItem = '$openitem';</script>\r\n"; | |||||
?> | |||||
echo "<script language='javascript'>var curopenItem = '$openitem';</script>"; | |||||
?> | |||||
<script language="javascript" type="text/javascript" src="js/leftmenu.js"></script> | <script language="javascript" type="text/javascript" src="js/leftmenu.js"></script> | ||||
<style> | <style> | ||||
div { | |||||
padding: 0px; | |||||
margin: 0px; | |||||
} | |||||
.sitemu a { | |||||
font-size: 13px; | |||||
color: rgba(0, 0, 0, .65); | |||||
} | |||||
body { | |||||
padding: 0px; | |||||
margin: auto; | |||||
text-align: center; | |||||
background-color: #eff5ed; | |||||
background: url(images/leftmenu_bg.gif); | |||||
padding-left: 3px; | |||||
overflow: scroll; | |||||
overflow-x: hidden; | |||||
scrollbar-face-color: #eff8e6; | |||||
scrollbar-shadow-color: #edf2e3; | |||||
scrollbar-highlight-color: #ffffff; | |||||
scrollbar-3dlight-color: #F2F2F2; | |||||
scrollbar-darkshadow-color: #bdbcbd; | |||||
scrollbar-arrow-color: #bdbcbd | |||||
} | |||||
dl.bitem { | |||||
clear: both; | |||||
width: 140px; | |||||
margin: 0px 0px 5px 12px; | |||||
background: url(images/menunewbg.gif) repeat-x; | |||||
} | |||||
dl.bitem2 { | |||||
clear: both; | |||||
width: 140px; | |||||
margin: 0px 0px 5px 12px; | |||||
background: url(images/menunewbg2.gif) repeat-x; | |||||
} | |||||
dl.bitem dt, | |||||
dl.bitem2 dt { | |||||
height: 25px; | |||||
line-height: 25px; | |||||
padding-left: 35px; | |||||
cursor: pointer; | |||||
} | |||||
dl.bitem dt b, | |||||
dl.bitem2 dt b { | |||||
color: #4D6C2F; | |||||
} | |||||
dl.bitem dd, | |||||
dl.bitem2 dd { | |||||
padding: 3px 3px 3px 3px; | |||||
background-color: #fff; | |||||
} | |||||
div.items { | |||||
clear: both; | |||||
padding: 0px; | |||||
height: 0px; | |||||
} | |||||
.fllct { | |||||
float: left; | |||||
width: 85px; | |||||
} | |||||
.flrct { | |||||
padding-top: 5px; | |||||
float: left; | |||||
} | |||||
.sitemu li { | |||||
padding: 2px 0px 2px 18px; | |||||
line-height: 22px; | |||||
background: url(images/arr4.gif) no-repeat 5px 9px; | |||||
} | |||||
ul { | |||||
padding-top: 3px; | |||||
} | |||||
li { | |||||
height: 22px; | |||||
} | |||||
a.mmac div { | |||||
background: url(images/leftbg2.gif) no-repeat; | |||||
height: 37px !important; | |||||
height: 47px; | |||||
padding: 6px 4px 4px 10px; | |||||
word-wrap: break-word; | |||||
word-break: break-all; | |||||
font-weight: bold; | |||||
color: #325304; | |||||
} | |||||
a.mm div { | |||||
background: url(images/leftmbg1.gif) no-repeat; | |||||
height: 37px !important; | |||||
height: 47px; | |||||
padding: 6px 4px 4px 10px; | |||||
word-wrap: break-word; | |||||
word-break: break-all; | |||||
font-weight: bold; | |||||
color: #475645; | |||||
cursor: pointer; | |||||
} | |||||
a.mm:hover div { | |||||
background: url(images/leftbg2.gif) no-repeat; | |||||
color: #4F7632; | |||||
} | |||||
.mmf { | |||||
height: 1px; | |||||
padding: 5px 7px 5px 7px; | |||||
} | |||||
#mainct { | |||||
padding-top: 8px; | |||||
background: url(images/idnbg1.gif) repeat-y; | |||||
} | |||||
body { | |||||
margin:0; | |||||
background:#f2f2f2 url(images/leftmenu_bg.gif); | |||||
padding-left:6px; | |||||
overflow:scroll; | |||||
overflow-x:hidden | |||||
} | |||||
div { | |||||
padding:0; | |||||
margin:0 | |||||
} | |||||
.sitemu a { | |||||
font-size:12px; | |||||
color:rgba(0,0,0,.65) | |||||
} | |||||
dl.bitem { | |||||
clear:both; | |||||
width:140; | |||||
margin:0 0 5px 12px; | |||||
background:url(images/menunewbg.gif) repeat-x | |||||
} | |||||
dl.bitem2 { | |||||
clear:both; | |||||
width:140; | |||||
margin:0 0 5px 12px; | |||||
background:url(images/menunewbg2.gif) repeat-x | |||||
} | |||||
dl.bitem dt,dl.bitem2 dt { | |||||
height:25px; | |||||
line-height:25px; | |||||
padding-left:35px; | |||||
cursor:pointer | |||||
} | |||||
dl.bitem dt b,dl.bitem2 dt b { | |||||
color:#4D6C2F | |||||
} | |||||
dl.bitem dd,dl.bitem2 dd { | |||||
padding:6px; | |||||
background-color:#fff | |||||
} | |||||
div.items { | |||||
clear:both; | |||||
padding:0; | |||||
height:0 | |||||
} | |||||
.fllct { | |||||
float:left; | |||||
width:80px | |||||
} | |||||
.flrct { | |||||
padding-top:2px; | |||||
float:left | |||||
} | |||||
.sitemu li { | |||||
padding:2px 0 2px 18px; | |||||
line-height:22px; | |||||
background:url(images/arr4.gif) no-repeat 5px 9px | |||||
} | |||||
ul { | |||||
padding-top:6px | |||||
} | |||||
li { | |||||
height:22px | |||||
} | |||||
a.mmac div { | |||||
background:url(images/leftbg2.gif) no-repeat; | |||||
height:38px!important; | |||||
padding:8px 4px 4px 10; | |||||
word-wrap:break-word; | |||||
word-break:break-all; | |||||
font-weight:bold; | |||||
color:#325304 | |||||
} | |||||
a.mm div { | |||||
background:url(images/leftmbg1.gif) no-repeat; | |||||
height:38px!important; | |||||
padding:8px 4px 4px 10; | |||||
word-wrap:break-word; | |||||
word-break:break-all; | |||||
font-weight:bold; | |||||
color:#475645; | |||||
cursor:pointer | |||||
} | |||||
a.mm:hover div { | |||||
background:url(images/leftbg2.gif) no-repeat; | |||||
color:#4F7632 | |||||
} | |||||
.mmf { | |||||
height:1px; | |||||
padding:5px 7px 5px 7px | |||||
} | |||||
#mainct { | |||||
padding-top:8px; | |||||
background:url(images/idnbg1.gif) repeat-y | |||||
} | |||||
</style> | </style> | ||||
<link href="images/style<?php echo $cfg_admin_skin;?>/style.css" rel="stylesheet" type="text/css" /> | <link href="images/style<?php echo $cfg_admin_skin;?>/style.css" rel="stylesheet" type="text/css" /> | ||||
<base target="main" /> | <base target="main" /> | ||||
@@ -147,7 +113,7 @@ echo "<script language='javascript'>var curopenItem = '$openitem';</script>\r\n" | |||||
<body target="main" onLoad="CheckOpenMenu();"> | <body target="main" onLoad="CheckOpenMenu();"> | ||||
<table width="180" align="left" border='0' cellspacing='0' cellpadding='0' style="text-align:left;"> | <table width="180" align="left" border='0' cellspacing='0' cellpadding='0' style="text-align:left;"> | ||||
<tr> | <tr> | ||||
<td valign='top' style='padding-top:10px' width='20'><a id='link1' class='mmac'> | |||||
<td valign='top' style='padding-top:10' width='20'><a id='link1' class='mmac'> | |||||
<div onClick="ShowMainMenu(1)">核心</div> | <div onClick="ShowMainMenu(1)">核心</div> | ||||
</a> <a id='link100' class='mm'> | </a> <a id='link100' class='mm'> | ||||
<div onClick="ShowMainMenu(100)">模块</div> | <div onClick="ShowMainMenu(100)">模块</div> | ||||