diff options
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 6 | ||||
-rw-r--r-- | modules/gallery/libraries/Menu.php | 13 | ||||
-rw-r--r-- | modules/gallery/views/menu.html.php | 4 | ||||
-rw-r--r-- | modules/gallery/views/menu_ajax_link.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/menu_dialog.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/menu_link.html.php | 2 |
6 files changed, 21 insertions, 8 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 63f33c12..faf1c0c6 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -336,7 +336,7 @@ class gallery_event_Core { ->css_class("ui-icon-rotate-ccw") ->ajax_handler("function(data) { " . "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }") - ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))) + ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))) ->append( Menu::factory("ajax_link") ->id("rotate_cw") @@ -344,7 +344,7 @@ class gallery_event_Core { ->css_class("ui-icon-rotate-cw") ->ajax_handler("function(data) { " . "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }") - ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); + ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); } // @todo Don't move photos from the photo page; we don't yet have a good way of redirecting @@ -384,7 +384,7 @@ class gallery_event_Core { ->label($delete_title) ->css_class("ui-icon-trash") ->css_id("g-quick-delete") - ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); + ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); } if ($item->is_album()) { diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index e2b68d1a..7c76ab04 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -216,6 +216,19 @@ class Menu_Core extends Menu_Element { return null; } + public function is_empty() { + foreach ($this->elements as $element) { + if ($element instanceof Menu) { + if (!$element->is_empty()) { + return false; + } + } else { + return false; + } + } + return true; + } + public function render() { $view = new View(isset($this->view) ? $this->view : "menu.html"); $view->menu = $this; diff --git a/modules/gallery/views/menu.html.php b/modules/gallery/views/menu.html.php index cb49bcdf..17a249dd 100644 --- a/modules/gallery/views/menu.html.php +++ b/modules/gallery/views/menu.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<? if ($menu->elements): // Don't show the menu if it has no choices ?> +<? if (!$menu->is_empty()): // Don't show the menu if it has no choices ?> <? if ($menu->is_root): ?> -<ul <?= isset($menu->css_id) ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>"> +<ul <?= $menu->css_id ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>"> <? foreach ($menu->elements as $element): ?> <?= $element->render() ?> <? endforeach ?> diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php index 00a394bc..06cd6f92 100644 --- a/modules/gallery/views/menu_ajax_link.html.php +++ b/modules/gallery/views/menu_ajax_link.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <li> - <a id="<?= $menu->css_id ?>" + <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?> class="g-ajax-link <?= $menu->css_class ?>" href="<?= $menu->url ?>" title="<?= $menu->label->for_html_attr() ?>" diff --git a/modules/gallery/views/menu_dialog.html.php b/modules/gallery/views/menu_dialog.html.php index 99b1b013..b44080c3 100644 --- a/modules/gallery/views/menu_dialog.html.php +++ b/modules/gallery/views/menu_dialog.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <li> - <a id="<?= $menu->css_id ?>" + <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?> class="g-dialog-link <?= $menu->css_class ?>" href="<?= $menu->url ?>" title="<?= $menu->label->for_html_attr() ?>"> diff --git a/modules/gallery/views/menu_link.html.php b/modules/gallery/views/menu_link.html.php index 8e4cdb95..a36d2754 100644 --- a/modules/gallery/views/menu_link.html.php +++ b/modules/gallery/views/menu_link.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <li> - <a id="<?= $menu->css_id ?>" + <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?> class="g-menu-link <?= $menu->css_class ?>" href="<?= $menu->url ?>" title="<?= $menu->label->for_html_attr() ?>"> |