Add a hook to updateSettingsFields so that devs can show/hide when desired.

This commit is contained in:
cpenny 2017-11-21 09:18:31 +13:00
parent 0078229057
commit f490ad77cd

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'));