class BlazyAdminFormatter in Blazy 7
Same name and namespace in other branches
- 8.2 src/Form/BlazyAdminFormatter.php \Drupal\blazy\Form\BlazyAdminFormatter
- 8 src/Form/BlazyAdminFormatter.php \Drupal\blazy\Form\BlazyAdminFormatter
Provides admin form specific to Blazy admin formatter.
Hierarchy
- class \Drupal\blazy\Form\BlazyAdminBase implements BlazyAdminInterface
- class \Drupal\blazy\Form\BlazyAdminFormatterBase
- class \Drupal\blazy\Form\BlazyAdminFormatter
- class \Drupal\blazy\Form\BlazyAdminFormatterBase
Expanded class hierarchy of BlazyAdminFormatter
2 files declare their use of BlazyAdminFormatter
- BlazyFormatterBlazy.php in src/
Plugin/ Field/ FieldFormatter/ BlazyFormatterBlazy.php - BlazyTextFormatter.php in src/
Plugin/ Field/ FieldFormatter/ BlazyTextFormatter.php
File
- src/
Form/ BlazyAdminFormatter.php, line 8
Namespace
Drupal\blazy\FormView source
class BlazyAdminFormatter extends BlazyAdminFormatterBase {
/**
* Defines re-usable form elements.
*/
public function buildSettingsForm(array &$form, $definition = []) {
$definition['namespace'] = 'blazy';
$definition['responsive_image'] = isset($definition['responsive_image']) ? $definition['responsive_image'] : TRUE;
$forms = isset($definition['forms']) ? $definition['forms'] : [];
$this
->openingForm($form, $definition);
// This allows Blazy to display texts as a grid, without images.
if (!empty($forms['image_style']) && !isset($form['image_style'])) {
$this
->imageStyleForm($form, $definition);
}
if (!empty($forms['media_switch']) && !isset($form['media_switch'])) {
$this
->mediaSwitchForm($form, $definition);
}
if (!empty($forms['grid']) && !isset($form['grid'])) {
$this
->gridForm($form, $definition);
// Blazy doesn't need complex grid with multiple groups.
unset($form['preserve_keys'], $form['visible_items']);
$form['grid']['#description'] = t('The amount of block grid columns for large monitors 64.063em+. <br /><strong>Requires</strong>:<ol><li>Display style.</li><li>A reasonable amount of contents.</li></ol>Leave empty to DIY, or to not build grids.');
}
if (!empty($definition['breakpoints']) && !$this
->manager()
->config('unbreakpoints', FALSE, 'blazy.settings')) {
$this
->breakpointsForm($form, $definition);
}
$this
->closingForm($form, $definition);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlazyAdminBase:: |
protected | property | The blazy manager service. | |
BlazyAdminBase:: |
protected | property | The available view modes. | |
BlazyAdminBase:: |
public | function | Returns simple form elements common for Views field, EB widget, formatters. | |
BlazyAdminBase:: |
public | function | Defines re-usable breakpoints form. | |
BlazyAdminBase:: |
public | function | Defines re-usable breakpoints form. | |
BlazyAdminBase:: |
public | function | Returns shared ending form elements across field formatter and Views. | 1 |
BlazyAdminBase:: |
public | function | Returns re-usable logic, styling and assets across fields and Views. | |
BlazyAdminBase:: |
protected | function | Helper function for getting correct bundle for manage field/display path. | |
BlazyAdminBase:: |
public | function | Returns time in interval for select options. | |
BlazyAdminBase:: |
public | function | Returns available optionsets for select options. | |
BlazyAdminBase:: |
protected | function | Get one of the pre-defined states used in this form. | |
BlazyAdminBase:: |
public | function | Returns available view modes for select options. | |
BlazyAdminBase:: |
public | function | Returns re-usable grid elements across field formatter and Views. | |
BlazyAdminBase:: |
public | function | Returns the blazy manager. | |
BlazyAdminBase:: |
public | function | Returns re-usable media switch form elements. | |
BlazyAdminBase:: |
public | function | Returns shared form elements across field formatter and Views. | 1 |
BlazyAdminBase:: |
protected | function | If the image field doesn't have the Title field enabled, tell the user. | |
BlazyAdminBase:: |
constant | A state that represents the media switch iframe is enabled. | ||
BlazyAdminBase:: |
constant | A state that represents the image rendered switch is enabled. | ||
BlazyAdminBase:: |
constant | A state that represents the custom lightbox caption is enabled. | ||
BlazyAdminBase:: |
constant | A state that represents the media switch lightbox is enabled. | ||
BlazyAdminBase:: |
constant | A state that represents the responsive image style is disabled. | ||
BlazyAdminBase:: |
constant | A state that represents the thumbnail style is enabled. | ||
BlazyAdminBase:: |
public | function | Constructs a BlazyAdmin instance. | |
BlazyAdminFormatter:: |
public | function | Defines re-usable form elements. | |
BlazyAdminFormatterBase:: |
private | function | Returns the expected bundles. | |
BlazyAdminFormatterBase:: |
public | function | Declutters options from less relevant options. | |
BlazyAdminFormatterBase:: |
public | function | Exclude the field formatter settings summary as required. | |
BlazyAdminFormatterBase:: |
public | function | Returns available fields for select options. | |
BlazyAdminFormatterBase:: |
private | function | Helper function to get list of supported field base on field_types. | |
BlazyAdminFormatterBase:: |
public | function | Returns Picture for select options. | |
BlazyAdminFormatterBase:: |
public | function | Return the field formatter settings summary. | |
BlazyAdminFormatterBase:: |
public | function | Returns re-usable image formatter form elements. |