Merge pull request #71 from silverstripe-terraformers/feature/update-settings-fields-hook

v4: Add hook to updateSettingsFields so that devs can show/hide when desired
This commit is contained in:
Robbie Averill 2017-11-21 09:40:42 +13:00 committed by GitHub
commit d74066c0de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,6 +328,10 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
*/ */
public function updateSettingsFields(FieldList $fields) public function updateSettingsFields(FieldList $fields)
{ {
if ($this->owner->hasMethod('displayContentReview') && !$this->owner->displayContentReview()) {
return;
}
$module = ModuleLoader::getModule('silverstripe/contentreview'); $module = ModuleLoader::getModule('silverstripe/contentreview');
Requirements::javascript($module->getRelativeResourcePath('client/dist/js/contentreview.js')); Requirements::javascript($module->getRelativeResourcePath('client/dist/js/contentreview.js'));