ZF-5813: Zend_ProgressBar_Adapter_JsPush

Description

Currently, Zend_ProgressBar_Adapter_JsPush, just works if the large proccess (that wil be monitored by the progressbar) runs in a hidden Iframe. I've started a improvement to make possible to do it with a ajax call to the larg process. It is very simple, I have just removed the tags, and the parent object in the return of the the finish and notify methods. I've included a $_ajaxAccess propertie too. If you set this propertie to FALSE (using setAjaxAccess() method), the class will work normaly, if you set it to TRUE, it will work with ajax. In the moment, the improvement, only work in firefox, but I'm working to portate it to other browsers to.

In javascript ajax return function, you need to use the eval() function to execute the string that returns from the class.

I hope it could be usefull.

Comments

here ir the modified JsPush adapter class

It basically looks good, tho it can only be implemented if the major browsers are supported by this method (>= IE6, >= FF2, >= Opera 9, >= Safari 3 and Chrome). When your method works there, it will be implemented with the next mini release.

About the naming, it should probably change. This has actually nothing to do with XML, so AJAX is the wrong naming. As long as setting this option only means, taking away the script tags, it should just be named setDisableScriptTags(boolean $disable = true).

Ok. But the setting does not mean just taking away the tags, it's a adaptation of the adapter class, to be used without a hidden iframe in the view code (taking away the parent object too), keeping just the function name, and the paramethers. In this mode, you can call the large proccess with ajax, and execute the return string with a eval javascript funcion, every time that the Zend_ProgressBar class made a change notify.

Maybe ajax is not the better name, but I thing that setDisableScriptTags, is a strange name. It will probably create a confusion. I'm waiting for suggestions.

What about setLocalCall, or setParentCall? This is the real function of this setting.

But the name doesn't matter now, first I'll try to make the code portable for the main browsers.

Thanks Ben.

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.