-
Notifications
You must be signed in to change notification settings - Fork 26
/
CwpSiteSummaryExtension.php
49 lines (44 loc) · 1.38 KB
/
CwpSiteSummaryExtension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace CWP\CWP\Extensions;
use SilverStripe\Core\Extension;
/**
* Extends the site summary report to list the appropriate versions in the report header
*/
class CwpSiteSummaryExtension extends Extension
{
/**
* Updates the modules used for the version label by:
* - Removing SS Framework
* - Adding CWP
* - Relabelling SS CMS
*
* @param array $modules
*/
public function updateVersionModules(&$modules)
{
unset($modules['silverstripe/framework']);
$modules = ['cwp/cwp' => 'CWP'] + $modules;
$modules['silverstripe/cms'] = 'SilverStripe CMS';
}
/**
* Updates the dropdown filter used to filter supported packages by renaming the labels (replaces the existing
* filter options)
*
* @param GridFieldDropdownFilter $dropdownFilter
*/
public function updateDropdownFilterOptions($dropdownFilter)
{
$dropdownFilter->removeFilterOption('supported');
$dropdownFilter->removeFilterOption('unsupported');
$dropdownFilter->addFilterOption(
'supported',
_t(__CLASS__ . '.FilterSupported', 'CWP recipe modules'),
['Supported' => true]
);
$dropdownFilter->addFilterOption(
'unsupported',
_t(__CLASS__ . '.FilterUnsupported', 'Non CWP modules'),
['Supported' => false]
);
}
}