Skip to content

Commit

Permalink
Allow users to upscale images in the slideshow by making the maxScale
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bharat committed Dec 27, 2009
1 parent 754c531 commit 38f2784
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
9 changes: 6 additions & 3 deletions modules/slideshow/helpers/slideshow_event.php
Expand Up @@ -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"));
}

Expand Down
12 changes: 12 additions & 0 deletions modules/slideshow/helpers/slideshow_installer.php
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion modules/slideshow/module.info
@@ -1,3 +1,3 @@
name = "Slideshow"
description = "Allows users to view a slideshow of photos"
version = 1
version = 2

0 comments on commit 38f2784

Please sign in to comment.