diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/digibug/helpers/digibug_menu.php | 26 | ||||
-rw-r--r-- | modules/digibug/helpers/digibug_theme.php | 11 | ||||
-rw-r--r-- | modules/digibug/js/digibug.js | 15 | ||||
-rw-r--r-- | modules/digibug/views/digibug_album.html.php | 8 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_menu.php | 3 | ||||
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 10 |
6 files changed, 32 insertions, 41 deletions
diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php index 6d127d72..4b8db5a2 100644 --- a/modules/digibug/helpers/digibug_menu.php +++ b/modules/digibug/helpers/digibug_menu.php @@ -28,12 +28,24 @@ class digibug_menu { static function photo($menu, $theme) { $item = $theme->item(); - $csrf = access::csrf_token(); - $menu - ->append(Menu::factory("link") - ->id("digibug") - ->label(t("Print with Digibug")) - ->url(url::site("digibug/print_photo/$item->id?csrf=$csrf")) - ->css_id("gDigibugLink")); + $menu->append( + Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url("javascript:digibug_popup('" . + url::site("digibug/print_photo/$item->id?csrf=$theme->csrf") . "')") + ->css_id("gDigibugLink")); + } + + static function thumb($menu, $theme, $item) { + if ($item->type == "photo" && access::can("view_full", $item)) { + $menu->append( + Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url("javascript:digibug_popup('" . + url::site("digibug/print_photo/$item->id?csrf=$theme->csrf") . "')") + ->css_id("gDigibugLink")); + } } } diff --git a/modules/digibug/helpers/digibug_theme.php b/modules/digibug/helpers/digibug_theme.php index a8e7e5b2..3b5be3b3 100644 --- a/modules/digibug/helpers/digibug_theme.php +++ b/modules/digibug/helpers/digibug_theme.php @@ -21,15 +21,4 @@ class digibug_theme_Core { static function head($theme) { return html::script("modules/digibug/js/digibug.js"); } - - static function thumb_bottom($theme, $child) { - if ($theme->page_type() == "album" && $child->type == "photo" && - access::can("view_full", $child)) { - $v = new View("digibug_album.html"); - $v->id = $child->id; - $v->title = t("Print photo with Digibug"); - return $v->render(); - } - return ""; - } } diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js index 456dfecb..78ca8cf3 100644 --- a/modules/digibug/js/digibug.js +++ b/modules/digibug/js/digibug.js @@ -1,17 +1,8 @@ -$(document).ready(function() { - $(".gDigibugPrintButton a").click(function(e) { - e.preventDefault(); - return popUp(e.currentTarget.href, { width: 800, height: 600 } ); - }); - $("#gDigibugLink").click(function(e) { - e.preventDefault(); - return popUp(e.currentTarget.href, { width: 800, height: 600 } ); - }); -}); - -function popUp(url, options) { +function digibug_popup(url, options) { options = $.extend({ /* default options */ + width: '800', + height: '600', target: 'dbPopWin', scrollbars: 'yes', resizable: 'no', diff --git a/modules/digibug/views/digibug_album.html.php b/modules/digibug/views/digibug_album.html.php deleted file mode 100644 index 2fd8803b..00000000 --- a/modules/digibug/views/digibug_album.html.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access.") ?> -<div class="gDigibugPrintButton"> - <a class="gButtonLink ui-corner-all ui-state-default ui-icon-left" - href="<?= url::site("digibug/print_photo/$id?csrf=$csrf") ?>" - title="<?= p::clean($title) ?>"> - <span class="ui-icon ui-icon-print"><?= p::clean($title) ?></span> - </a> -</div> diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index a25832fe..1f1e1ce2 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -94,6 +94,9 @@ class gallery_menu_Core { static function tag($menu, $theme) { } + static function thumb($menu, $theme, $item) { + } + static function photo($menu, $theme) { if (access::can("view_full", $theme->item())) { $menu->append(Menu::factory("link") diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 7b2ca840..4612a74b 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -121,16 +121,20 @@ class Theme_View_Core extends View { $this->_menu("photo"); } - private function _menu($type) { + public function thumb_menu($item) { + $this->_menu("thumb", $item); + } + + private function _menu($type, $item=null) { $menu = Menu::factory("root"); - call_user_func_array(array("gallery_menu", $type), array(&$menu, $this)); + call_user_func_array(array("gallery_menu", $type), array(&$menu, $this, $item)); foreach (module::active() as $module) { if ($module->name == "gallery") { continue; } $class = "{$module->name}_menu"; if (method_exists($class, $type)) { - call_user_func_array(array($class, $type), array(&$menu, $this)); + call_user_func_array(array($class, $type), array(&$menu, $this, $item)); } } |