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

514 lines
20KB

  1. <?php
  2. /**
  3. * 模块管理
  4. *
  5. * @version $id:module_main.php 14:17 2010年7月20日 tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2022 DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. if (DEDEBIZ_SAFE_MODE) {
  13. die(DedeAlert("系统已启用安全模式,无法使用当前功能",ALERT_DANGER));
  14. }
  15. CheckPurview('sys_module');
  16. require_once(DEDEINC."/dedemodule.class.php");
  17. require_once(DEDEINC."/libraries/oxwindow.class.php");
  18. if (empty($action)) $action = '';
  19. $mdir = DEDEDATA.'/module';
  20. $mdurl = "";
  21. function TestWriteAble($d)
  22. {
  23. $tfile = '_dedet.txt';
  24. $d = preg_replace("#\/$#", '', $d);
  25. $fp = @fopen($d.'/'.$tfile, 'w');
  26. if (!$fp) return FALSE;
  27. else {
  28. fclose($fp);
  29. $rs = @unlink($d.'/'.$tfile);
  30. if ($rs) return TRUE;
  31. else return FALSE;
  32. }
  33. }
  34. function ReWriteConfigAuto()
  35. {
  36. global $dsql;
  37. $configfile = DEDEDATA.'/config.cache.inc.php';
  38. if (!is_writeable($configfile)) {
  39. echo "配置文件<span class='text-primary'>{$configfile}</span>不支持写入,无法修改系统配置参数";
  40. exit();
  41. }
  42. $fp = fopen($configfile, 'w');
  43. flock($fp, 3);
  44. fwrite($fp, "<"."?php\r\n");
  45. $dsql->SetQuery("SELECT `varname`,`type`,`value`,`groupid` FROM `#@__sysconfig` ORDER BY aid ASC ");
  46. $dsql->Execute();
  47. while ($row = $dsql->GetArray()) {
  48. if (empty($row['value']) && $row['type'] == 'number') $row['value'] = 0;
  49. if ($row['type'] == 'number') fwrite($fp, "\${$row['varname']} = ".$row['value'].";\r\n");
  50. else fwrite($fp, "\${$row['varname']} = '".str_replace("'", '', $row['value'])."';\r\n");
  51. }
  52. fwrite($fp, "?".">");
  53. fclose($fp);
  54. }
  55. if ($action == '') {
  56. $types = array('soft' => '模块', 'templets' => '模板', 'plus' => '小插件', 'patch' => '补丁');
  57. $dm = new DedeModule($mdir);
  58. if (empty($moduletype)) $moduletype = '';
  59. $modules_remote = $dm->GetModuleUrlList($moduletype, $mdurl);
  60. $modules = array();
  61. $modules = $dm->GetModuleList($moduletype);
  62. is_array($modules) || $modules = array();
  63. if (is_array($modules_remote) && count($modules_remote) > 0) {
  64. $modules = array_merge($modules, $modules_remote);
  65. }
  66. require_once(dirname(__FILE__)."/templets/module_main.htm");
  67. $dm->Clear();
  68. exit();
  69. } else if ($action == 'view_developoer') {
  70. //检验开发者信息
  71. $dm = new DedeModule($mdir);
  72. $info = $dm->GetModuleInfo($hash);
  73. if ($info == null) {
  74. ShowMsg("获取模块信息错误,模块文件错误", -1);
  75. exit;
  76. }
  77. $dev_id = $info['dev_id'];
  78. $devURL = DEDECDNURL."/developers/$dev_id.json";
  79. $dhd = new DedeHttpDown();
  80. $dhd->OpenUrl($devURL);
  81. $devContent = $dhd->GetHtml();
  82. $devInfo = (array)json_decode($devContent);
  83. $offUrl = "";
  84. if ($devInfo['dev_type'] == 1) {
  85. $offUrl = "<p>官方网址:<code>{$devInfo['offurl']}</code></p>";
  86. }
  87. $authAt = date("Y-m-d", $devInfo['auth_at']);
  88. if (!isset($info['dev_id'])) {
  89. $devInfo['dev_name'] = $info['team']."<span class='btn btn-danger btn-sm'>未认证</span>";
  90. $authAt = "未知";
  91. }
  92. ShowMsg("<p>开发者名称:{$devInfo['dev_name']}</p><p>开发者id:{$devInfo['dev_id']}</p><span>认证于:{$authAt}</span>", "-1");
  93. exit;
  94. } else if ($action == 'setup') {
  95. $dm = new DedeModule($mdir);
  96. $infos = $dm->GetModuleInfo($hash);
  97. if ($infos == null) {
  98. ShowMsg("获取模块信息错误,模块文件错误", -1);
  99. exit;
  100. }
  101. $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>该模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性');
  102. $filelists = (array)$dm->GetFileLists($hash);
  103. $filelist = '';
  104. $prvdirs = array();
  105. $incdir = array();
  106. foreach ($filelists as $v) {
  107. if (empty($v['name'])) continue;
  108. if ($v['type'] == 'dir') {
  109. $v['type'] = '目录';
  110. $incdir[] = $v['name'];
  111. } else {
  112. $v['type'] = '文件';
  113. }
  114. $filelist .= "{$v['type']}|{$v['name']}\r\n";
  115. }
  116. //检测需要的目录权限
  117. foreach ($filelists as $v) {
  118. $prvdir = preg_replace("#\/([^\/]*)$#", '/', $v['name']);
  119. if (!preg_match("#^\.#", $prvdir)) $prvdir = './';
  120. $n = TRUE;
  121. foreach ($incdir as $k => $v) {
  122. if (preg_match("#^".$v."#i", $prvdir)) {
  123. $n = FALSE;
  124. break;
  125. }
  126. }
  127. if (!isset($prvdirs[$prvdir]) && $n && is_dir($prvdir)) {
  128. $prvdirs[$prvdir][0] = 1;
  129. $prvdirs[$prvdir][1] = TestWriteAble($prvdir);
  130. }
  131. }
  132. $prvdir = "<table>\r\n";
  133. $prvdir .= "<tr bgcolor='#e9ecef'><td width='260'>目录</td><td align='center'>可写</td></tr>\r\n";
  134. foreach ($prvdirs as $k => $v) {
  135. if ($v) $cw = "<span class='text-success'><i class='fa fa-check'></i></span>";
  136. else $cw = "<span class='text-danger'><i class='fa fa-times'></i></span>";
  137. $prvdir .= "<tr><td>$k</td><td align='center'>$cw</td></tr>";
  138. }
  139. $prvdir .= "</table>";
  140. $win = new OxWindow();
  141. $win->Init("module_main.php", "js/blank.js", "post");
  142. $wecome_info = "模块管理";
  143. $devURL = DEDECDNURL."/developers/{$infos['dev_id']}.json";
  144. $dhd = new DedeHttpDown();
  145. $dhd->OpenUrl($devURL);
  146. $devContent = $dhd->GetHtml();
  147. $devInfo = (array)json_decode($devContent);
  148. $s = "未认证";
  149. if (($devInfo['dev_id'] == $infos['dev_id']) && !empty($devInfo['dev_id'])) {
  150. $s = "已认证";
  151. }
  152. $win->AddTitle("<a href='module_main.php'>模块管理</a> - 安装{$infos['name']}");
  153. $win->AddHidden("hash", $hash);
  154. $win->AddHidden("action", 'setupstart');
  155. $msg = "<table class='table'>
  156. <tr>
  157. <td colspan='2'>
  158. <div class='alert alert-danger mb-0'>安装时文件列表中涉及的目录前可写入权限,此外后台管理目录和主题目录也必须暂时设置可写入权限</div>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td width='260'>模块名称:</td>
  163. <td>{$infos['name']}</td>
  164. </tr>
  165. <tr>
  166. <td>语言:</td>
  167. <td>{$infos['lang']} {$alertMsg}</td>
  168. </tr>
  169. <tr>
  170. <td>文件大小:</td>
  171. <td>{$infos['filesize']}</td>
  172. </tr>
  173. <tr>
  174. <td>开发者id:</td>
  175. <td>{$infos['dev_id']} <a href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}' target='_blank' class='btn btn-success btn-sm'>{$s}</a></td>
  176. </tr>
  177. <tr>
  178. <td>发布时间:</td>
  179. <td>{$infos['time']}</td>
  180. </tr>
  181. <tr>
  182. <td>使用协议:</td>
  183. <td><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
  184. </tr>
  185. <tr>
  186. <td>目录权限说明:<br>../为根目录<br>./表示当前目录</td>
  187. <td>$prvdir</td>
  188. </tr>
  189. <tr>
  190. <td>模块包含的所有文件列表:</td>
  191. <td><textarea name='filelists' id='filelists' class='admin-textarea-xl'>{$filelist}</textarea></td>
  192. </tr>
  193. <tr>
  194. <td>对于已存在文件处理方法:</td>
  195. <td>
  196. <label><input type='radio' name='isreplace' value='1' checked='checked'> 覆盖</label>
  197. <label><input type='radio' name='isreplace' value='3'> 覆盖,保留副本</label>
  198. <label><input type='radio' name='isreplace' value='0'> 保留旧文件</label>
  199. </td>
  200. </tr>
  201. </table>";
  202. $win->AddMsgItem("$msg");
  203. $winform = $win->GetWindow("ok", "");
  204. $win->Display();
  205. $dm->Clear();
  206. exit();
  207. } else if ($action == 'setupstart') {
  208. if (!is_writeable($mdir)) {
  209. ShowMsg("目录<span class='text-primary'>{$mdir}</span>不支持写入,这导致程序安装没法正常创建", "-1");
  210. exit();
  211. }
  212. $dm = new DedeModule($mdir);
  213. $minfos = (array)$dm->GetModuleInfo($hash);
  214. extract($minfos, EXTR_SKIP);
  215. $menustring = addslashes($dm->GetSystemFile($hash, 'menustring'));
  216. $indexurl = str_replace('**', '=', $indexurl);
  217. $query = "INSERT INTO `#@__sys_module` (`hashcode`,`modname`,`indexname`,`indexurl`,`ismember`,`menustring` ) VALUES ('$hash','$name','$indexname','$indexurl','$ismember','$menustring' ) ";
  218. $rs = $dsql->ExecuteNoneQuery("DELETE FROM `#@__sys_module` WHERE hashcode LIKE '$hash' ");
  219. $rs = $dsql->ExecuteNoneQuery($query);
  220. if (!$rs) {
  221. ShowMsg('保存数据库信息失败,无法完成安装'.$dsql->GetError(), 'javascript:;');
  222. exit();
  223. }
  224. $dm->WriteFiles($hash, $isreplace);
  225. $filename = '';
  226. if (!isset($autosetup) || $autosetup == 0) $filename = $dm->WriteSystemFile($hash, 'setup');
  227. if (!isset($autodel) || $autodel == 0) $dm->WriteSystemFile($hash, 'uninstall');
  228. $dm->WriteSystemFile($hash, 'readme');
  229. $dm->Clear();
  230. //用模块的程序安装安装
  231. if (!isset($autosetup) || $autosetup == 0) {
  232. include(DEDEDATA.'/module/'.$filename);
  233. exit();
  234. }
  235. //系统自动安装
  236. else {
  237. $mysql_version = $dsql->GetVersion(TRUE);
  238. //默认使用MySQL 4.1 以下版本的SQL语句,对大于4.1版本采用替换处理 TYPE=MyISAM ==> ENGINE=MyISAM DEFAULT CHARSET=#~lang~#
  239. $setupsql = $dm->GetSystemFile($hash, 'setupsql40');
  240. $setupsql = preg_replace("#ENGINE=MyISAM#i", 'TYPE=MyISAM', $setupsql);
  241. $sql41tmp = 'ENGINE=MyISAM DEFAULT CHARSET='.$cfg_db_language;
  242. if ($mysql_version >= 4.1) {
  243. $setupsql = preg_replace("#TYPE=MyISAM#i", $sql41tmp, $setupsql);
  244. }
  245. //_ROOTURL_
  246. if ($cfg_cmspath == '/') $cfg_cmspath = '';
  247. $rooturl = $cfg_basehost.$cfg_cmspath;
  248. $setupsql = preg_replace("#_ROOTURL_#i", $rooturl, $setupsql);
  249. $setupsql = preg_replace("#[\r\n]{1,}#", "\n", $setupsql);
  250. $sqls = @split(";[ \t]{0,}\n", $setupsql);
  251. foreach ($sqls as $sql) {
  252. if (trim($sql) != '') $dsql->ExecuteNoneQuery($sql);
  253. }
  254. ReWriteConfigAuto();
  255. $rflwft = "<script>\r\n";
  256. $rflwft .= "if (window.navigator.userAgent.indexOf('MSIE')>=1) top.document.frames.menu.location = 'index_menu.php';\r\n";
  257. $rflwft .= "else top.document.getElementsByName('menu').src = 'index_menu.php';\r\n";
  258. $rflwft .= "</script>";
  259. echo $rflwft;
  260. UpDateCatCache();
  261. ShowMsg('模块安装完成', 'module_main.php');
  262. exit();
  263. }
  264. } else if ($action == 'del') {
  265. $dm = new DedeModule($mdir);
  266. $infos = $dm->GetModuleInfo($hash);
  267. $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>该模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性');
  268. $dev_id = empty($infos['dev_id'])? "<a href='{$cfg_biz_dedebizUrl}/developer' target='_blank' class='btn btn-danger 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>";
  269. $win = new OxWindow();
  270. $win->Init("module_main.php", "js/blank.js", "post");
  271. $wecome_info = "模块管理";
  272. $win->AddTitle("<a href='module_main.php'>模块管理</a> - 删除{$infos['name']}");
  273. $win->AddHidden('hash', $hash);
  274. $win->AddHidden('action', 'delok');
  275. $msg = "<table class='table'>
  276. <tr>
  277. <td width='260'>模块名称:</td>
  278. <td>{$infos['name']}</td>
  279. </tr>
  280. <tr>
  281. <td>语言:</td>
  282. <td>{$infos['lang']} {$alertMsg}</td>
  283. </tr>
  284. <tr>
  285. <td>文件大小:</td>
  286. <td>{$infos['filesize']}</td>
  287. </tr>
  288. <tr>
  289. <td>开发者id:</td>
  290. <td>{$dev_id}</td>
  291. </tr>
  292. <tr>
  293. <td>发布时间:</td>
  294. <td>{$infos['time']}</td>
  295. </tr>
  296. <tr>
  297. <td>使用协议:</td>
  298. <td><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
  299. </tr>
  300. <tr>
  301. <td colspan='2'>删除模块仅删除这个模块的安装包文件,如果您已经安装,请执行<a href='module_main.php?hash={$hash}&action=uninstall'>卸载程序</a>来删除</td>
  302. </tr>
  303. </table>";
  304. $win->AddMsgItem("$msg");
  305. $winform = $win->GetWindow("ok", "");
  306. $win->Display();
  307. $dm->Clear();
  308. exit();
  309. } else if ($action == 'delok') {
  310. $dm = new DedeModule($mdir);
  311. $modfile = $mdir."/".$dm->GetHashFile($hash);
  312. unlink($modfile) or die("删除文件<span class='text-primary'>{$modfile}</span>失败");
  313. ShowMsg("成功删除一个模块文件", "module_main.php");
  314. exit();
  315. } else if ($action == 'uninstall') {
  316. $dm = new DedeModule($mdir);
  317. $infos = $dm->GetModuleInfo($hash);
  318. if ($infos['url'] == '') $infos['url'] = ' ';
  319. $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>该模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性');
  320. $filelists = (array)$dm->GetFileLists($hash);
  321. $filelist = '';
  322. foreach ($filelists as $v) {
  323. if (empty($v['name'])) continue;
  324. if ($v['type'] == 'dir') $v['type'] = '目录';
  325. else $v['type'] = '文件';
  326. $filelist .= "{$v['type']}|{$v['name']}\r\n";
  327. }
  328. $dev_id = empty($infos['dev_id'])? "<a href='{$cfg_biz_dedebizUrl}/developer' target='_blank' class='btn btn-danger 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>";
  329. $win = new OxWindow();
  330. $win->Init("module_main.php", "js/blank.js", "post");
  331. $wecome_info = "模块管理";
  332. $win->AddTitle("<a href='module_main.php'>模块管理</a> - 卸载{$infos['name']}");
  333. $win->AddHidden("hash", $hash);
  334. $win->AddHidden("action", 'uninstallok');
  335. $msg = "<table class='table'>
  336. <tr>
  337. <td width='260'>模块名称:</td>
  338. <td>{$infos['name']}</td>
  339. </tr>
  340. <tr>
  341. <td>语言:</td>
  342. <td>{$infos['lang']} {$alertMsg}</td>
  343. </tr>
  344. <tr>
  345. <td>文件大小:</td>
  346. <td>{$infos['filesize']}</td>
  347. </tr>
  348. <tr>
  349. <td>开发者id:</td>
  350. <td>{$dev_id}</td>
  351. </tr>
  352. <tr>
  353. <td>发布时间:</td>
  354. <td>{$infos['time']}</td>
  355. </tr>
  356. <tr>
  357. <td>使用协议:</td>
  358. <td><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
  359. </tr>
  360. <tr>
  361. <td>模块文件:</td>
  362. <td><textarea name='filelists' id='filelists' class='admin-textarea-xl'>{$filelist}</textarea></td>
  363. </tr>
  364. <tr>
  365. <td>对于模块的文件处理方法:</td>
  366. <td>
  367. <label><input type='radio' name='isreplace' value='0' checked='checked'> 手工删除文件,仅运行卸载程序</label>
  368. <label><input type='radio' name='isreplace' value='2'> 删除模块的所有文件</label>
  369. </td>
  370. </tr>
  371. </table>";
  372. $win->AddMsgItem("$msg");
  373. $winform = $win->GetWindow("ok", "");
  374. $win->Display();
  375. $dm->Clear();
  376. exit();
  377. } else if ($action == 'uninstallok') {
  378. $dsql->ExecuteNoneQuery("DELETE FROM `#@__sys_module` WHERE hashcode LIKE '$hash' ");
  379. $dm = new DedeModule($mdir);
  380. $minfos = (array)$dm->GetModuleInfo($hash);
  381. extract($minfos, EXTR_SKIP);
  382. if (!isset($moduletype) || $moduletype != 'patch') {
  383. $dm->DeleteFiles($hash, $isreplace);
  384. }
  385. @$dm->DelSystemFile($hash, 'readme');
  386. @$dm->DelSystemFile($hash, 'setup');
  387. $dm->Clear();
  388. if (!isset($autodel) || $autodel == 0) {
  389. include(DEDEDATA."/module/{$hash}-uninstall.php");
  390. @unlink(DEDEDATA."/module/{$hash}-uninstall.php");
  391. exit();
  392. } else {
  393. @$dm->DelSystemFile($hash, 'uninstall');
  394. $delsql = $dm->GetSystemFile($hash, 'delsql');
  395. if (trim($delsql) != '') {
  396. $sqls = explode(';', $delsql);
  397. foreach ($sqls as $sql) {
  398. if (trim($sql) != '') $dsql->ExecuteNoneQuery($sql);
  399. }
  400. }
  401. ReWriteConfigAuto();
  402. $rflwft = "<script>\r\n";
  403. $rflwft .= "if (window.navigator.userAgent.indexOf('MSIE')>=1) top.document.frames.menu.location = 'index_menu.php';\r\n";
  404. $rflwft .= "else top.document.getElementsByName('menu').src = 'index_menu.php';\r\n";
  405. $rflwft .= "</script>";
  406. echo $rflwft;
  407. ShowMsg('模块卸载完成', 'module_main.php');
  408. exit();
  409. }
  410. } else if ($action == 'showreadme') {
  411. $dm = new DedeModule($mdir);
  412. $msg = $dm->GetSystemFile($hash, 'readme');
  413. $msg = preg_replace("/(.*)<body/isU", "", $msg);
  414. $msg = preg_replace("/<\/body>(.*)/isU", "", $msg);
  415. $dm->Clear();
  416. $win = new OxWindow();
  417. $win->Init("module_main.php", "js/blank.js", "post");
  418. $wecome_info = "模块管理";
  419. $win->AddTitle("<a href='module_main.php'>模块管理</a> - 使用说明");
  420. $win->AddMsgItem("$msg");
  421. $winform = $win->GetWindow("hand");
  422. $win->Display();
  423. exit();
  424. } else if ($action == 'view') {
  425. $dm = new DedeModule($mdir);
  426. $infos = $dm->GetModuleInfo($hash);
  427. if ($infos['url'] == '') $infos['url'] = ' ';
  428. $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br>该模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性');
  429. $filelists = (array)$dm->GetFileLists($hash);
  430. $filelist = '';
  431. $setupinfo = '';
  432. $devURL = DEDECDNURL."/developers/{$infos['dev_id']}.json";
  433. $dhd = new DedeHttpDown();
  434. $dhd->OpenUrl($devURL);
  435. $devContent = $dhd->GetHtml();
  436. $devInfo = (array)json_decode($devContent);
  437. $s = "未认证";
  438. if (($devInfo['dev_id'] == $infos['dev_id']) && !empty($devInfo['dev_id'])) {
  439. $s = "已认证";
  440. }
  441. foreach ($filelists as $v) {
  442. if (empty($v['name'])) continue;
  443. if ($v['type'] == 'dir') $v['type'] = '目录';
  444. else $v['type'] = '文件';
  445. $filelist .= "{$v['type']}|{$v['name']}\r\n";
  446. }
  447. if (file_exists(DEDEDATA."/module/{$hash}-readme.php")) {
  448. $setupinfo = "已安装 <a href='module_main.php?action=uninstall&hash={$hash}'>卸载</a>";
  449. } else {
  450. $setupinfo = "未安装 <a href='module_main.php?action=setup&hash={$hash}'>安装</a>";
  451. }
  452. $dev_id = empty($infos['dev_id'])? "<a href='module_main.php?action=setup&hash={$hash}' class='btn btn-warning btn-sm'>安装</a><a href='{$cfg_biz_dedebizUrl}/developer' target='_blank' class='btn btn-success btn-sm'>{$s}</a>" : "{$infos['dev_id']} <a href='module_main.php?action=setup&hash={$hash}' class='btn btn-warning btn-sm'>安装</a><a href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}' target='_blank' class='btn btn-success btn-sm'>{$s}</a>";
  453. $win = new OxWindow();
  454. $win->Init("", "js/blank.js", "");
  455. $wecome_info = "模块管理";
  456. $win->AddTitle("<a href='module_main.php'>模块管理</a> - {$infos['name']}");
  457. $msg = "<table class='table'>
  458. <tr>
  459. <td width='260'>模块名称:</td>
  460. <td>{$infos['name']}</td>
  461. </tr>
  462. <tr>
  463. <td>语言:</td>
  464. <td>{$infos['lang']} {$alertMsg}</td>
  465. </tr>
  466. <tr>
  467. <td>文件大小:</td>
  468. <td>{$infos['filesize']}</td>
  469. </tr>
  470. <tr>
  471. <td>开发者id:</td>
  472. <td>{$dev_id}</td>
  473. </tr>
  474. <tr>
  475. <td>发布时间:</td>
  476. <td>{$infos['time']}</td>
  477. </tr>
  478. <tr>
  479. <td>使用协议:</td>
  480. <td><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank' class='btn btn-success btn-sm'>浏览</a></td>
  481. </tr>
  482. <tr>
  483. <td>模块文件:</td>
  484. <td></td>
  485. </tr>
  486. <tr>
  487. <td colspan='2'><textarea name='filelists' id='filelists' class='admin-textarea-xl'>{$filelist}</textarea></td>
  488. </tr>
  489. </table>";
  490. $win->AddMsgItem("$msg");
  491. $winform = $win->GetWindow('hand', '');
  492. $win->Display();
  493. $dm->Clear();
  494. exit();
  495. } else if ($action == 'edit') {
  496. $dm = new DedeModule($mdir);
  497. $minfos = (array)$dm->GetModuleInfo($hash);
  498. extract($minfos, EXTR_SKIP);
  499. if (!isset($lang)) $lang = 'gb2312';
  500. if (!isset($moduletype)) $moduletype = 'soft';
  501. $menustring = $dm->GetSystemFile($hash, 'menustring');
  502. $setupsql40 = dede_htmlspecialchars($dm->GetSystemFile($hash, 'setupsql40'));
  503. $readmetxt = $dm->GetSystemFile($hash, 'readme');
  504. $delsql = $dm->GetSystemFile($hash, 'delsql');
  505. $filelist = $dm->GetSystemFile($hash, 'oldfilelist', false);
  506. $indexurl = str_replace('**', '=', $indexurl);
  507. $dm->Clear();
  508. require_once(dirname(__FILE__).'/templets/module_edit.htm');
  509. exit();
  510. } else if ($action == 'download') {
  511. ShowMsg("暂不支持模块下载功能", "javascript:;");
  512. }
  513. ?>