diff --git a/3.0/modules/fotomotorw/helpers/fotomotorw_event.php b/3.0/modules/fotomotorw/helpers/fotomotorw_event.php index 24bdc5f1..9e58b9d0 100644 --- a/3.0/modules/fotomotorw/helpers/fotomotorw_event.php +++ b/3.0/modules/fotomotorw/helpers/fotomotorw_event.php @@ -27,4 +27,16 @@ class fotomotorw_event_Core { ->label(t("Fotomoto")) ->url(url::site("admin/fotomotorw"))); } + + static function context_menu($menu, $theme, $item) { + // Add a "Buy Prints" option to the photo's thumbnail menu. + if ($item->type == "photo") { + $menu->get("options_menu") + ->append(Menu::factory("link") + ->id("fotomotorw") + ->label(t("Buy Prints")) + ->url("javascript:showFotomotoDialog(100, '" . url::abs_site("fotomotorw/resize/" . md5($item->created) . "/{$item->id}") . "');") + ->css_class("g-print-fotomotorw-link ui-icon-print")); + } + } } diff --git a/3.0/modules/fotomotorw/helpers/fotomotorw_theme.php b/3.0/modules/fotomotorw/helpers/fotomotorw_theme.php index ac2e38ba..76cce885 100644 --- a/3.0/modules/fotomotorw/helpers/fotomotorw_theme.php +++ b/3.0/modules/fotomotorw/helpers/fotomotorw_theme.php @@ -18,20 +18,21 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class fotomotorw_theme_Core { +class fotomotorw_theme_Core { static function head($theme) { - // Load fotomoto's js file on photo pages. - if($theme->page_subtype == "photo") { + // Load fotomoto's js file on photo and album pages. + if(($theme->page_subtype == "photo") || ($theme->page_subtype == "album")) { return html::script('http://widget.fotomoto.com/stores/script/' . module::get_var("fotomotorw", "fotomoto_site_key") . '.js?api=true'); } } static function resize_bottom($theme) { - // Generate an array of links to display below photos. + // Create a new block to use to display Fotomoto buy links below the photo. $block = new Block; $block->css_id = "g-fotomoto"; $block->anchor = "fotomoto"; + // Generate an array of links to display below photos. $link_array = array(); $counter = 0; if (module::get_var("fotomotorw", "fotomoto_buy_prints")) { @@ -63,9 +64,19 @@ class fotomotorw_theme_Core { $counter++; } - $view = new View("fotomotorw_block.html"); + $view = new View("fotomotorw_photo_block.html"); $view->details = $link_array; $block->content = $view; return $block; } + + static function album_bottom($theme) { + // Add some javascript to the bottom of album pages. + $block = new Block; + $block->css_id = "g-fotomoto"; + $block->anchor = "fotomoto"; + $view = new View("fotomotorw_album_block.html"); + $block->content = $view; + return $block; + } } diff --git a/3.0/modules/fotomotorw/views/fotomotorw_album_block.html.php b/3.0/modules/fotomotorw/views/fotomotorw_album_block.html.php new file mode 100644 index 00000000..77bf2f2b --- /dev/null +++ b/3.0/modules/fotomotorw/views/fotomotorw_album_block.html.php @@ -0,0 +1,6 @@ + + diff --git a/3.0/modules/fotomotorw/views/fotomotorw_block.html.php b/3.0/modules/fotomotorw/views/fotomotorw_photo_block.html.php similarity index 100% rename from 3.0/modules/fotomotorw/views/fotomotorw_block.html.php rename to 3.0/modules/fotomotorw/views/fotomotorw_photo_block.html.php