Ver código fonte

模板布局调整

pull/13/head
xushubieli 3 anos atrás
pai
commit
7a3923df51
4 arquivos alterados com 33 adições e 48 exclusões
  1. +1
    -1
      src/admin/css/base.css
  2. +15
    -17
      src/admin/module_main.php
  3. +14
    -26
      src/admin/module_upload.php
  4. +3
    -4
      src/admin/templets/module_main.htm

+ 1
- 1
src/admin/css/base.css
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 15
- 17
src/admin/module_main.php Ver arquivo

@@ -34,8 +34,7 @@ function ReWriteConfigAuto()
global $dsql;
$configfile = DEDEDATA.'/config.cache.inc.php';
if (!is_writeable($configfile)) {
echo "配置文件'{$configfile}'不支持写入,无法修改系统配置参数";
//ClearAllLink();
echo "配置文件 {$configfile} 不支持写入,无法修改系统配置参数";
exit();
}
$fp = fopen($configfile, 'w');
@@ -90,7 +89,6 @@ else if ($action == 'view_developoer') {
$offUrl = "<p>官方网址:<code>{$devInfo['offurl']}</code> <small>(复制在浏览器中打开)</small></p>";
}
$authAt = date("Y-m-d", $devInfo['auth_at']);

if (!isset($info['dev_id'])) {
$devInfo['realname'] = $devInfo['dev_name'] = $info['team']." <span style='color:#e74d58'>未认证</span>";
$authAt = "0000-00-00";
@@ -108,7 +106,7 @@ else if ($action == 'setup') {
ShowMsg("获取模块信息错误,模块文件可能被篡改", -1);
exit;
}
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br />(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$filelists = $dm->GetFileLists($hash);
$filelist = '';
$prvdirs = array();
@@ -186,7 +184,7 @@ else if ($action == 'setup') {
</td>
</tr>
<tr>
<td height='30'><b>目录权限检测:</b><br /> ../ 为根目录 <br /> ./ 表示当前目录</td>
<td height='30'><b>目录权限检测:</b><br> ../ 为根目录 <br> ./ 表示当前目录</td>
<td>$prvdir</td>
</tr>
<tr>
@@ -201,9 +199,9 @@ else if ($action == 'setup') {
<tr>
<td height='26'>对于已存在文件处理方法:</td>
<td>
<label><input name='isreplace' type='radio' value='1' checked='checked'>覆盖</label>
<label><input name='isreplace' type='radio' value='3'>覆盖,保留副本</label>
<label><input type='radio' name='isreplace' value='0'>保留旧文件</label>
<label><input name='isreplace' type='radio' value='1' checked='checked'> 覆盖</label>
<label><input name='isreplace' type='radio' value='3'> 覆盖,保留副本</label>
<label><input type='radio' name='isreplace' value='0'> 保留旧文件</label>
</td>
</tr>
</table>";
@@ -281,7 +279,7 @@ function DelModule();
else if ($action == 'del') {
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br />(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$dev_id = empty($infos['dev_id'])? "<a href='{$cfg_biz_dedebizUrl}/developer' target='_blank' class='btn btn-success btn-sm'>未认证</a>" : "{$infos['dev_id']} <a href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}' target='_blank' class='btn btn-success btn-sm'>未认证</a>";
$win = new OxWindow();
$win->Init("module_main.php", "js/blank.js", "post");
@@ -316,7 +314,7 @@ else if ($action == 'del') {
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
</tr>
<tr>
<td height='26' colspan='2'>删除模块仅删除这个模块的安装包文件,如果您已经安装,请执行<a href='module_main.php?hash={$hash}&action=uninstall'>卸载程序</a>来删除</td>
<td height='26' colspan='2'>删除模块仅删除这个模块的安装包文件,如果您已经安装,请执行<a href='module_main.php?hash={$hash}&action=uninstall'>卸载程序</a>来删除</td>
</tr>
</table>";
$win->AddMsgItem("<div style='padding-left:10px;line-height:150%'>$msg</div>");
@@ -338,7 +336,7 @@ else if ($action == 'uninstall') {
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
if ($infos['url'] == '') $infos['url'] = '&nbsp;';
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br />(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$filelists = $dm->GetFileLists($hash);
$filelist = '';
foreach ($filelists as $v) {
@@ -381,7 +379,7 @@ else if ($action == 'uninstall') {
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
</tr>
<tr>
<td height='26'>模块包含的文件:<br />(文件路径相对于当前目录)</td><td>&nbsp;</td>
<td height='26'>模块包含的文件:<br>(文件路径相对于当前目录)</td><td>&nbsp;</td>
</tr>
<tr>
<td height='160' colspan='2'>
@@ -391,8 +389,8 @@ else if ($action == 'uninstall') {
<tr>
<td height='26'>对于模块的文件处理方法:</td>
<td>
<label><input type='radio' name='isreplace' value='0' checked='checked'>手工删除文件,仅运行卸载程序</label>
<label><input name='isreplace' type='radio' value='2'>删除模块的所有文件</label>
<label><input type='radio' name='isreplace' value='0' checked='checked'> 手工删除文件,仅运行卸载程序</label>
<label><input name='isreplace' type='radio' value='2'> 删除模块的所有文件</label>
</td>
</tr>
</table>";
@@ -464,7 +462,7 @@ else if ($action == 'view') {
$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($hash);
if ($infos['url'] == '') $infos['url'] = '&nbsp;';
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br />(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)');
$filelists = $dm->GetFileLists($hash);
$filelist = '';
$setupinfo = '';
@@ -479,7 +477,7 @@ else if ($action == 'view') {
} else {
$setupinfo = "未安装 <a href='module_main.php?action=setup&hash={$hash}'>安装</a>";
}
$dev_id = empty($infos['dev_id'])? "<a href='module_main.php?action=setup&hash={$hash}' class='btn btn-success btn-sm'>安装</a> <a href='{$cfg_biz_dedebizUrl}/developer' target='_blank' class='btn btn-success btn-sm'>未认证</a>" : "{$infos['dev_id']} <a href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}' target='_blank' class='btn btn-success btn-sm'>未认证</a>";
$dev_id = empty($infos['dev_id'])? "<a href='module_main.php?action=setup&hash={$hash}' class='btn btn-success btn-sm'>安装</a><a href='{$cfg_biz_dedebizUrl}/developer' target='_blank' class='btn btn-success btn-sm' style='margin-left:6px'>未认证</a>" : "{$infos['dev_id']} <a href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}' target='_blank' class='btn btn-success btn-sm'>未认证</a>";
$win = new OxWindow();
$win->Init("", "js/blank.js", "");
$wecome_info = "模块管理";
@@ -511,7 +509,7 @@ else if ($action == 'view') {
<td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
</tr>
<tr>
<td height='26'>模块包含的文件:<br />(文件路径相对于当前目录)</td><td>&nbsp;</td>
<td height='26'>模块包含的文件:<br>(文件路径相对于当前目录)</td><td>&nbsp;</td>
</tr>
<tr>
<td height='160' colspan='2'>


+ 14
- 26
src/admin/module_upload.php Ver arquivo

@@ -14,16 +14,14 @@ require_once(dirname(__FILE__)."/../include/dedemodule.class.php");
require_once(dirname(__FILE__)."/../include/oxwindow.class.php");
if (empty($action)) $action = '';
$mdir = DEDEDATA.'/module';

if ($action == 'upload') {
if (!is_uploaded_file($upfile)) {
ShowMsg("貌似您什么都没有上传", "javascript:;");
ShowMsg("您什么都没有上传", "javascript:;");
exit();
} else {
include_once(dirname(__FILE__)."/../include/zip.class.php");
$tmpfilename = $mdir.'/'.ExecTime().mt_rand(10000, 50000).'.tmp';
move_uploaded_file($upfile, $tmpfilename) or die("把上传的文件移动到{$tmpfilename}时失败,请检查{$mdir}目录是否有写入权限");

move_uploaded_file($upfile, $tmpfilename) or die("把上传的文件移动到 {$tmpfilename} 时失败,请检查 {$mdir} 目录是否有写入权限");
//ZIP格式的文件
if ($filetype == 1) {
$z = new zip();
@@ -41,7 +39,7 @@ if ($action == 'upload') {
}
if ($dedefileindex == -1) {
unlink($tmpfilename);
ShowMsg("对不起,您上传的压缩包中不存在dede模块文件<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>", "javascript:;");
ShowMsg("对不起,您上传的压缩包中不存在dede模块文件<br><a href='javascript:history.go(-1);'>重新上传</a>", "javascript:;");
exit();
}
$ziptmp = $mdir.'/ziptmp';
@@ -49,24 +47,22 @@ if ($action == 'upload') {
unlink($tmpfilename);
$tmpfilename = $mdir."/ziptmp/".$dedefile;
}

$dm = new DedeModule($mdir);
$infos = $dm->GetModuleInfo($tmpfilename, 'file');
if (empty($infos['hash'])) {
unlink($tmpfilename);
$dm->Clear();
ShowMsg("对不起,您上传的文件可能不是织梦模块的标准格式文件<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>", "javascript:;");
ShowMsg("对不起,您上传的文件可能不是织梦模块的标准格式文件<br><a href='javascript:history.go(-1);'>重新上传</a>", "javascript:;");
exit();
}
if (preg_match("#[^0-9a-zA-Z]#", $infos['hash'])) {
exit("hash check failed!");
}
$okfile = $mdir.'/'.$infos['hash'].'.xml';
if ($dm->HasModule($infos['hash']) && empty($delhas)) {
unlink($tmpfilename);
$dm->Clear();
ShowMsg("对不起,您上传的模块已经存在<br />如果要覆盖请先删除原来版本或选择强制删除的选项<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>", "javascript:;");
ShowMsg("对不起,您上传的模块已经存在<br>如果要覆盖请先删除原来版本或选择强制删除的选项<br><a href='javascript:history.go(-1);'>重新上传</a>", "javascript:;");
exit();
}
@unlink($okfile);
@@ -83,32 +79,24 @@ if ($action == 'upload') {
$wecome_info = "<a href='module_main.php'>模块管理</a> &gt;&gt; 上传模块";
$win->AddTitle('请选择要上传的文件:');
$win->AddHidden("action", 'upload');
$msg = "
<table width='600' border='0' cellspacing='0' cellpadding='0'>
$msg = "<table width='600' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td height='30'>文件格式:</td>
<td height='26'>文件格式:</td>
<td>
<label><input name='filetype' type='radio' value='0' checked='checked' />
正常的模块包</label>
<label><input type='radio' name='filetype' value='1' />
经过 zip 压缩的模块包</label> </td>
<label><input name='filetype' type='radio' value='0' checked='checked' /> 正常的模块包</label>
<label><input type='radio' name='filetype' value='1' /> 经过 zip 压缩的模块包</label></td>
</tr>
<tr>
<td height='30'>已有模块:</td>
<td>
<label><input name='delhas' type='checkbox' id='delhas' value='1' /> 强制删除同名模块(这可能导致已经安装的模块无法卸载)</label>
</td>
<td height='26'>已有模块:</td>
<td><label><input name='delhas' type='checkbox' id='delhas' value='1' /> 强制删除同名模块(这可能导致已经安装的模块无法卸载)</label></td>
</tr>
<tr>
<td width='96' height='60'>请选择文件:</td>
<td width='504'>
<input name='upfile' type='file' id='upfile' style='width:380px' /> </td>
<td width='504'><input name='upfile' type='file' id='upfile' style='width:380px' /></td>
</tr>
</table>
";
</table>";
$win->AddMsgItem("<div style='padding-left:20px;line-height:150%;'>$msg</div>");
$winform = $win->GetWindow('ok', '');
$win->Display();
exit();
}
//ClearAllLink();
}//ClearAllLink();

+ 3
- 4
src/admin/templets/module_main.htm Ver arquivo

@@ -83,9 +83,8 @@
?>
</td>
<td>
<div id='manager_<?php echo $v['hash']; ?>'
<?php if(!file_exists(DEDEDATA."/module/{$v['hash']}.xml")) echo 'style="display:none;"'?>>
<a class="btn btn-success" href='module_main.php?action=view_developoer&hash=<?php echo $v['hash']; ?>'>开发者信息</a>
<div id='manager_<?php echo $v['hash']; ?>'<?php if(!file_exists(DEDEDATA."/module/{$v['hash']}.xml")) echo 'style="display:none;"'?>>
<a class="btn btn-success" href="module_main.php?action=view_developoer&hash=<?php echo $v['hash']; ?>" style="margin-right:6px">开发者信息</a>
<div class="btn-group" role="group">
<button id="btnAction" type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">操作</button>
<div class="dropdown-menu" aria-labelledby="btnAction">
@@ -102,7 +101,7 @@
}
?>
<tr>
<td colspan="7" align="center" bgcolor='#F9FCEF'>&nbsp;</td>
<td colspan="7" align="center" bgcolor='#F9FCEF'></td>
</tr>
</form>
</table>


Carregando…
Cancelar
Salvar