Fixing showAjaxDialog and WCF.ACP.Worker
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 14 Sep 2012 15:06:14 +0000 (17:06 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 14 Sep 2012 15:23:18 +0000 (17:23 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/worker.tpl
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php

index ddf4d01011d1cf0137fbbaf20f8824cb7b08d17d..be267ab3252b7b4ad564473bfecd2df7d1226c96 100644 (file)
@@ -797,15 +797,14 @@ WCF.ACP.Worker.prototype = {
                
                // initialize AJAX-based dialog
                WCF.showAJAXDialog(this._dialogID, true, {
-                       ajax: {
-                               url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND,
-                               type: 'POST',
-                               data: {
-                                       className: className,
-                                       parameters: options
-                               },
-                               success: $.proxy(this._handleResponse, this)
+                       url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND,
+                       type: 'POST',
+                       data: {
+                               className: className,
+                               parameters: options
                        },
+                       success: $.proxy(this._handleResponse, this),
+                       
                        preventClose: true,
                        hideTitle: true
                });
@@ -814,15 +813,12 @@ WCF.ACP.Worker.prototype = {
        /**
         * Handles response from server.
         */
-       _handleResponse: function() {
+       _handleResponse: function($data) {
                // init binding
                if (this._dialog === null) {
                        this._dialog = $('#' + $.wcfEscapeID(this._dialogID));
                }
                
-               // fetch data returned by server response
-               var $data = this._dialog.data('responseData');
-               
                // update progress
                this._dialog.find('#workerProgress').attr('value', $data.progress).text($data.progress + '%');
                
@@ -837,10 +833,7 @@ WCF.ACP.Worker.prototype = {
                                        loopCount: $data.loopCount,
                                        parameters: $data.parameters
                                },
-                               success: $.proxy(function(data) {
-                                       this._dialog.data('responseData', data);
-                                       this._handleResponse();
-                               }, this),
+                               success: $.proxy(this._handleResponse, this),
                                error: function(transport) {
                                        alert(transport.responseText);
                                }
index 8eb0c2808393275eb544f00e71acc724bcb357bf..a646d7b69d38f14a7509e7db397c66382cd4a309 100644 (file)
@@ -1,6 +1,6 @@
 <div id="workerContainer">
-       <header>
-               <img src="{@$__wcf->getPath()}icon/working.svg" alt="" class="wcf-containerIcon" />
+       <header class="box48 boxHeadline">
+               <img src="{@$__wcf->getPath()}icon/working.svg" alt="" class="icon48" />
                <hgroup class="wcf-containerIcon">
                        <h1>Aufgaben werden ausgeführt &hellip;</h1><!--ToDo: Language variables -->
                        <h2>Aktueller Schritt: <span id="workerAction">{lang}wcf.package.installation.step.prepare{/lang}</span></h2>
index dca3d9bbe2c194ee84eda6c47060131f38fbcbaf..7c204d4510f0086a43430f713896a5910d1d8931 100755 (executable)
@@ -475,8 +475,10 @@ $.extend(WCF, {
                }
                
                var dialogOptions = arguments[2] || {};
+               dialogOptions.ajax = true;
+               
                dialog.wcfDialog(dialogOptions);
-
+               
                return dialog;
        },
        
@@ -6508,7 +6510,7 @@ $.widget('ui.wcfDialog', {
                if (this.options.closeButtonLabel === null) {
                        this.options.closeButtonLabel = WCF.Language.get('wcf.global.close');
                }
-
+               
                if (this.options.ajax) {
                        new WCF.Action.Proxy({
                                autoSend: true,
index 874950cd6c032cf3eace419e7e9d68389c5482a3..9ad0bb378fe3ddc571b12b43ddbadebbc8488c39 100644 (file)
@@ -45,9 +45,9 @@ class WorkerProxyAction extends AbstractSecureAction {
        /**
         * @see wcf\action\AbstractAction::_construct()
         */
-       public function __construct() {
+       public function __run() {
                try {
-                       parent::__construct();
+                       parent::__run();
                }
                catch (\Exception $e) {
                        if ($e instanceof AJAXException) {