From c1da32e6a7e2f4a15a3b2d69cd38a1c0c164a99d Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 8 Jun 2012 15:23:47 -0700 Subject: Fixed invalid SQL caused by sorting an empty album. Also hiding slideshow and sort links for albums with no images. --- pages/photos/album/sort.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pages/photos/album/sort.php') diff --git a/pages/photos/album/sort.php b/pages/photos/album/sort.php index 8b6d1bfc7..005205dd5 100644 --- a/pages/photos/album/sort.php +++ b/pages/photos/album/sort.php @@ -33,8 +33,18 @@ if (elgg_instanceof($owner, 'group')) { elgg_push_breadcrumb($album->getTitle(), $album->getURL()); elgg_push_breadcrumb(elgg_echo('album:sort')); +elgg_register_menu_item('title', array( + 'name' => 'upload', + 'href' => 'photos/upload/' . $album->getGUID(), + 'text' => elgg_echo('images:upload'), + 'link_class' => 'elgg-button elgg-button-action', +)); -$content = elgg_view_form('photos/album/sort', array(), array('album' => $album)); +if ($album->getSize()) { + $content = elgg_view_form('photos/album/sort', array(), array('album' => $album)); +} else { + $content = elgg_echo('tidypics:sort:no_images'); +} $body = elgg_view_layout('content', array( 'filter' => false, -- cgit v1.2.3