From fcc446bf006f88d2079f52ed559c31f01c156dbe Mon Sep 17 00:00:00 2001 From: ckieffer Date: Sat, 8 May 2010 13:54:27 -0600 Subject: Move print with digibug to the site menu. --- modules/digibug/helpers/digibug_event.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'modules/digibug/helpers') diff --git a/modules/digibug/helpers/digibug_event.php b/modules/digibug/helpers/digibug_event.php index cf7cdf21..4c842615 100644 --- a/modules/digibug/helpers/digibug_event.php +++ b/modules/digibug/helpers/digibug_event.php @@ -26,14 +26,17 @@ class digibug_event_Core { ->url(url::site("admin/digibug"))); } - static function photo_menu($menu, $theme) { + static function site_menu($menu, $theme) { $item = $theme->item(); - $menu->append(Menu::factory("link") - ->id("digibug") - ->label(t("Print with Digibug")) - ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) - ->css_id("g-print-digibug-link") - ->css_class("g-print-digibug-link ui-icon-print")); + if ($item->type == "photo") { + $menu->get("options_menu") + ->append(Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) + ->css_id("g-print-digibug-link") + ->css_class("g-print-digibug-link ui-icon-print")); + } } static function context_menu($menu, $theme, $item) { -- cgit v1.2.3 From c682ba86bdc6b7661e35e3913be73b4cba5c0896 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 May 2010 22:37:10 -0700 Subject: Make sure that $item exists in site_menu(). --- modules/digibug/helpers/digibug_event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/digibug/helpers') diff --git a/modules/digibug/helpers/digibug_event.php b/modules/digibug/helpers/digibug_event.php index 4c842615..413bf586 100644 --- a/modules/digibug/helpers/digibug_event.php +++ b/modules/digibug/helpers/digibug_event.php @@ -28,7 +28,7 @@ class digibug_event_Core { static function site_menu($menu, $theme) { $item = $theme->item(); - if ($item->type == "photo") { + if ($item && $item->type == "photo") { $menu->get("options_menu") ->append(Menu::factory("link") ->id("digibug") -- cgit v1.2.3