MINOR SideReports now have a canView method

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@90286 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2009-10-28 02:21:01 +00:00
parent f71804e465
commit 22702dc8a4
2 changed files with 6 additions and 2 deletions

View File

@ -672,7 +672,7 @@ JS;
$options[""] = _t('CMSMain.CHOOSEREPORT',"(Choose a report)");
foreach($reports as $report) {
if($report != 'SideReport') $options[$report] = singleton($report)->title();
if($report != 'SideReport' && singleton($report)->canView()) $options[$report] = singleton($report)->title();
}
return new DropdownField("ReportSelector", _t('CMSMain.REPORT', 'Report'),$options);
}
@ -681,7 +681,7 @@ JS;
$forms = array();
foreach($reports as $report) {
if ($report != 'SideReport') {
if ($report != 'SideReport' && singleton($report)->canView()) {
if ($fieldset = singleton($report)->getParameterFields()) {
$formHtml = '';
foreach($fieldset as $field) {

View File

@ -76,6 +76,10 @@ abstract class SideReport extends Object {
function getParameterFields() {
return false;
}
function canView() {
return true;
}
}
/**