Skip to content

Commit

Permalink
Merge pull request #85 from creative-commoners/pulls/1/extend-site-su…
Browse files Browse the repository at this point in the history
…mmary-report

Update version label on site summary report for CWP
  • Loading branch information
robbieaverill committed May 23, 2018
2 parents ab4b0e7 + 7c86995 commit 812d6a0
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 812d6a0

Please sign in to comment.