class SocialSwiftmailTextFormat in Open Social 8.9
Same name and namespace in other branches
- 8.7 modules/social_features/social_swiftmail/src/Element/SocialSwiftmailTextFormat.php \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
- 8.8 modules/social_features/social_swiftmail/src/Element/SocialSwiftmailTextFormat.php \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
- 10.3.x modules/social_features/social_swiftmail/src/Element/SocialSwiftmailTextFormat.php \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
- 10.0.x modules/social_features/social_swiftmail/src/Element/SocialSwiftmailTextFormat.php \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
- 10.1.x modules/social_features/social_swiftmail/src/Element/SocialSwiftmailTextFormat.php \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
- 10.2.x modules/social_features/social_swiftmail/src/Element/SocialSwiftmailTextFormat.php \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
Class SocialSwiftmailTextFormat.
@package Drupal\social_swiftmail\Element
Hierarchy
- class \Drupal\social_swiftmail\Element\SocialSwiftmailTextFormat
Expanded class hierarchy of SocialSwiftmailTextFormat
1 file declares its use of SocialSwiftmailTextFormat
- social_swiftmail.module in modules/
social_features/ social_swiftmail/ social_swiftmail.module - Module file for Social Swiftmailer.
File
- modules/
social_features/ social_swiftmail/ src/ Element/ SocialSwiftmailTextFormat.php, line 12
Namespace
Drupal\social_swiftmail\ElementView source
class SocialSwiftmailTextFormat {
/**
* Processes a text format form element.
*
* Delete the "Mail HTML" text format from each element of forms which doesn't
* part of Views bulk process.
*
* @param array $element
* The form element to process.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param array $complete_form
* The complete form structure.
*
* @return array
* The processed element.
*
* @see social_swiftmail_element_info_alter()
*/
public static function process(array &$element, FormStateInterface $form_state, array &$complete_form) {
if (!$form_state
->has('views_bulk_operations')) {
$format =& $element['format'];
if (isset($format['format']['#options']['mail_html'])) {
unset($format['format']['#options']['mail_html']);
if (count($format['format']['#options']) === 1) {
$format['format']['#access'] = $format['help']['#access'] = FALSE;
}
}
}
return $element;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SocialSwiftmailTextFormat:: |
public static | function | Processes a text format form element. |