module_upload modification proposal

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

module_upload modification proposal

Postby janniz » Tue Jun 21, 2011 8:07 am

Hi,
is there a method to obtain the name of the plupload object instanced by module_upload+inc_plupload_element.tpl while rendering [[upload_create_button ...]] ?

Looking at the sources I've found that upload_var is initialized to a random value:
Code: Select all
$params['upload_var'] = 'uploader'.rand(10000,99999);

albeit I understand that there is certainly a reason for making that (maybe having more than an instance in the same page), I'm really suffering :) by the lack of a method to obtain a reference to the instanced object... I know that uploadxxxxx is referenced by 'window' object, but I think that will be much better to give the possibility to chose the name of this variable from the [[upload_create_button ]] caller... In this manner writing extensions based on upload_module will be much more simple...

So my proposal is to modify module_upload, replacing the line above with this piece of code (nearly line 80 of module_upload.php):
Code: Select all
if (!isset($params['upload_var'])) {
  $params['upload_var'] = 'uploader'.rand(10000,99999);
}


What do you think about that ?

Thanks...
janniz
 
Posts: 15
Joined: Mon Feb 11, 2008 2:39 pm

Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 8 guests

cron