From c9e6869c681fa6579d1858cea45ec94eb0972f30 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 2 Dec 2009 19:08:13 -0800 Subject: Rename the "upload_limit" variable to "simultaneous_upload_limit" for clarity, since it only limits concurrency not the number of actual uploads. Move the default-setting code into the upgrader so that we avoid creating the variable as a side-effect of the view (personal preference to avoid side-effect code since it's led to problems in the past). --- modules/gallery/helpers/gallery_installer.php | 7 +++++++ modules/gallery/libraries/Form_Uploadify.php | 8 +------- modules/gallery/module.info | 3 +-- modules/gallery/views/form_uploadify.html.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 57a5ee9f..39859b36 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -432,6 +432,13 @@ class gallery_installer { module::clear_var("gallery", "blocks_site.sidebar"); module::set_version("gallery", $version = 19); } + + // Set a default for the number of simultaneous uploads + // Version 20 was reverted in 57adefc5baa7a2b0dfcd3e736e80c2fa86d3bfa2, so skip it. + if ($version == 19 || $version == 20) { + module::set_var("gallery", "simultaneous_upload_limit", 5); + module::set_version("gallery", $version = 21); + } } static function uninstall() { diff --git a/modules/gallery/libraries/Form_Uploadify.php b/modules/gallery/libraries/Form_Uploadify.php index 52fa45f0..9d76153d 100644 --- a/modules/gallery/libraries/Form_Uploadify.php +++ b/modules/gallery/libraries/Form_Uploadify.php @@ -45,13 +45,7 @@ class Form_Uploadify_Core extends Form_Input { $v = new View("form_uploadify.html"); $v->album = $this->data["album"]; $v->script_data = $this->data["script_data"]; - $upload_limit = module::get_var("gallery", "upload_limit"); - if (empty($upload_limit)) { - $upload_limit = 5; - module::set_var("gallery", "upload_limit", 5); - } - - $v->upload_limit = $upload_limit; + $v->simultaneous_upload_limit = module::get_var("gallery", "simultaneous_upload_limit"); return $v; } diff --git a/modules/gallery/module.info b/modules/gallery/module.info index ba1ee91d..b3366f7d 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,5 +1,4 @@ name = "Gallery 3" description = "Gallery core application" -; Note: skip version 20, use 21 as the next version -version = 19 +version = 21 diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index c18bc8ca..d856c464 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -24,7 +24,7 @@ fileDesc: for_js() ?>, cancelImg: "", buttonText: for_js() ?>, - simUploadLimit: , + simUploadLimit: , wmode: "transparent", hideButton: true, /* should be true */ auto: true, -- cgit v1.2.3