From 47ca3849127f3fede22a44b1eb0f4aa74138a0ba Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 9 Oct 2008 02:45:01 +0000 Subject: [PATCH] ENHANCEMENT Pulled out Report::has_reports() which was hardcoded into LeftAndMain, and put into cms/_config.php which makes more sense git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63955 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- _config.php | 10 ++++++++++ code/LeftAndMain.php | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/_config.php b/_config.php index 8a8e595a..5ebf2214 100644 --- a/_config.php +++ b/_config.php @@ -26,4 +26,14 @@ Director::addRules(50, array( // Built-in modules LeftAndMain::populate_default_menu(); +// If there are reports, add the ReportAdmin tab in CMS +if(ReportAdmin::has_reports()) { + LeftAndMain::add_menu_item( + 'reports', + _t('LeftAndMain.REPORTS', 'Reports', PR_HIGH, 'Menu title'), + 'admin/reports/', + 'ReportAdmin' + ); +} + ?> diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 0a2414cc..4cbd491d 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -977,14 +977,6 @@ JS; "admin/assets/", "AssetAdmin" ); - if(ReportAdmin::has_reports()) { - self::add_menu_item( - "report", - _t('LeftAndMain.REPORTS',"Reports",PR_HIGH,'Menu title'), - "admin/reports/", - "ReportAdmin" - ); - } self::add_menu_item( "security", _t('LeftAndMain.SECURITY',"Security",PR_HIGH,'Menu title'),