Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon
Posted: 11/18/09 00:58
When setting the $_args array for the jrProgressFormBegin function, the documents mention that you should add the modules form controller on the left side of the pipe and the mode to call in the form controller, once the file has been uploaded. Is there a way to post additional arguments to the right of the pipe? For example, how would I write the below url as the $_args array?
Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA
Posted: 11/18/09 11:46
musiccreatures:
When setting the $_args array for the jrProgressFormBegin function, the documents mention that you should add the modules form controller on the left side of the pipe and the mode to call in the form controller, once the file has been uploaded. Is there a way to post additional arguments to the right of the pipe? For example, how would I write the below url as the $_args array?
Code
mcClassifiedAds.php?mode=tools&task=createcat
Any help would be greatly appreciated.
Thanks,
Tim
You would include the task form value as a hidden parameter in your args - i.e.
Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon
Posted: 11/18/09 21:49
So i rewrote my modules form controller so that it no longer uses task as a second argument.
It now soley relies on "mode", as most form controllers use. The issue is, that the mode isn't being included, when the file is done uploading. I believe the below code is right, but apparently it isn't:
Code
$GLOBALS['JR_PROGRESS_ENABLE'] = true;
The above "special global flag" is located at the top of the form controllers code, next to the $GLOBALS['JR_SCRIPT_NAME'].
I have left out some of the other form elements, such as category_title & Category_description. But Im certain that they wouldn't cause this sort of behavior.
Once the form is submitted, I see that the page that is loaded(after file is uploaded is):
mcClassifiedAds.php
but querystring is not being passed. IE ?mode=savecat
Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon
Posted: 11/21/09 22:32
So after trying to get this progress meter to work, I decided to try to copy and paste the sample code from the Developers guide to my modules form controller. I wanted to see how it works, but I am getting the same issue. After the image is uploaded(or I assume it is uploaded) the form is calling the form controller again, but the mode is not being sent.
So instead of: mcClassifiedAds.php?mode=savecat
I see: mcClassifiedAds.php
Code
// Set our progress flag so we know to include the proper js
$GLOBALS['JR_PROGRESS_ENABLE'] = true;
jmHtmlBegin('File Upload');
$_args = array(
'mode' => 'mcClassifiedAds.php|savecat'
);
jrProgressFormBegin('mcClassifiedAds.php',$_args);
jmSpanCell('File Upload','This is the Help',30,'html_modify.png');
jmInput('Select a File',"meter_file_1",'file');
jrProgressBarHtml();
jrFormSubmit('Upload File','undo changes',false,'admin.php',false,true,'media');
jmEndForm();
jmBodyEnd();
jmHtmlEnd();
Any Ideas? One thing to note: my previous post mentioned that I had placed the JR_PROGRESS_ENABLE line, twards the top of the document. For this experiment, I commented out that line, so their is only 1 occurance of the line.
That I wasn't getting the mode passed with the form. I examined the browsers source code and noticed that the hidden form element for mode, had the pipe sign in it:
It seems to be working just fine, but I'd be interested to know if I am going to run into some issues, down the road? Please let me know if I am way off base, with this approach.