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/search/controllers/search.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/search') diff --git a/modules/search/controllers/search.php b/modules/search/controllers/search.php index 261d67ee..d30ffa67 100644 --- a/modules/search/controllers/search.php +++ b/modules/search/controllers/search.php @@ -36,9 +36,14 @@ class Search_Controller extends Controller { $max_pages = max(ceil($count / $page_size), 1); $template = new Theme_View("page.html", "collection", "search"); + $root = item::root(); + $search_url = url::abs_site("search?q=" . urlencode($q)); $template->set_global(array("page" => $page, "max_pages" => $max_pages, "page_size" => $page_size, + "breadcrumbs" => Breadcrumb::build_from_list( + new Breadcrumb(item::root()->title, "/", item::root()->id), + new Breadcrumb($q, $search_url)), "children_count" => $count)); $template->content = new View("search.html"); -- cgit v1.2.3