From da523de77727a3d529a88b8ca1abec5ec4d2a4cc Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 8 Aug 2011 20:28:31 -0700 Subject: Simplification of 59b04b897b8a664cd7334b017fac8158a6281434 for #1764: - Breadcrumb::build_from_item becomes Breadcrumb::array_from_item_parents - Eliminate Breadcrumb::$id -- it's no longer necessary - Fold Breadcrumb::generate_show_query_strings into Breadcrumb::array_from_item_parents - Create Breadcrumb::set_first() and Breadcrumb::set_last() - Breadcrumb::build_from_list goes away, we just use arrays for this - Change Search_Controller and Tag_Controller to just create an array of Breadcrumb instances with the first/last marked appropriately - Breadcrumb_Test loses a bunch of complexity. --- modules/tag/controllers/tag.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'modules/tag/controllers') diff --git a/modules/tag/controllers/tag.php b/modules/tag/controllers/tag.php index 44a171fd..7786daa1 100644 --- a/modules/tag/controllers/tag.php +++ b/modules/tag/controllers/tag.php @@ -34,16 +34,18 @@ class Tag_Controller extends Controller { url::redirect(url::merge(array("page" => $max_pages))); } + $root = item::root(); $template = new Theme_View("page.html", "collection", "tag"); - $template->set_global(array("page" => $page, - "max_pages" => $max_pages, - "page_size" => $page_size, - "tag" => $tag, - "children" => $tag->items($page_size, $offset), - "breadcrumbs" => Breadcrumb::build_from_list( - new Breadcrumb(item::root()->title, "/", item::root()->id), - new Breadcrumb($tag->name, $tag->url())), - "children_count" => $children_count)); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "tag" => $tag, + "children" => $tag->items($page_size, $offset), + "breadcrumbs" => array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance($tag->name, $tag->url())->set_last()), + "children_count" => $children_count)); $template->content = new View("dynamic.html"); $template->content->title = t("Tag: %tag_name", array("tag_name" => $tag->name)); -- cgit v1.2.3