mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Apply SilverStripe\Admin namespace
This commit is contained in:
parent
83c7e9955b
commit
a325bfb222
@ -4,6 +4,7 @@ use SilverStripe\ORM\ArrayList;
|
|||||||
use SilverStripe\ORM\SS_List;
|
use SilverStripe\ORM\SS_List;
|
||||||
use SilverStripe\Security\Member;
|
use SilverStripe\Security\Member;
|
||||||
use SilverStripe\Security\PermissionProvider;
|
use SilverStripe\Security\PermissionProvider;
|
||||||
|
use SilverStripe\Admin\LeftAndMain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports section of the CMS.
|
* Reports section of the CMS.
|
||||||
@ -93,6 +94,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
public function Reports()
|
public function Reports()
|
||||||
{
|
{
|
||||||
$output = new ArrayList();
|
$output = new ArrayList();
|
||||||
|
/** @var SS_Report $report */
|
||||||
foreach (SS_Report::get_reports() as $report) {
|
foreach (SS_Report::get_reports() as $report) {
|
||||||
if ($report->canView()) {
|
if ($report->canView()) {
|
||||||
$output->push($report);
|
$output->push($report);
|
||||||
@ -136,6 +138,8 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Breadcrumbs for the ReportAdmin
|
* Returns the Breadcrumbs for the ReportAdmin
|
||||||
|
*
|
||||||
|
* @param bool $unlinked
|
||||||
* @return ArrayList
|
* @return ArrayList
|
||||||
*/
|
*/
|
||||||
public function Breadcrumbs($unlinked = false)
|
public function Breadcrumbs($unlinked = false)
|
||||||
@ -175,10 +179,11 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
|
|
||||||
public function providePermissions()
|
public function providePermissions()
|
||||||
{
|
{
|
||||||
$title = _t("ReportAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
|
|
||||||
return array(
|
return array(
|
||||||
"CMS_ACCESS_ReportAdmin" => array(
|
"CMS_ACCESS_ReportAdmin" => array(
|
||||||
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
|
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array(
|
||||||
|
'title' => static::menu_title()
|
||||||
|
)),
|
||||||
'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')
|
'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -199,6 +204,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
new GridFieldFooter()
|
new GridFieldFooter()
|
||||||
);
|
);
|
||||||
$gridField = new GridField('Reports', false, $this->Reports(), $gridFieldConfig);
|
$gridField = new GridField('Reports', false, $this->Reports(), $gridFieldConfig);
|
||||||
|
/** @var GridFieldDataColumns $columns */
|
||||||
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
|
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
|
||||||
$columns->setDisplayFields(array(
|
$columns->setDisplayFields(array(
|
||||||
'title' => _t('ReportAdmin.ReportTitle', 'Title'),
|
'title' => _t('ReportAdmin.ReportTitle', 'Title'),
|
||||||
|
Loading…
Reference in New Issue
Block a user