public function UserSignature::isAllowed in Display Suite 8.3
Same name and namespace in other branches
- 8.4 src/Plugin/DsField/User/UserSignature.php \Drupal\ds\Plugin\DsField\User\UserSignature::isAllowed()
- 8.2 src/Plugin/DsField/User/UserSignature.php \Drupal\ds\Plugin\DsField\User\UserSignature::isAllowed()
Returns if the field is allowed on the field UI screen.
Return value
bool TRUE when field allowed, FALSE otherwise.
Overrides DsFieldBase::isAllowed
File
- src/
Plugin/ DsField/ User/ UserSignature.php, line 36
Class
- UserSignature
- Plugin that renders the user signature.
Namespace
Drupal\ds\Plugin\DsField\UserCode
public function isAllowed() {
// Checks if user signatures are enabled.
$user_signatures = \Drupal::config('user.settings')
->get('signatures');
// We use this function to decide if we should show this field.
// When user signatures are disabled we should ignore this.
if (!empty($user_signatures)) {
return TRUE;
}
else {
return FALSE;
}
}