From ce43f29e2ceaac3d638061f81dc6037b5e0018d3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 27 Aug 2011 11:18:07 -0700 Subject: Refactor the display context code a bit: 1) Move the display context code into the controller themselves so that it's more logically a continuation callback from the original controller rendering code. 2) Simplify the display context set/get code and put it in the item helper, it's just a couple of lines of code now. 3) Add more descriptive breadcrumb strings --- .../search/libraries/Search_Display_Context.php | 52 ---------------------- 1 file changed, 52 deletions(-) delete mode 100644 modules/search/libraries/Search_Display_Context.php (limited to 'modules/search/libraries') diff --git a/modules/search/libraries/Search_Display_Context.php b/modules/search/libraries/Search_Display_Context.php deleted file mode 100644 index aed3a125..00000000 --- a/modules/search/libraries/Search_Display_Context.php +++ /dev/null @@ -1,52 +0,0 @@ -get("query_terms")); - - if ($position > 1) { - list ($count, $result_data) = - search::search($this->get("query_terms"), 3, $position - 2); - list ($previous_item, $ignore, $next_item) = $result_data; - } else { - $previous_item = null; - list ($count, $result_data) = search::search($this->get("query_terms"), 1, $position); - list ($next_item) = $result_data; - } - - $q = $this->get("q"); - $search_url = url::abs_site("search?q=" . urlencode($q) . "&show={$item->id}"); - $root = item::root(); - - return array("position" =>$position, - "previous_item" => $previous_item, - "next_item" =>$next_item, - "sibling_count" => $count, - "breadcrumbs" => array( - Breadcrumb::instance($root->title, "/", $root->id), - Breadcrumb::instance($q, $search_url), - Breadcrumb::instance($item->title, $item->url()))); - } -} -- cgit v1.2.3