diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-27 16:27:06 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-27 16:29:09 -0700 |
commit | aad0dd357f44c75703e4d6368a1869a83e7ee8a2 (patch) | |
tree | 6982f067d8d50d12456db1f3ec93f18e411df4d8 /modules/digibug/helpers | |
parent | 2fbc03437ac6f861f597778964cf01737968bb94 (diff) |
Create a new thumb_menu() and convert Digibug over to use it.
1) Eliminate digibug_album.html
2) Get rid of the $(document).ready() in digibug.js and rename popUp() to
digibug_popup() then just make direct calls to digibug_popup() in the
menu urls.
Diffstat (limited to 'modules/digibug/helpers')
-rw-r--r-- | modules/digibug/helpers/digibug_menu.php | 26 | ||||
-rw-r--r-- | modules/digibug/helpers/digibug_theme.php | 11 |
2 files changed, 19 insertions, 18 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 ""; - } } |