diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-12-27 13:40:38 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-12-27 13:40:38 -0800 |
commit | 38f2784fbbb0661dc57627d2878cb640bbffe271 (patch) | |
tree | 9a39384ffd3af5fa76803b0df35200f443431e60 /modules/slideshow/helpers | |
parent | 754c531c7ec77278e44669ee5a854dd4653120f8 (diff) |
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)
Diffstat (limited to 'modules/slideshow/helpers')
-rw-r--r-- | modules/slideshow/helpers/slideshow_event.php | 9 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_installer.php | 12 |
2 files changed, 18 insertions, 3 deletions
diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php index baf896fe..c4d7c56d 100644 --- a/modules/slideshow/helpers/slideshow_event.php +++ b/modules/slideshow/helpers/slideshow_event.php @@ -31,31 +31,34 @@ class slideshow_event_Core { } 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 56874a6a..03f3332c 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"); } |