Skip to content

Commit

Permalink
NEW Adding an extension for the silverstripe-maintenance "Site Summar…
Browse files Browse the repository at this point in the history
…y" report to display a more appropriate version label
  • Loading branch information
ScopeyNZ committed May 23, 2018
1 parent ab4b0e7 commit 7c86995
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ Only:
CommentingController:
extensions:
- CwpCommentingExtension
---
Name: cwpsitesummaryextensions
Only:
moduleexists: 'silverstripe-maintenance'
---
SiteSummary:
extensions:
- CwpSiteSummaryExtension
23 changes: 23 additions & 0 deletions code/extensions/CwpSiteSummaryExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* 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';
}
}

0 comments on commit 7c86995

Please sign in to comment.