diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index c1366fa43..2b0a010eb 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -14,6 +14,14 @@ Context::set('original_site', $this->original_site); Context::set('uri', $this->uri); $this->setTemplatePath($template_path); + + $ftp_info = Context::getFTPInfo(); + if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); + + $this->dispCategory(); + $oModel = &getModel('autoinstall'); + Context::set('tCount', $oModel->getPackageCount(null)); + Context::set('iCount', $oModel->getInstalledPackageCount()); } function rearrange(&$item, &$targets) @@ -26,7 +34,7 @@ return $ret; } - function rearranges($items) + function rearranges($items, $packages = null) { if(!is_array($items)) $items = array($items); $item_list = array(); @@ -37,7 +45,8 @@ $targetpackages[$item->package_srl->body] = 0; } $oModel = &getModel('autoinstall'); - $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); + if($package == null) + $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); foreach($items as $item) { @@ -53,11 +62,39 @@ return $item_list; } + function dispAutoinstallAdminInstalledPackages() + { + $page = Context::get('page'); + if(!$page) $page = 1; + Context::set('page', $page); + $oModel = &getModel('autoinstall'); + $output = $oModel->getInstalledPackageList($page); + $package_list = $output->data; + + $params["act"] = "getResourceapiPackages"; + $params["package_srls"] = implode(",", array_keys($package_list)); + $body = XmlGenerater::generate($params); + $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + $xml_lUpdate = new XmlParser(); + $xmlDoc = $xml_lUpdate->parse($buff); + if($xmlDoc && $xmlDoc->response->packagelist->item) + { + $item_list = $this->rearranges($xmlDoc->response->packagelist->item, $package_list); + $res = array(); + foreach($package_list as $package_srl => $package) + { + $res[] = $item_list[$package_srl]; + } + Context::set('item_list', $res); + } + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('index'); + } + function dispAutoinstallAdminInstall() { $package_srl = Context::get('package_srl'); if(!$package_srl) return $this->dispAutoinstallAdminIndex(); - $ftp_info = Context::getFTPInfo(); - if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); $params["act"] = "getResourceapiInstallInfo"; $params["package_srl"] = $package_srl; @@ -185,10 +222,13 @@ Context::set('page_navigation', $page_navigation); } + } + + function dispCategory() + { $oModel = &getModel('autoinstall'); $categories = &$oModel->getCategoryList(); Context::set('categories', $categories); - Context::set('tCount', $oModel->getPackageCount(null)); } } ?> diff --git a/modules/autoinstall/autoinstall.model.php b/modules/autoinstall/autoinstall.model.php index c2d0378f0..ddd75db62 100644 --- a/modules/autoinstall/autoinstall.model.php +++ b/modules/autoinstall/autoinstall.model.php @@ -78,6 +78,13 @@ return $output->data->count; } + function getInstalledPackageCount() + { + $output = executeQuery("autoinstall.getInstalledPackageCount", $args); + if(!$output->data) return 0; + return $output->data->count; + } + function setDepth(&$item, $depth, &$list, &$resultList) { $resultList[$item->category_srl] =& $item; @@ -113,5 +120,18 @@ return $result; } + function getInstalledPackageList($page) + { + $args->page = $page; + $output = executeQueryArray("autoinstall.getInstalledPackageList", $args); + $res = array(); + foreach($output->data as $val) + { + $res[$val->package_srl] = $val; + } + $output->data = $res; + return $output; + } + } ?> diff --git a/modules/autoinstall/conf/module.xml b/modules/autoinstall/conf/module.xml index a4283f729..e43224438 100644 --- a/modules/autoinstall/conf/module.xml +++ b/modules/autoinstall/conf/module.xml @@ -2,6 +2,7 @@ + diff --git a/modules/autoinstall/lang/en.lang.php b/modules/autoinstall/lang/en.lang.php index a1ac5464e..9045a2807 100644 --- a/modules/autoinstall/lang/en.lang.php +++ b/modules/autoinstall/lang/en.lang.php @@ -1,12 +1,12 @@ autoinstall = 'One Click Installer'; - $lang->about_autoinstall = 'One Click Installer will help you install/upgrade programs(skins) for XE.'; + $lang->autoinstall = 'EasyInstall'; + $lang->about_autoinstall = 'EasyInstall module will help you install/upgrade programs(skins) for XE.'; $lang->package_update = 'Recent Update'; $lang->package_downloaded_count = 'Download Count'; $lang->need_update = "Please update package list first."; @@ -17,15 +17,16 @@ $lang->success_installed = "Successfully Installed"; $lang->view_all_package = "View All"; $lang->description_ftp_note = "If FTP configuration is not set, installation would not work. Please configure FTP information"; - $lang->description_update = "If you have upgraded or installed programs without One Click Installer, please press update button to renew new information."; + $lang->description_update = "If you have upgraded or installed programs without EasyInstall module, please press update button to renew new information."; $lang->install = "Install"; $lang->update = "Update"; $lang->current_version = "Version"; $lang->depending_programs = "This program is depending on "; $lang->require_update = "Update is required."; $lang->require_installation = "Installation is required."; - $lang->description_install = "One Click Installer will also install/update all other programs which this program is depending on"; + $lang->description_install = "EasyInstall will also install/update all other programs which this program is depending on"; $lang->description_download = "If FTP is unavailable, you should manually download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)"; $lang->path = "Path"; $lang->cmd_download = "Download"; + $lang->view_installed_packages = "Installed Packages"; ?> diff --git a/modules/autoinstall/lang/jp.lang.php b/modules/autoinstall/lang/jp.lang.php index ef9805a12..dea87600f 100644 --- a/modules/autoinstall/lang/jp.lang.php +++ b/modules/autoinstall/lang/jp.lang.php @@ -28,4 +28,5 @@ $lang->description_download = "FTPの利用が出来ない場合は、直接ダウンロードし、サーバー上の該当パスにてインストールして下さい。 (一つ上階層にて解凍します。 ./modules/board の場合 ./modulesにて tarを解凍して下さい。)"; $lang->path = "インストールパス"; $lang->cmd_download = "ダウンロード"; + $lang->view_installed_packages = "Installed Packages"; ?> diff --git a/modules/autoinstall/lang/ko.lang.php b/modules/autoinstall/lang/ko.lang.php index 31c702de1..59777b64b 100644 --- a/modules/autoinstall/lang/ko.lang.php +++ b/modules/autoinstall/lang/ko.lang.php @@ -28,4 +28,5 @@ $lang->description_download = "FTP를 이용할 수 없는 경우, 직접 다운로드 하여 해당 path에 설치하셔야 합니다. (한칸 상위에서 압축을 푸시면 됩니다. ./modules/board의 경우 ./modules에서 tar를 푸세요)"; $lang->path = "설치경로"; $lang->cmd_download = "다운로드"; + $lang->view_installed_packages = "설치된 패키지"; ?> diff --git a/modules/autoinstall/lang/vi.lang.php b/modules/autoinstall/lang/vi.lang.php index ac198851f..6be1bcde8 100644 --- a/modules/autoinstall/lang/vi.lang.php +++ b/modules/autoinstall/lang/vi.lang.php @@ -28,4 +28,5 @@ $lang->description_download = "Khi FTP không được mở, bạn nên tải về và giả nén, sau đó Upload theo đường dẫn. (Nếu đường dẫn là ./modules/board, thì giải nén vào ./modules)"; $lang->path = "Đường dẫn"; $lang->cmd_download = "Download"; + $lang->view_installed_packages = "Installed Packages"; ?> diff --git a/modules/autoinstall/lang/zh-CN.lang.php b/modules/autoinstall/lang/zh-CN.lang.php index ee8a2c0fd..d2e077526 100644 --- a/modules/autoinstall/lang/zh-CN.lang.php +++ b/modules/autoinstall/lang/zh-CN.lang.php @@ -28,4 +28,5 @@ $lang->description_download = "When FTP is disabled, you should download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)"; $lang->path = "Path"; $lang->cmd_download = "Download"; + $lang->view_installed_packages = "Installed Packages"; ?> diff --git a/modules/autoinstall/lang/zh-TW.lang.php b/modules/autoinstall/lang/zh-TW.lang.php index 6b2e9728d..3826d5433 100644 --- a/modules/autoinstall/lang/zh-TW.lang.php +++ b/modules/autoinstall/lang/zh-TW.lang.php @@ -28,4 +28,5 @@ $lang->description_download = "When FTP is disabled, you should download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)"; $lang->path = "路徑"; $lang->cmd_download = "Download"; + $lang->view_installed_packages = "Installed Packages"; ?> diff --git a/modules/autoinstall/queries/getInstalledPackageCount.xml b/modules/autoinstall/queries/getInstalledPackageCount.xml new file mode 100644 index 000000000..0c8fea6a5 --- /dev/null +++ b/modules/autoinstall/queries/getInstalledPackageCount.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modules/autoinstall/queries/getInstalledPackageList.xml b/modules/autoinstall/queries/getInstalledPackageList.xml new file mode 100644 index 000000000..d9c82f7c0 --- /dev/null +++ b/modules/autoinstall/queries/getInstalledPackageList.xml @@ -0,0 +1,14 @@ + + +
+ + + + + + + + + + + diff --git a/modules/autoinstall/tpl/css/autoinstall.css b/modules/autoinstall/tpl/css/autoinstall.css index e4c9a5f11..5280d98b6 100644 --- a/modules/autoinstall/tpl/css/autoinstall.css +++ b/modules/autoinstall/tpl/css/autoinstall.css @@ -6,7 +6,9 @@ .aside { width:180px; float:left; margin-right:30px; padding-bottom:30px; } .aside .categoryBox { background-color:#F8F8F8; padding:10px; width:160px; overflow:hidden; } -.aside .categoryBox h3 { padding:0 0 10px 0; margin:0 0 10px 0; white-space:nowrap; overflow:hidden; color:#48494E; font-size:11px; font-weight:normal; background:transparent url(../img/hrE1.gif) repeat-x scroll left bottom;} +.aside .categoryBox h3 { padding:0 0 10px 0; margin:0 0 10px 0; white-space:nowrap; overflow:hidden; color:#48494E; font-size:11px; font-weight:normal;} +.aside .categoryBox .bottomLine {background:transparent url(../img/hrE1.gif) repeat-x scroll left bottom;} +.aside .categoryBox .topLine {background:transparent url(../img/hrE1.gif) repeat-x scroll left top;} .aside .categoryBox h3 a { color:#48494E; font-size:12px; font-weight:bold; text-decoration:none; } .aside .categoryBox ul.category { margin:10px 0 0 0; padding:0; list-style:none; } .aside .categoryBox ul.category li { margin:0 0 10px 10px; } @@ -19,7 +21,7 @@ .aside .categoryBox ul.resourceManage li a { text-decoration:none; color:#747474; } .aside .categoryBox ul.resourceManage li a.selected { font-weight:bold; } -.aside .searchBox { padding:10px 0; text-align:center; background:transparent url(../img/hrE1.gif) repeat-x scroll left top;} +.aside .searchBox { padding:10px 0; text-align:center; } .aside .searchBox input.input { border:1px solid #ddd; width:120px; height:16px;} .aside .searchBox input.submit { vertical-align:middle; } diff --git a/modules/autoinstall/tpl/leftBox.html b/modules/autoinstall/tpl/leftBox.html index e65b9f190..2b720785a 100644 --- a/modules/autoinstall/tpl/leftBox.html +++ b/modules/autoinstall/tpl/leftBox.html @@ -1,6 +1,6 @@
diff --git a/modules/autoinstall/tpl/list.html b/modules/autoinstall/tpl/list.html index f698697bd..6b97a8af1 100644 --- a/modules/autoinstall/tpl/list.html +++ b/modules/autoinstall/tpl/list.html @@ -1,4 +1,5 @@
+ +