From 10a9cbf34769a00303d72e112034dd201f3b6e10 Mon Sep 17 00:00:00 2001 From: haneul Date: Tue, 27 Apr 2010 10:05:58 +0000 Subject: [PATCH] #18859373 : module uninstall git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7399 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../autoinstall.admin.controller.php | 55 +++- .../autoinstall/autoinstall.admin.view.php | 81 ++++- modules/autoinstall/autoinstall.lib.php | 290 ++++++++++++++---- modules/autoinstall/autoinstall.model.php | 49 ++- modules/autoinstall/conf/info.xml | 4 +- modules/autoinstall/conf/module.xml | 2 + modules/autoinstall/lang/en.lang.php | 2 + modules/autoinstall/lang/jp.lang.php | 2 + modules/autoinstall/lang/ko.lang.php | 2 + modules/autoinstall/lang/ru.lang.php | 2 + modules/autoinstall/lang/vi.lang.php | 2 + modules/autoinstall/lang/zh-CN.lang.php | 2 + modules/autoinstall/lang/zh-TW.lang.php | 2 + .../queries/getInstalledPackages.xml | 9 +- modules/autoinstall/tpl/css/autoinstall.css | 2 +- .../tpl/filter/uninstall_package.xml | 10 + modules/autoinstall/tpl/js/autoinstall.js | 8 + modules/autoinstall/tpl/list.html | 17 +- modules/autoinstall/tpl/uninstall.html | 14 + 19 files changed, 480 insertions(+), 75 deletions(-) create mode 100644 modules/autoinstall/tpl/filter/uninstall_package.xml create mode 100644 modules/autoinstall/tpl/uninstall.html diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 33ca2e3c4..dddc75c9c 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -57,16 +57,14 @@ continue; } - if($package->path == ".") - { - $type = "core"; + $type = $oModel->getTypeFromPath($package->path); + if($type == "core") + { $version = __ZBXE_VERSION__; - } + } else { - $path_array = explode("/", $package->path); - $target_name = array_pop($path_array); - $type = substr(array_pop($path_array), 0, -1); + $config_file = null; switch($type) { case "module": @@ -86,10 +84,8 @@ $config_file = "/info.xml"; $type = "component"; break; - - default: - continue; } + if(!$config_file) continue; $xml = new XmlParser(); $xmlDoc = $xml->loadXmlFile($real_path.$config_file); if(!$xmlDoc) continue; @@ -136,7 +132,7 @@ { $oModuleInstaller = new SFTPModuleInstaller($package); } - else if(function_exists(ftp_connect)) + else if(false && function_exists(ftp_connect)) { $oModuleInstaller = new PHPFTPModuleInstaller($package); } @@ -196,5 +192,42 @@ executeQuery("autoinstall.insertCategory", $args); } } + + function procAutoinstallAdminUninstallPackage() + { + $package_srl = Context::get('package_srl'); + $oModel =& getModel('autoinstall'); + $package = $oModel->getPackage($package_srl); + $path = $package->path; + + if(!$_SESSION['ftp_password']) + { + $ftp_password = Context::get('ftp_password'); + } + else + { + $ftp_password = $_SESSION['ftp_password']; + } + $ftp_info = Context::getFTPInfo(); + + if($ftp_info->sftp && $ftp_info->sftp == 'Y') + { + $oModuleInstaller = new SFTPModuleInstaller($package); + } + else if(function_exists(ftp_connect)) + { + $oModuleInstaller = new PHPFTPModuleInstaller($package); + } + else + { + $oModuleInstaller = new FTPModuleInstaller($package); + } + + $oModuleInstaller->setPassword($ftp_password); + $output = $oModuleInstaller->uninstall(); + if(!$output->toBool()) return $output; + + $this->setMessage('success_deleted'); + } } ?> diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index e6e23d751..719941a3a 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -9,6 +9,7 @@ class autoinstallAdminView extends autoinstall { var $categories; + var $ftp_set = false; function init() { $template_path = sprintf("%stpl/",$this->module_path); @@ -18,6 +19,8 @@ $ftp_info = Context::getFTPInfo(); if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); + else $this->ftp_set = true; + $this->dispCategory(); $oModel = &getModel('autoinstall'); @@ -39,7 +42,7 @@ { if(!is_array($items)) $items = array($items); $item_list = array(); - $targets = array('category_srl', 'package_srl', 'item_screenshot_url', 'package_voted', 'package_voter', 'package_description', 'package_downloaded', 'item_regdate', 'title', 'item_version', 'package_star'); + $targets = array('category_srl', 'package_srl', 'item_screenshot_url', 'package_voted', 'package_voter', 'package_description', 'package_downloaded', 'item_regdate', 'title', 'item_version', 'package_star', 'depfrom'); $targetpackages = array(); foreach($items as $item) { @@ -48,7 +51,7 @@ $oModel = &getModel('autoinstall'); if($package == null) $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); - + $depto = array(); foreach($items as $item) { $v = $this->rearrange($item, $targets); @@ -56,10 +59,52 @@ { $v->current_version = $packages[$v->package_srl]->current_version; $v->need_update = $packages[$v->package_srl]->need_update; + $v->type = $oModel->getTypeFromPath($packages[$v->package_srl]->path); + if($this->ftp_set && $v->depfrom) { + $depfrom = explode("," , $v->depfrom); + foreach($depfrom as $package_srl) + { + $depto[$package_srl][] = $v->package_srl; + } + } + if($v->type == "core") $v->avail_remove = false; + else if($v->type == "module") { + $v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path); + } + else $v->avail_remove = true; } $item_list[$v->package_srl] = $v; } + if(count($depto) > 0) + { + $installed = $oModel->getInstalledPackages(implode(",", array_keys($depto))); + foreach($installed as $key=>$val) + { + $path = $val->path; + $type = $oModel->getTypeFromPath($path); + if(!$type || $type == "core") continue; + $config_file = $oModel->getConfigFilePath($type); + if(!$config_file) continue; + + $xml = new XmlParser(); + $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); + if(!$xmlDoc) continue; + if($type == "drcomponent") $type = "component"; + $title = $xmlDoc->{$type}->title->body; + $installed[$key]->title = $title; + } + Context::set('installed', $installed); + foreach($installed as $key=>$val) + { + foreach($depto[$key] as $package_srl) + { + $item_list[$package_srl]->avail_remove = false; + $item_list[$package_srl]->deps[] = $key; + } + } + } + return $item_list; } @@ -235,5 +280,37 @@ $this->categories = &$oModel->getCategoryList(); Context::set('categories', $this->categories); } + + function dispAutoinstallAdminUninstall() + { + $package_srl = Context::get('package_srl'); + if(!$package_srl) return $this->dispAutoinstallAdminIndex(); + $oModel =& getModel('autoinstall'); + $installedPackage = $oModel->getInstalledPackage($package_srl); + if(!$installedPackage) return $this->dispAutoinstallAdminInstalledPackages(); + + if(!$_SESSION['ftp_password']) + { + Context::set('need_password', true); + } + $installedPackage = $oModel->getPackage($package_srl); + $path = $installedPackage->path; + $type = $oModel->getTypeFromPath($path); + if(!$type || $type == "core") $this->stop("msg_invalid_request"); + $config_file = $oModel->getConfigFilePath($type); + if(!$config_file) $this->stop("msg_invalid_request"); + + $xml = new XmlParser(); + $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); + if(!$xmlDoc) $this->stop("msg_invalid_request"); + if($type == "drcomponent") $type = "component"; + $title = $xmlDoc->{$type}->title->body; + $installedPackage->title = $title; + $installedPackage->type = $type; + Context::set('package', $installedPackage); + + $this->setTemplateFile('uninstall'); + Context::addJsFilter($this->module_path.'tpl/filter', 'uninstall_package.xml'); + } } ?> diff --git a/modules/autoinstall/autoinstall.lib.php b/modules/autoinstall/autoinstall.lib.php index dc729ed98..abedcfc9a 100644 --- a/modules/autoinstall/autoinstall.lib.php +++ b/modules/autoinstall/autoinstall.lib.php @@ -10,6 +10,23 @@ var $download_path; var $ftp_password; + function uninstall() + { + $oModel =& getModel('autoinstall'); + $type = $oModel->getTypeFromPath($this->package->path); + if($type == "module") { + $output = $this->uninstallModule(); + if(!$output->toBool()) return $output; + } + + $output = $this->_connect(); + if(!$output->toBool()) return $output; + + $output = $this->_removeDir($this->package->path); + $this->_close(); + return $output; + } + function setPassword($ftp_password) { $this->ftp_password = $ftp_password; @@ -41,11 +58,38 @@ FileHandler::writeFile($this->download_file, $buff); } - function installModule() - { + function uninstallModule() + { $path_array = explode("/", $this->package->path); $target_name = array_pop($path_array); - $type = substr(array_pop($path_array), 0, -1); + $oModule =& getModule($target_name, "class"); + if(!$oModule) return new Object(-1, 'msg_invalid_request'); + if(!method_exists($oModule, "moduleUninstall")) return new Object(-1, 'msg_invalid_request'); + + $output = $oModule->moduleUninstall(); + if(!$output->toBool()) return $output; + + $schema_dir = sprintf('%s/schemas/', $this->package->path); + $schema_files = FileHandler::readDir($schema_dir); + $oDB =& DB::getInstance(); + foreach($schema_files as $file) + { + $filename_arr = explode(".", $file); + $filename = array_shift($filename_arr); + $oDB->dropTable($filename); + } + return new Object(); + } + + function installModule() + { + $path = $this->package->path; + if($path != ".") { + $path_array = explode("/", $path); + $target_name = array_pop($path_array); + $type = substr(array_pop($path_array), 0, -1); + } + if($type == "module") { $oModuleModel = &getModel('module'); @@ -97,38 +141,100 @@ return $file_list; } + function _removeDir($path) { + $real_path = FileHandler::getRealPath($path); + $oDir = dir($path); + $files = array(); + while($file = $oDir->read()) { + if($file == "." || $file == "..") continue; + $files[] = $file; + } + + foreach($files as $file) + { + $file_path = $path."/".$file; + if(is_dir(FileHandler::getRealPath($file_path))) + { + $output = $this->_removeDir($file_path); + if(!$output->toBool()) return $output; + } + else + { + $output = $this->_removeFile($file_path); + if(!$output->toBool()) return $output; + } + } + $output = $this->_removeDir_real($path); + return $output; + } + } class SFTPModuleInstaller extends ModuleInstaller { + var $ftp_info = null; + var $connection = null; + var $sftp = null; + function SFTPModuleInstaller(&$package) { $this->package =& $package; + $this->ftp_info = Context::getFTPInfo(); } - function _copyDir(&$file_list){ - if(!$this->ftp_password) return new Object(-1,'msg_ftp_password_input'); - - $ftp_info = Context::getFTPInfo(); - if(!$ftp_info->ftp_user || !$ftp_info->sftp || $ftp_info->sftp != 'Y') return new Object(-1,'msg_ftp_invalid_auth_info'); + function _connect() { + if(!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y') return new Object(-1,'msg_ftp_invalid_auth_info'); - if($ftp_info->ftp_host) + if($this->ftp_info->ftp_host) { - $ftp_host = $ftp_info->ftp_host; + $ftp_host = $this->ftp_info->ftp_host; } else { $ftp_host = "127.0.0.1"; } - $connection = ssh2_connect($ftp_host, $ftp_info->ftp_port); - if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $this->ftp_password)) + $this->connection = ssh2_connect($ftp_host, $this->ftp_info->ftp_port); + if(!ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password)) { return new Object(-1,'msg_ftp_invalid_auth_info'); } $_SESSION['ftp_password'] = $this->ftp_password; + $this->sftp = ssh2_sftp($this->connection); + return new Object(); + } - $sftp = ssh2_sftp($connection); + function _close() { + } - $target_dir = $ftp_info->ftp_root_path.$this->target_path; + function _removeFile($path) + { + if(substr($path, 0, 2) == "./") $path = substr($path, 2); + $target_path = $this->ftp_info->ftp_root_path.$path; + + if(!@ssh2_sftp_unlink($this->sftp, $target_path)) + { + return new Object(-1, "failed to delete file ".$path); + } + return new Object(); + } + + function _removeDir_real($path) + { + if(substr($path, 0, 2) == "./") $path = substr($path, 2); + $target_path = $this->ftp_info->ftp_root_path.$path; + + if(!@ssh2_sftp_rmdir($this->sftp, $target_path)) + { + return new Object(-1, "failed to delete directory ".$path); + } + return new Object(); + } + + function _copyDir(&$file_list){ + if(!$this->ftp_password) return new Object(-1,'msg_ftp_password_input'); + + $output = $this->_connect(); + if(!$output->toBool()) return $output; + $target_dir = $this->ftp_info->ftp_root_path.$this->target_path; foreach($file_list as $k => $file){ $org_file = $file; @@ -141,10 +247,10 @@ if(!file_exists(FileHandler::getRealPath($real_path))) { - ssh2_sftp_mkdir($sftp, $pathname, 0755, true); + ssh2_sftp_mkdir($this->sftp, $pathname, 0755, true); } - ssh2_scp_send($connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file); + ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file); } return new Object(); } @@ -152,38 +258,79 @@ class PHPFTPModuleInstaller extends ModuleInstaller { + var $ftp_info = null; + var $connection = null; + function PHPFTPModuleInstaller(&$package) { $this->package =& $package; + $this->ftp_info = Context::getFTPInfo(); } - function _copyDir(&$file_list) { - if(!$this->ftp_password) return new Object(-1,'msg_ftp_password_input'); - - $ftp_info = Context::getFTPInfo(); - if($ftp_info->ftp_host) + function _connect() + { + if($this->ftp_info->ftp_host) { - $ftp_host = $ftp_info->ftp_host; + $ftp_host = $this->ftp_info->ftp_host; } else { $ftp_host = "127.0.0.1"; } - $connection = ftp_connect($ftp_host, $ftp_info->ftp_port); - if(!$connection) return new Object(-1, 'msg_ftp_not_connected'); - $login_result = @ftp_login($connection, $ftp_info->ftp_user, $this->ftp_password); + $this->connection = ftp_connect($ftp_host, $this->ftp_info->ftp_port); + if(!$this->connection) return new Object(-1, 'msg_ftp_not_connected'); + + $login_result = @ftp_login($this->connection, $this->ftp_info->ftp_user, $this->ftp_password); if(!$login_result) { + $this->_close(); return new Object(-1,'msg_ftp_invalid_auth_info'); } - $_SESSION['ftp_password'] = $this->ftp_password; - if($ftp_info->ftp_pasv != "N") - { - ftp_pasv($connection, true); - } - $target_dir = $ftp_info->ftp_root_path.$this->target_path; + $_SESSION['ftp_password'] = $this->ftp_password; + if($this->ftp_info->ftp_pasv != "N") + { + ftp_pasv($this->connection, true); + } + return new Object(); + } + + function _removeFile($path) + { + if(substr($path, 0, 2) == "./") $path = substr($path, 2); + $target_path = $this->ftp_info->ftp_root_path.$path; + + if(!@ftp_delete($this->connection, $target_path)) + { + return new Object(-1, "failed to delete file ".$path); + } + return new Object(); + } + + function _removeDir_real($path) + { + if(substr($path, 0, 2) == "./") $path = substr($path, 2); + $target_path = $this->ftp_info->ftp_root_path.$path; + + if(!@ftp_rmdir($this->connection, $target_path)) + { + return new Object(-1, "failed to delete directory ".$path); + } + return new Object(); + } + + + function _close() { + ftp_close($this->connection); + } + + function _copyDir(&$file_list) { + if(!$this->ftp_password) return new Object(-1,'msg_ftp_password_input'); + + $output = $this->_connect(); + if(!$output->toBool()) return $output; + $target_dir = $this->ftp_info->ftp_root_path.$this->target_path; foreach($file_list as $k => $file){ $org_file = $file; @@ -195,7 +342,7 @@ $path_list = explode('/', dirname($this->target_path."/".$file)); $real_path = "./"; - $ftp_path = $ftp_info->ftp_root_path; + $ftp_path = $this->ftp_info->ftp_root_path; for($i=0;$iconnection, $ftp_path)) { return new Object(-1, "msg_make_directory_failed"); } @@ -212,14 +359,14 @@ if(!stristr(PHP_OS, 'win')) { if (function_exists('ftp_chmod')) { - if(!ftp_chmod($connection, 0755, $ftp_path)) + if(!ftp_chmod($this->connection, 0755, $ftp_path)) { return new Object(-1, "msg_permission_adjust_failed"); } } else { - if(!ftp_site($connection, "CHMOD 755 ".$ftp_path)) + if(!ftp_site($this->connection, "CHMOD 755 ".$ftp_path)) { return new Object(-1, "msg_permission_adjust_failed"); } @@ -227,49 +374,85 @@ } } } - if(!ftp_put($connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY)) + if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY)) { return new Object(-1, "msg_ftp_upload_failed"); } } - ftp_close($connection); + $this->_close(); return new Object(); } } class FTPModuleInstaller extends ModuleInstaller { + var $oFtp = null; + var $ftp_info = null; + function FTPModuleInstaller(&$package) { $this->package =& $package; + $this->ftp_info = Context::getFTPInfo(); } - function _copyDir(&$file_list){ - $ftp_info = Context::getFTPInfo(); - if(!$this->ftp_password) return new Object(-1,'msg_ftp_password_input'); - - require_once(_XE_PATH_.'libs/ftp.class.php'); - - if($ftp_info->ftp_host) + function _connect() { + if($this->ftp_info->ftp_host) { - $ftp_host = $ftp_info->ftp_host; + $ftp_host = $this->ftp_info->ftp_host; } else { $ftp_host = "127.0.0.1"; } - $oFtp = new ftp(); - if(!$oFtp->ftp_connect($ftp_host, $ftp_info->ftp_port)) return new Object(-1,'msg_ftp_not_connected'); - if(!$oFtp->ftp_login($ftp_info->ftp_user, $this->ftp_password)) { - $oFtp->ftp_quit(); + $this->oFtp = new ftp(); + if(!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) return new Object(-1,'msg_ftp_not_connected'); + if(!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) { + $this->_close(); return new Object(-1,'msg_ftp_invalid_auth_info'); } $_SESSION['ftp_password'] = $this->ftp_password; + return new Object(); + } - $_list = $oFtp->ftp_rawlist($ftp_info->ftp_root_path); + function _removeFile($path) + { + if(substr($path, 0, 2) == "./") $path = substr($path, 2); + $target_path = $this->ftp_info->ftp_root_path.$path; - $target_dir = $ftp_info->ftp_root_path.$this->target_path; + if(!$this->oFtp->ftp_delete($target_path)) + { + return new Object(-1, "failed to delete file ".$path); + } + return new Object(); + } + + function _removeDir_real($path) + { + if(substr($path, 0, 2) == "./") $path = substr($path, 2); + $target_path = $this->ftp_info->ftp_root_path.$path; + + if(!$this->oFtp->ftp_rmdir($target_path)) + { + return new Object(-1, "failed to delete directory ".$path); + } + return new Object(); + } + + function _close() { + $this->oFtp->ftp_quit(); + } + + function _copyDir(&$file_list){ + if(!$this->ftp_password) return new Object(-1,'msg_ftp_password_input'); + + require_once(_XE_PATH_.'libs/ftp.class.php'); + + $output = $this->_connect(); + if(!$output->toBool()) return $output; + + $oFtp =& $this->oFtp; + $target_dir = $this->ftp_info->ftp_root_path.$this->target_path; foreach($file_list as $k => $file){ $org_file = $file; @@ -281,7 +464,7 @@ $path_list = explode('/', dirname($this->target_path."/".$file)); $real_path = "./"; - $ftp_path = $ftp_info->ftp_root_path; + $ftp_path = $this->ftp_info->ftp_root_path; for($i=0;$iftp_put($target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file)); } - $oFtp->ftp_quit(); + + $this->_close(); return new Object(); } diff --git a/modules/autoinstall/autoinstall.model.php b/modules/autoinstall/autoinstall.model.php index ddd75db62..bd836a45c 100644 --- a/modules/autoinstall/autoinstall.model.php +++ b/modules/autoinstall/autoinstall.model.php @@ -108,8 +108,8 @@ return array_shift($output->data); } - function getInstalledPackages(&$package_list) { - $args->package_list = &$package_list; + function getInstalledPackages($package_list) { + $args->package_list = $package_list; $output = executeQueryArray("autoinstall.getInstalledPackages", $args); $result = array(); if(!$output->data) return $result; @@ -133,5 +133,50 @@ return $output; } + function getTypeFromPath($path) + { + if(!$path) return null; + if($path == ".") return "core"; + $path_array = explode("/", $path); + $target_name = array_pop($path_array); + $type = substr(array_pop($path_array), 0, -1); + return $type; + } + + function getConfigFilePath($type) + { + $config_file = null; + switch($type) + { + case "module": + case "addon": + case "layout": + case "widget": + $config_file = "/conf/info.xml"; + break; + case "component": + $config_file = "/info.xml"; + break; + case "skin": + case "widgetstyle": + $config_file = "/skin.xml"; + break; + case "drcomponent": + $config_file = "/info.xml"; + break; + } + return $config_file; + } + + function checkRemovable($path) + { + $path_array = explode("/", $path); + $target_name = array_pop($path_array); + $oModule =& getModule($target_name, "class"); + if(!$oModule) return false; + if(method_exists($oModule, "moduleUninstall")) return true; + else return false; + } + } ?> diff --git a/modules/autoinstall/conf/info.xml b/modules/autoinstall/conf/info.xml index 3be4f24ef..f3c28fa4d 100644 --- a/modules/autoinstall/conf/info.xml +++ b/modules/autoinstall/conf/info.xml @@ -1,7 +1,7 @@ 쉬운 설치 - One Click Installer + EasyInstaller Cài đặt tự động 自動安裝 在线安装 @@ -12,7 +12,7 @@ 可以藉由此模組安裝、更新程式包括模組、面板、版面等。 很方便的在管理页面一键安装XE相关模块(模块/皮肤/布局/控件/控件样式等)。 管理者モードにてクリックだけで、モジュール/スキン/レイアウト/ウィジェット/ウィジェットスタイルのインストールを可能にするモジュールです。 - 0.2 + 0.3 2009-11-11 system diff --git a/modules/autoinstall/conf/module.xml b/modules/autoinstall/conf/module.xml index e43224438..f2b2b7b26 100644 --- a/modules/autoinstall/conf/module.xml +++ b/modules/autoinstall/conf/module.xml @@ -2,6 +2,8 @@ + + diff --git a/modules/autoinstall/lang/en.lang.php b/modules/autoinstall/lang/en.lang.php index 4410f41fc..6edc8fe90 100644 --- a/modules/autoinstall/lang/en.lang.php +++ b/modules/autoinstall/lang/en.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = "Download"; $lang->view_installed_packages = "Installed Packages"; $lang->msg_ftp_password_input = "Please input FTP password."; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; ?> diff --git a/modules/autoinstall/lang/jp.lang.php b/modules/autoinstall/lang/jp.lang.php index b22567405..7e41ef822 100644 --- a/modules/autoinstall/lang/jp.lang.php +++ b/modules/autoinstall/lang/jp.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = "ダウンロード"; $lang->view_installed_packages = "Installed Packages"; $lang->msg_ftp_password_input = "Please input FTP password."; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; ?> diff --git a/modules/autoinstall/lang/ko.lang.php b/modules/autoinstall/lang/ko.lang.php index 9d9363565..5e2a2db75 100644 --- a/modules/autoinstall/lang/ko.lang.php +++ b/modules/autoinstall/lang/ko.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = "다운로드"; $lang->view_installed_packages = "설치된 패키지"; $lang->msg_ftp_password_input = "FTP 비밀번호를 입력해주세요"; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; ?> diff --git a/modules/autoinstall/lang/ru.lang.php b/modules/autoinstall/lang/ru.lang.php index 850d02037..b5114a422 100644 --- a/modules/autoinstall/lang/ru.lang.php +++ b/modules/autoinstall/lang/ru.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = 'Download'; $lang->view_installed_packages = 'Installed Packages'; $lang->msg_ftp_password_input = 'Please input FTP password'; + $lang->dependant_list = " Ű ϴ Ű "; + $lang->description_uninstall = "Ű մϴ. Ͱ ϴ."; ?> diff --git a/modules/autoinstall/lang/vi.lang.php b/modules/autoinstall/lang/vi.lang.php index bbbd63ebb..301636a54 100644 --- a/modules/autoinstall/lang/vi.lang.php +++ b/modules/autoinstall/lang/vi.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = "Download"; $lang->view_installed_packages = "Installed Packages"; $lang->msg_ftp_password_input = "Please input FTP password."; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; ?> diff --git a/modules/autoinstall/lang/zh-CN.lang.php b/modules/autoinstall/lang/zh-CN.lang.php index a8a9dbee8..9aa92385a 100644 --- a/modules/autoinstall/lang/zh-CN.lang.php +++ b/modules/autoinstall/lang/zh-CN.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = "Download"; $lang->view_installed_packages = "Installed Packages"; $lang->msg_ftp_password_input = "Please input FTP password."; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; ?> diff --git a/modules/autoinstall/lang/zh-TW.lang.php b/modules/autoinstall/lang/zh-TW.lang.php index d2f902967..03abf06a4 100644 --- a/modules/autoinstall/lang/zh-TW.lang.php +++ b/modules/autoinstall/lang/zh-TW.lang.php @@ -30,4 +30,6 @@ $lang->cmd_download = "下載"; $lang->view_installed_packages = "已安裝套裝軟體"; $lang->msg_ftp_password_input = "請輸入 FTP 密碼"; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; ?> diff --git a/modules/autoinstall/queries/getInstalledPackages.xml b/modules/autoinstall/queries/getInstalledPackages.xml index da8512403..5b66fc879 100644 --- a/modules/autoinstall/queries/getInstalledPackages.xml +++ b/modules/autoinstall/queries/getInstalledPackages.xml @@ -1,11 +1,14 @@ - +
+
- + + - + + diff --git a/modules/autoinstall/tpl/css/autoinstall.css b/modules/autoinstall/tpl/css/autoinstall.css index 5280d98b6..492b9772c 100644 --- a/modules/autoinstall/tpl/css/autoinstall.css +++ b/modules/autoinstall/tpl/css/autoinstall.css @@ -38,7 +38,7 @@ .updateList td .title{ position:relative;} .updateList td .title h3 { padding:0; margin:0 0 5px 0; font-size:12px;} .updateList td .title a {text-decoration:none; color:#333 !important; } -.updateList td .title .button{ position:absolute; top:0; right:0;} +.updateList td .title .buttons{ position:absolute; top:0; right:0;} .updateList td .info p{ margin:0 0 5px 0; line-height:1.5;} .updateList td .info p.desc{ margin:0 100px 10px 0;} .updateList td .info p.meta{ font-size:11px;} diff --git a/modules/autoinstall/tpl/filter/uninstall_package.xml b/modules/autoinstall/tpl/filter/uninstall_package.xml new file mode 100644 index 000000000..6df9b6f8e --- /dev/null +++ b/modules/autoinstall/tpl/filter/uninstall_package.xml @@ -0,0 +1,10 @@ + +
+ + + + + + +
+ diff --git a/modules/autoinstall/tpl/js/autoinstall.js b/modules/autoinstall/tpl/js/autoinstall.js index 10534b04d..863927c9d 100644 --- a/modules/autoinstall/tpl/js/autoinstall.js +++ b/modules/autoinstall/tpl/js/autoinstall.js @@ -31,3 +31,11 @@ function completeInstall(ret_obj) { exec_xml('autoinstall', 'procAutoinstallAdminUpdateinfo', params, completeUpdateNoMsg); } +function completeUninstall(ret_obj) { + alert(ret_obj['message']); + if(ret_obj['error'] != 0) return; + var params = new Array(); + exec_xml('autoinstall', 'procAutoinstallAdminUpdateinfo', params, completeUpdateNoMsg); +} + + diff --git a/modules/autoinstall/tpl/list.html b/modules/autoinstall/tpl/list.html index 6b97a8af1..a7c2343b3 100644 --- a/modules/autoinstall/tpl/list.html +++ b/modules/autoinstall/tpl/list.html @@ -37,12 +37,27 @@ {htmlspecialchars($val->title)} ver. {htmlspecialchars($val->item_version)} - {$lang->current_version} : {$val->current_version} +

{$lang->current_version} : {$val->current_version} + +
+ {$lang->dependant_list} : + + {$installed[$package_srl]->title}. + + +

+ +
diff --git a/modules/autoinstall/tpl/uninstall.html b/modules/autoinstall/tpl/uninstall.html new file mode 100644 index 000000000..1ed2bb27c --- /dev/null +++ b/modules/autoinstall/tpl/uninstall.html @@ -0,0 +1,14 @@ + + + +
+

{$package->title} [{$package->type}] - {$package->path}

+

{$lang->description_uninstall}

+
+ + +

+ + + +