$winform = $win->GetWindow('hand', ''); $win->Display(); $dm->Clear(); exit; } else { if ($action == 'edit') { $dm = new DedeModule($mdir); $minfos = $dm->GetModuleInfo($hash); extract($minfos, EXTR_SKIP); if (!isset($lang)) { $lang = 'gb2312'; } if (!isset($moduletype)) { $moduletype = 'soft'; } $menustring = $dm->GetSystemFile($hash, 'menustring'); $setupsql40 = htmlspecialchars($dm->GetSystemFile($hash, 'setupsql40')); $readmetxt = $dm->GetSystemFile($hash, 'readme'); $delsql = $dm->GetSystemFile($hash, 'delsql'); $filelist = $dm->GetSystemFile($hash, 'oldfilelist', false); $indexurl = str_replace('**', '=', $indexurl); $dm->Clear(); require_once dirname(__FILE__) . '/templets/module_edit.htm'; exit; } else { if ($action == 'download') { $model_remote_url = $updateHost . 'dedecms/module_' . $cfg_soft_lang . '/' . $hash . '.xml'; $model_remote = file_get_contents($model_remote_url); file_put_contents($mdir . '/' . $hash . '.xml', $model_remote); echo "未安装 <a href='module_main.php?action=setup&hash={$hash}'><u>安装</u></a>"; }
$moduleFilename = $mdir . '/' . $hashcode . '.xml'; $modulname = str_replace('=', '', $modulname); $email = str_replace('=', '', $email); $team = str_replace('=', '', $team); $indexurl = str_replace('=', '', $indexurl); $menustring = base64_encode($menustring); $dm = new DedeModule($mdir); $readmef = base64_encode($readmetxt); $setupf = $uninstallf = ''; //编译setup文件 if (is_uploaded_file($setup)) { move_uploaded_file($setup, $mdir . "/{$hashcode}-s.php") or die("你没上传,或系统无法把setup文件移动到 module 目录!"); $setupf = $dm->GetEncodeFile($mdir . "/{$hashcode}-s.php", true); } else { if ($autosetup == 0) { $setupf = base64_encode($dm->GetSystemFile($hashcode, 'setup')); } } //编译uninstall文件 if (is_uploaded_file($uninstall)) { move_uploaded_file($uninstall, $mdir . "/{$hashcode}-u.php") or die("你没上传,或系统无法把uninstall文件移动到 module 目录!"); $uninstallf = $dm->GetEncodeFile($mdir . "/{$hashcode}-u.php", true); } else { if ($autodel == 0) { $uninstallf = base64_encode($dm->GetSystemFile($hashcode, 'uninstall')); } } if (trim($setupsql40) == '') { $setupsql40 = ''; } else { $setupsql40 = base64_encode(trim($setupsql40));
} include $moduleCacheFile; $modules = split(',', $selModule); $totalMod = count($modules); if ($step >= $totalMod) { $msg = "<font color='red'>完成所有模块的安装!</font><br /><br />"; $msg .= "<a href='module-install.php?step=9999' target='_top'>点击此进行下一步操作 >></a>"; ShowMsg($msg, 'javascript:;'); exit; } $moduleHash = $modules[$step]; $moduleFile = $allmodules[$moduleHash]; $dm = new DedeModule($moduleDir); $minfos = $dm->GetModuleInfo($moduleHash); extract($minfos, EXTR_SKIP); $menustring = addslashes($dm->GetSystemFile($moduleHash, 'menustring')); $query = "INSERT INTO `#@__sys_module`(`hashcode` , `modname` , `indexname` , `indexurl` , `ismember` , `menustring` )\r\n VALUES ('{$moduleHash}' , '{$name}' , '{$indexname}' , '{$indexurl}' , '{$ismember}' , '{$menustring}' ) "; $rs = $dsql->ExecuteNoneQuery("Delete From `#@__sys_module` where hashcode like '{$moduleHash}' "); $rs = $dsql->ExecuteNoneQuery($query); if (!$rs) { $msg = "<font color='red'>保存数据库信息失败,无法完成你选择的模块安装!</font><br /><br />"; $msg .= "<a href='module-install.php?step=9999' target='_top'>点击此进行下一步操作 >></a>"; exit; } //写文件 $dm->WriteFiles($moduleHash, 1); $dm->WriteSystemFile($moduleHash, 'readme'); $setupsql = $dm->GetSystemFile($moduleHash, 'setupsql40'); //运行SQL $mysql_version = $dsql->GetVersion(TRUE); $setupsql = preg_replace("#ENGINE=MyISAM#i", 'TYPE=MyISAM', $setupsql);
$dm = new DedeModule($mdir); $minfos = $dm->GetModuleInfo($hash); $modulname = $minfos['name']; $team = $minfos['team']; $mtime = $minfos['time']; $email = $minfos['email']; $url = $minfos['url']; /* $filelists = $dm->GetFileLists($hash); $filelist = ''; $setupinfo = ''; $ds = array(); foreach($filelists as $v) { if(empty($v['name'])) continue; $sonfile = false; foreach($ds as $vv){ if(eregi("^".$vv,$v['name'])){ $sonfile=true; break; } } if(!$sonfile) $filelist .= "{$v['name']}\r\n"; if($v['type']=='dir') $ds[] = $v['name']; } */ $filelist = $dm->GetSystemFile($hash,'oldfilelist',false); $dm->Clear(); require_once(dirname(__FILE__)."/templets/module_edit.htm"); exit(); } ClearAllLink(); ?>