From 7aebc36fb5a479a2feb1f396685b9c8debe776f1 Mon Sep 17 00:00:00 2001 From: flyskyko Date: Tue, 26 Jul 2011 08:00:00 +0000 Subject: [PATCH] add getUpdateUrlBy...(), add process for return url when package install git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8647 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../autoinstall.admin.controller.php | 10 +++++- .../autoinstall/autoinstall.admin.view.php | 10 ------ modules/autoinstall/autoinstall.model.php | 34 +++++++++++++++++-- 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/tr.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 ++ modules/autoinstall/tpl/install.html | 1 + 12 files changed, 57 insertions(+), 14 deletions(-) diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index ac11263fe..643c59b24 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -159,7 +159,15 @@ $this->_updateinfo(); $this->setMessage('success_installed', 'update'); - $this->setRedirectUrl(preg_replace('/act=[^&]*/', 'act=dispAutoinstallAdminIndex', Context::get('error_return_url'))); + + if (Context::get('return_url')) + { + $this->setRedirectUrl(Context::get('return_url')); + } + else + { + $this->setRedirectUrl(preg_replace('/act=[^&]*/', 'act=dispAutoinstallAdminIndex', Context::get('error_return_url'))); + } } function updatePackages(&$xmlDoc) diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index a250133f4..2cccb20e4 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -303,16 +303,6 @@ $config_file = $oModel->getConfigFilePath($type); if(!$config_file) return $this->stop("msg_invalid_request"); - // $xml = new XmlParser(); - // $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); - // if(!$xmlDoc) return $this->stop("msg_invalid_request"); - // if($type == "drcomponent") $type = "component"; - // if($type == "style") $type = "skin"; - // $title = $xmlDoc->{$type}->title->body; - // $installedPackage->title = $title; - // $installedPackage->type = $type; - // Context::set('package', $installedPackage); - $params["act"] = "getResourceapiPackages"; $params["package_srls"] = $package_srl; $body = XmlGenerater::generate($params); diff --git a/modules/autoinstall/autoinstall.model.php b/modules/autoinstall/autoinstall.model.php index 5166b89ab..c3bed9eb9 100644 --- a/modules/autoinstall/autoinstall.model.php +++ b/modules/autoinstall/autoinstall.model.php @@ -189,10 +189,22 @@ if(substr($path,-1) == '/') $path = substr($path, 0, strlen($path)-1); - $args->path = $path; - $output = executeQuery('autoinstall.getPackageSrlByPath', $args); + if (!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path]) + { + $args->path = $path; + $output = executeQuery('autoinstall.getPackageSrlByPath', $args); - return $output->data->package_srl; + $GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path] = $output->data->package_srl; + } + + return $GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path]; + } + + function getRemoveUrlByPackageSrl($packageSrl) + { + if (!$packageSrl) return; + + return getUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminUninstall', 'package_srl', $packageSrl); } function getRemoveUrlByPath($path) @@ -205,5 +217,21 @@ return getUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminUninstall', 'package_srl', $packageSrl); } + function getUpdateUrlByPackageSrl($packageSrl) + { + if (!$packageSrl) return; + + return getUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminInstall', 'package_srl', $packageSrl); + } + + function getUpdateUrlByPath($path) + { + if (!$path) return; + + $packageSrl = $this->getPackageSrlByPath($path); + if (!$packageSrl) return; + + return getUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminInstall', 'package_srl', $packageSrl); + } } ?> diff --git a/modules/autoinstall/lang/en.lang.php b/modules/autoinstall/lang/en.lang.php index 515b82f23..87a4fa05b 100644 --- a/modules/autoinstall/lang/en.lang.php +++ b/modules/autoinstall/lang/en.lang.php @@ -35,4 +35,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "Dependant package list of the current package"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/lang/jp.lang.php b/modules/autoinstall/lang/jp.lang.php index f639862b3..4296a540d 100644 --- a/modules/autoinstall/lang/jp.lang.php +++ b/modules/autoinstall/lang/jp.lang.php @@ -34,4 +34,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "このパッケージに依存するパッケージのリスト"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/lang/ko.lang.php b/modules/autoinstall/lang/ko.lang.php index 1e202e417..f58020900 100644 --- a/modules/autoinstall/lang/ko.lang.php +++ b/modules/autoinstall/lang/ko.lang.php @@ -34,4 +34,6 @@ $lang->ftp_password = 'FTP 비밀번호'; $lang->msg_dependency_package = '이 패키지를 의존하고 있는 다른 패키지가 있기 때문에 삭제할 수 없습니다.'; $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->msg_avail_update = '이 항목 업데이트가 가능합니다.'; + $lang->msg_do_you_like_update = '업데이트 하시겠습니까?'; ?> diff --git a/modules/autoinstall/lang/ru.lang.php b/modules/autoinstall/lang/ru.lang.php index ba848721b..47a8c2bfd 100644 --- a/modules/autoinstall/lang/ru.lang.php +++ b/modules/autoinstall/lang/ru.lang.php @@ -34,4 +34,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "Dependant package list of the current package"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/lang/tr.lang.php b/modules/autoinstall/lang/tr.lang.php index 37e222e4b..e3b7ee750 100644 --- a/modules/autoinstall/lang/tr.lang.php +++ b/modules/autoinstall/lang/tr.lang.php @@ -34,4 +34,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "Mevcut pakete bağlı paket listesi"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/lang/vi.lang.php b/modules/autoinstall/lang/vi.lang.php index a26b993b0..61a5a963c 100644 --- a/modules/autoinstall/lang/vi.lang.php +++ b/modules/autoinstall/lang/vi.lang.php @@ -34,4 +34,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "Gói cài đặt này phụ thuộc vào các gói khác trong danh sách"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/lang/zh-CN.lang.php b/modules/autoinstall/lang/zh-CN.lang.php index ce21fdbad..084d329dc 100644 --- a/modules/autoinstall/lang/zh-CN.lang.php +++ b/modules/autoinstall/lang/zh-CN.lang.php @@ -34,4 +34,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "联动数据包列表"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/lang/zh-TW.lang.php b/modules/autoinstall/lang/zh-TW.lang.php index 04eba9f31..91a625926 100644 --- a/modules/autoinstall/lang/zh-TW.lang.php +++ b/modules/autoinstall/lang/zh-TW.lang.php @@ -35,4 +35,6 @@ $lang->ftp_password = 'FTP password'; $lang->msg_dependency_package = 'Can not remove this package because there exists another package dependent on this.'; $lang->dependant_list = "與此程式相關程式列表"; + $lang->msg_avail_update = 'There is available update for this item.'; + $lang->msg_do_you_like_update = 'Would you like to update?'; ?> diff --git a/modules/autoinstall/tpl/install.html b/modules/autoinstall/tpl/install.html index 9cf0f4bba..8eb1c7140 100644 --- a/modules/autoinstall/tpl/install.html +++ b/modules/autoinstall/tpl/install.html @@ -32,6 +32,7 @@ +