mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
f71804e465
commit
22702dc8a4
@ -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) {
|
||||
|
@ -76,6 +76,10 @@ abstract class SideReport extends Object {
|
||||
function getParameterFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function canView() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user