Permalink
Browse files

correction of batch job (fix view with Chrome) and load module.css

  • Loading branch information...
nao-pon committed May 18, 2015
1 parent 2a8aa8f commit 8ae2eb73fcb76be6b05751e5fc175011ef6ed6d3
@@ -82,6 +82,10 @@ input[type="radio"] {
}
/* for list table */
#xupdate td {
vertical-align: middle;
padding: 3px;
}
.legacy_list_id {
text-align:center;
}
@@ -28,7 +28,7 @@ <h3 class="admintitle"><{$smarty.const._MI_XUPDATE_ADMENU_ADDONSTORE}></h3>
document.location.href = next_link_url;
}
}
})(jquery);
});
</script>
<{/if}>
@@ -112,7 +112,8 @@ protected function _getActionName()
**/
protected function _getStylesheet()
{
return $this->mRoot->mContext->mModuleConfig['css_file'];
//return $this->mRoot->mContext->mModuleConfig['css_file'];
return '/modules/xupdate/admin/templates/stylesheets/module.css';
}
/**
@@ -367,11 +367,14 @@ function executeViewCancel(&$renderer)
public function RapidInstall_js()
{
$message_InstallPre = _AD_XUPDATE_INSTALL_PRE;
$message_Install = _INSTALL;
$message_UpdatePre = _AD_XUPDATE_UPDATE_PRE;
$message_Update = _MI_XUPDATE_UPDATE;
$message_Error = _ERRORS;
$message_Waiting = _AD_XUPDATE_LANG_MESSAGE_WAITING;
$message_Success = _AD_XUPDATE_LANG_MESSAGE_SUCCESS;
$message_Getting_filesPre = _AD_XUPDATE_LANG_MESSAGE_GETTING_FILES_PRE;
$message_Getting_files = _AD_XUPDATE_LANG_MESSAGE_GETTING_FILES;
$message_Processing = _AD_XUPDATE_LANG_MESSAGE_PROCESSING;
$message_btn_install = _MI_XUPDATE_ADMENU_MODULE._INSTALL;
@@ -390,6 +393,7 @@ public function RapidInstall_js()
var installationModules = [];
var installationModule = null;
var isInstallation = false;
var postRetry = 0;
var main = function()
{
@@ -408,8 +412,15 @@ public function RapidInstall_js()
var addDelegates = function()
{
$('body').delegate('#rapidModuleInstallButton', 'click', clickRapidModuleInstallButton)
.delegate('#rapidInstallCheckboxAll', 'click', checkAll);
$('body').on('click', '#rapidModuleInstallButton', clickRapidModuleInstallButton)
.on('click', '#rapidInstallCheckboxAll', checkAll);
$('body').on('click', '#rapidInstallCheckboxAll,input.rapidInstallCheckbox', function(){
var target = $('td.legacy_list_select:first');
if (! target.data('widthset')) {
target.data('widthset', true);
setTimeout(function(){target.css({width: '10em'});}, 100);
}
});
}
var clickRapidModuleInstallButton = function()
@@ -455,12 +466,12 @@ public function RapidInstall_js()
if (typeof installationModule.storehref != 'undefined'){
installationModule.td.html("{$message_Getting_files}{$message_Processing}");
installationModule.td.html("{$message_Getting_filesPre}{$message_Processing}");
try
{
postRetry = 0;
$.ajax({
type: 'GET',
async:false,
url: installationModule.storehref,
success: getStoreConfirmFormSuccess,
error: ajaxFailed
@@ -473,51 +484,18 @@ public function RapidInstall_js()
updateModuleStatus();
}
}
var result =installationModule.td.text();
if (result != '{$message_Getting_files}{$message_Success}'){
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
}else{
if (typeof installationModule.installhref != 'undefined'){
if (installationModule.isUpdate) {
installationModule.td.html("{$message_Update}{$message_Processing}");
} else {
installationModule.td.html("{$message_Install}{$message_Processing}");
}
try
{
$.ajax({
type: 'GET',
url: installationModule.installhref,
success: getConfirmFormSuccess,
error: ajaxFailed
});
}
catch ( e )
{
installationModule.td.html('<span style="color:red;">{$message_Error}</span>');
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
}
}else{
installationModule.td.html('<span style="color:red;">{$message_Error}</span>');
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
}
}
});
}
var getStoreConfirmFormSuccess = function(html)
{
var form = $(html).find('#contentBody form');
var formdata = form.serialize();
installationModule.td.html("{$message_Getting_files}{$message_Processing}");
if (typeof installationModule.installhref != 'undefined'){
$.ajax({
type: 'POST',
async:false,
url: installationModule.storehref,
data: formdata,
success: getStoreSuccess,
@@ -526,14 +504,50 @@ public function RapidInstall_js()
}
}
var getStoreSuccess = function(html)
{
var result = $(html).find('#xupdate_addModule a').text();
if (result == '{$message_btn_install}' || result == '{$message_btn_update}' || result == '{$message_btn_manage}' || result == '{$message_Getting_files}{$message_Success}'){
if (result == '{$message_btn_install}' || result == '{$message_btn_update}'){
installationModule.td.html('<span style="color:green;">{$message_Getting_files}{$message_Success}</span>');
}else{
installationModule.td.html('<span style="color:red;">{$message_Getting_files}{$message_Error}</span>');
if (typeof installationModule.installhref != 'undefined'){
if (installationModule.isUpdate) {
installationModule.td.html("{$message_UpdatePre}{$message_Processing}");
} else {
installationModule.td.html("{$message_InstallPre}{$message_Processing}");
}
try
{
postRetry = 0;
$.ajax({
type: 'GET',
url: installationModule.installhref,
success: getConfirmFormSuccess,
error: ajaxFailed
});
}
catch ( e )
{
installationModule.td.html('<span style="color:red;">{$message_Error}</span>');
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
}
} else {
installationModule.td.html('<span style="color:red;">{$message_Error}</span>');
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
}
} else if (result == '{$message_btn_manage}' || result == '{$message_Getting_files}{$message_Success}') {
installationModule.td.html('<span style="color:green;">{$message_Success}</span>');
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
} else {
var form = (postRetry < 3)? $(html).find('#contentBody form') : false;
if (form && form.length == 1) {
postRetry++;
getStoreConfirmFormSuccess(html);
} else {
installationModule.td.html('<span style="color:red;">{$message_Getting_files}{$message_Error}</span>');
}
}
}
@@ -542,6 +556,12 @@ public function RapidInstall_js()
var form = $(html).find('#contentBody form');
var formdata = form.serialize();
if (installationModule.isUpdate) {
installationModule.td.html("{$message_Update}{$message_Processing}");
} else {
installationModule.td.html("{$message_Install}{$message_Processing}");
}
if (typeof installationModule.installhref != 'undefined'){
$.ajax({
type: 'POST',
@@ -566,7 +586,13 @@ public function RapidInstall_js()
if (! error_result) {
installationModule.td.hide().html('<span style="color:green;">{$message_Success}</span>').show();
} else {
installationModule.td.html('<span style="color:red;">'+action+' {$message_Error}</span>');
var form = (postRetry < 3)? $(html).find('#contentBody form') : false;
if (form && form.length == 1) {
postRetry++;
getConfirmFormSuccess(html);
} else {
installationModule.td.html('<span style="color:red;">'+action+' {$message_Error}</span>');
}
}
installedModuleTotal = installInstallStatus(installedModuleTotal, installationModuleTotal);
updateModuleStatus();
@@ -292,7 +292,7 @@ public function execute(/*** XCube_Controller ***/ &$controller)
$render = $this->getRenderTarget();
$this->mAction->$methodName($render);
$render->setAttribute('xoops_pagetitle', $this->mAction->getPagetitle());
//$this->mAction->setHeaderScript();
$this->mAction->setHeaderScript();
}
}
}
@@ -36,7 +36,10 @@
define('_AD_XUPDATE_LANG_MESSAGE_BATCH_INSTALL', "Batch OP");
define('_AD_XUPDATE_LANG_MESSAGE_WAITING', "Waiting");
define('_AD_XUPDATE_LANG_MESSAGE_SUCCESS', "Success");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES', "getting files");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES_PRE', "Pre-getting");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES', "Getting files");
define('_AD_XUPDATE_UPDATE_PRE', "Pre-updating");
define('_AD_XUPDATE_INSTALL_PRE', "Pre-instaling");
define('_AD_XUPDATE_LANG_MESSAGE_PROCESSING', "...");
define('_AD_XUPDATE_LANG_BUTTON_UPDATE', 'Update');
@@ -36,7 +36,10 @@
define('_AD_XUPDATE_LANG_MESSAGE_BATCH_INSTALL', "一括操作");
define('_AD_XUPDATE_LANG_MESSAGE_WAITING', "待機中");
define('_AD_XUPDATE_LANG_MESSAGE_SUCCESS', "完了");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES_PRE', "配置準備");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES', "配置");
define('_AD_XUPDATE_UPDATE_PRE', "アップデート準備");
define('_AD_XUPDATE_INSTALL_PRE', "インストール準備");
define('_AD_XUPDATE_LANG_MESSAGE_PROCESSING', "");
define('_AD_XUPDATE_LANG_BUTTON_UPDATE', '更新');
@@ -36,7 +36,10 @@
define('_AD_XUPDATE_LANG_MESSAGE_BATCH_INSTALL', "一括操作");
define('_AD_XUPDATE_LANG_MESSAGE_WAITING', "待機中");
define('_AD_XUPDATE_LANG_MESSAGE_SUCCESS', "完了");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES_PRE', "配置準備");
define('_AD_XUPDATE_LANG_MESSAGE_GETTING_FILES', "配置");
define('_AD_XUPDATE_UPDATE_PRE', "アップデート準備");
define('_AD_XUPDATE_INSTALL_PRE', "インストール準備");
define('_AD_XUPDATE_LANG_MESSAGE_PROCESSING', "");
define('_AD_XUPDATE_LANG_BUTTON_UPDATE', '更新');

0 comments on commit 8ae2eb7

Please sign in to comment.