summaryrefslogtreecommitdiff
path: root/modules/tag
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-08-08 20:28:31 -0700
committerBharat Mediratta <bharat@menalto.com>2011-08-08 21:29:19 -0700
commitda523de77727a3d529a88b8ca1abec5ec4d2a4cc (patch)
tree09b027a42a13f464d0c88a29c548654dd60bd908 /modules/tag
parent8fd319918b8cafb48781fee02d2075473eb42267 (diff)
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.
Diffstat (limited to 'modules/tag')
-rw-r--r--modules/tag/controllers/tag.php20
1 files changed, 11 insertions, 9 deletions
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));