From a246b6fe450e21f735824d5a089a8e652b12885f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 7 Aug 2011 13:27:27 -0700 Subject: Initial commit of a patch for Ticket #1764. as discussed here: https://github.com/gallery/gallery3/pull/58/files#r72949. Create a Breadcrumb library which has two static methods for_item (which takes a an item and builds the entire breadcrumb for the item) or build (which takes a variable number of Breadcrumb elements and creates a breadcrumb based on the specified elements). Used tag->url() to build the tag album url. Escaped the query string for the search. Tightened up the breadcrumb code in page.html.php. When adding the show query parameter, we can't blindly concatenate using the ? separator. We have to check that we use a & if a query parameter already exists. --- modules/gallery/controllers/albums.php | 1 + modules/gallery/controllers/movies.php | 1 + modules/gallery/controllers/photos.php | 1 + 3 files changed, 3 insertions(+) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index ccf6c1cb..90071fb5 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -69,6 +69,7 @@ class Albums_Controller extends Items_Controller { "item" => $album, "children" => $album->viewable()->children($page_size, $offset), "parents" => $album->parents()->as_array(), // view calls empty() on this + "breadcrumbs" => Breadcrumb::build_from_item($album), "children_count" => $children_count)); $template->content = new View("album.html"); diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php index 8e81c594..77d92e13 100644 --- a/modules/gallery/controllers/movies.php +++ b/modules/gallery/controllers/movies.php @@ -43,6 +43,7 @@ class Movies_Controller extends Items_Controller { "children" => array(), "children_count" => 0, "parents" => $movie->parents()->as_array(), + "breadcrumbs" => Breadcrumb::build_from_item($movie), "next_item" => $next_item, "previous_item" => $previous_item, "sibling_count" => $movie->parent()->viewable()->children_count($where), diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 054300a1..5c8c7b34 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -43,6 +43,7 @@ class Photos_Controller extends Items_Controller { "children" => array(), "children_count" => 0, "parents" => $photo->parents()->as_array(), + "breadcrumbs" => Breadcrumb::build_from_item($photo), "next_item" => $next_item, "previous_item" => $previous_item, "sibling_count" => $photo->parent()->viewable()->children_count($where), -- cgit v1.2.3