From 44e64344f05e76613f62a3eb12d61f6eecaaed20 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Thu, 5 Apr 2012 13:19:17 +1200 Subject: [PATCH] ENHANCEMENT: SSF-168 adding breadcrumbs to ReportAdmin --- code/controllers/ReportAdmin.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/code/controllers/ReportAdmin.php b/code/controllers/ReportAdmin.php index efe51f402c..1e4528966e 100644 --- a/code/controllers/ReportAdmin.php +++ b/code/controllers/ReportAdmin.php @@ -99,10 +99,23 @@ public function Reports() { public static function has_reports() { return sizeof(SS_Report::get_reports()) > 0; } - - public function updatereport() { - // FormResponse::load_form($this->EditForm()->forTemplate()); - // return FormResponse::respond(); + + /** + * Returns the Breadcrumbs for the ReportAdmin + * @return ArrayList + */ + public function Breadcrumbs() { + $items = parent::Breadcrumbs(); + + if ($this->reportObject) { + //build breadcrumb trail to the current report + $items->push(new ArrayData(array( + 'Title' => $this->reportObject->title(), + 'Link' => Controller::join_links($this->Link(), '?' . http_build_query(array('q' => $this->request->requestVar('q')))) + ))); + } + + return $items; } function providePermissions() {