mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00: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)");
|
$options[""] = _t('CMSMain.CHOOSEREPORT',"(Choose a report)");
|
||||||
foreach($reports as $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);
|
return new DropdownField("ReportSelector", _t('CMSMain.REPORT', 'Report'),$options);
|
||||||
}
|
}
|
||||||
@ -681,7 +681,7 @@ JS;
|
|||||||
|
|
||||||
$forms = array();
|
$forms = array();
|
||||||
foreach($reports as $report) {
|
foreach($reports as $report) {
|
||||||
if ($report != 'SideReport') {
|
if ($report != 'SideReport' && singleton($report)->canView()) {
|
||||||
if ($fieldset = singleton($report)->getParameterFields()) {
|
if ($fieldset = singleton($report)->getParameterFields()) {
|
||||||
$formHtml = '';
|
$formHtml = '';
|
||||||
foreach($fieldset as $field) {
|
foreach($fieldset as $field) {
|
||||||
|
@ -76,6 +76,10 @@ abstract class SideReport extends Object {
|
|||||||
function getParameterFields() {
|
function getParameterFields() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function canView() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user