Skip to content
This repository
Browse code

ENHANCEMENT: SSF-168 adding breadcrumbs to ReportAdmin

  • Loading branch information...
commit 44e64344f05e76613f62a3eb12d61f6eecaaed20 1 parent b1e286c
Julian Seidenberg authored April 05, 2012

Showing 1 changed file with 17 additions and 4 deletions. Show diff stats Hide diff stats

  1. 21  code/controllers/ReportAdmin.php
21  code/controllers/ReportAdmin.php
@@ -99,10 +99,23 @@ public function Reports() {
99 99
 	public static function has_reports() {
100 100
 		return sizeof(SS_Report::get_reports()) > 0;
101 101
 	}
102  
-	
103  
-	public function updatereport() {
104  
-		// FormResponse::load_form($this->EditForm()->forTemplate());
105  
-		// return FormResponse::respond();
  102
+
  103
+	/**
  104
+	 * Returns the Breadcrumbs for the ReportAdmin
  105
+	 * @return ArrayList
  106
+	 */
  107
+	public function Breadcrumbs() {
  108
+		$items = parent::Breadcrumbs();
  109
+
  110
+		if ($this->reportObject) {
  111
+			//build breadcrumb trail to the current report
  112
+			$items->push(new ArrayData(array(
  113
+					'Title' => $this->reportObject->title(),
  114
+					'Link' => Controller::join_links($this->Link(), '?' . http_build_query(array('q' => $this->request->requestVar('q'))))
  115
+				)));
  116
+		}
  117
+
  118
+		return $items;
106 119
 	}
107 120
 
108 121
 	function providePermissions() {

0 notes on commit 44e6434

Please sign in to comment.
Something went wrong with that request. Please try again.