From fc5d1e5d74124de0dd8de361fe08e83653f960a2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 27 Dec 2009 12:41:52 -0800 Subject: [PATCH 1/3] Fix a bug where we weren't replacing table names when there's no prefix. This is wrong because even when there's no prefix we have to get rid of the {curly} braces. --- modules/gallery/libraries/MY_Database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/libraries/MY_Database.php b/modules/gallery/libraries/MY_Database.php index de3e5a84be..61f23fb03b 100644 --- a/modules/gallery/libraries/MY_Database.php +++ b/modules/gallery/libraries/MY_Database.php @@ -39,7 +39,7 @@ protected function __construct(array $config) { * table prefix . $1 */ public function query($sql = '') { - if ($this->config["table_prefix"] && !empty($sql)) { + if (!empty($sql)) { $sql = $this->add_table_prefixes($sql); } return parent::query($sql); From 754c531c7ec77278e44669ee5a854dd4653120f8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 27 Dec 2009 13:37:39 -0800 Subject: [PATCH 2/3] Only mark a variable as empty if its value is null. So 0 shows as 0. --- modules/gallery/views/admin_advanced_settings.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php index ff4843ab9f..2d4b11a1c8 100644 --- a/modules/gallery/views/admin_advanced_settings.html.php +++ b/modules/gallery/views/admin_advanced_settings.html.php @@ -25,7 +25,7 @@ module_name/" . html::clean($var->name)) ?>" class="g-dialog-link" title=" $var->name, "module_name" => $var->module_name))->for_html_attr() ?>"> - value): ?> + value)): ?> value) ?> From 38f2784fbbb0661dc57627d2878cb640bbffe271 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 27 Dec 2009 13:40:38 -0800 Subject: [PATCH 3/3] Allow users to upscale images in the slideshow by making the maxScale parameter configurable in Admin > Settings > Advanced. You specify the scaling factor. Normally, images fill the stage; 0 -> never scale up; any other positive number S --> scale up to S times the original size of the photo (but never bigger than the stage) --- modules/slideshow/helpers/slideshow_event.php | 9 ++++++--- modules/slideshow/helpers/slideshow_installer.php | 12 ++++++++++++ modules/slideshow/module.info | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php index baf896fe66..c4d7c56d4e 100644 --- a/modules/slideshow/helpers/slideshow_event.php +++ b/modules/slideshow/helpers/slideshow_event.php @@ -31,31 +31,34 @@ static function module_change($changes) { } static function album_menu($menu, $theme) { + $max_scale = module::get_var("slideshow", "max_scale"); if ($theme->item()->descendants_count(array(array("type", "=", "photo")))) { $menu->append(Menu::factory("link") ->id("slideshow") ->label(t("View slideshow")) ->url("javascript:cooliris.embed.show(" . - "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})") + "{maxScale:$max_scale,feed:'" . self::_feed_url($theme) . "'})") ->css_id("g-slideshow-link")); } } static function photo_menu($menu, $theme) { + $max_scale = module::get_var("slideshow", "max_scale"); $menu->append(Menu::factory("link") ->id("slideshow") ->label(t("View slideshow")) ->url("javascript:cooliris.embed.show(" . - "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})") + "{maxScale:$max_scale,feed:'" . self::_feed_url($theme) . "'})") ->css_id("g-slideshow-link")); } static function tag_menu($menu, $theme) { + $max_scale = module::get_var("slideshow", "max_scale"); $menu->append(Menu::factory("link") ->id("slideshow") ->label(t("View slideshow")) ->url("javascript:cooliris.embed.show(" . - "{maxScale:0,feed:'" . self::_feed_url($theme) . "'})") + "{maxScale:$max_scale,feed:'" . self::_feed_url($theme) . "'})") ->css_id("g-slideshow-link")); } diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php index 56874a6a65..03f3332c48 100644 --- a/modules/slideshow/helpers/slideshow_installer.php +++ b/modules/slideshow/helpers/slideshow_installer.php @@ -18,6 +18,18 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class slideshow_installer { + static function install() { + module::set_var("slideshow", "max_scale", 0); + module::set_version("slideshow", 2); + } + + static function upgrade($version) { + if ($version == 1) { + module::set_var("slideshow", "max_scale", 0); + module::set_version("slideshow", $version = 2); + } + } + static function deactivate() { site_status::clear("slideshow_needs_rss"); } diff --git a/modules/slideshow/module.info b/modules/slideshow/module.info index 6841199a76..b56eac814f 100644 --- a/modules/slideshow/module.info +++ b/modules/slideshow/module.info @@ -1,3 +1,3 @@ name = "Slideshow" description = "Allows users to view a slideshow of photos" -version = 1 +version = 2