class EntityEmbedDialog in Lightning Media 8
Same name and namespace in other branches
- 8.4 src/Form/EntityEmbedDialog.php \Drupal\lightning_media\Form\EntityEmbedDialog
- 8.2 src/Form/EntityEmbedDialog.php \Drupal\lightning_media\Form\EntityEmbedDialog
- 8.3 src/Form/EntityEmbedDialog.php \Drupal\lightning_media\Form\EntityEmbedDialog
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, LinkGeneratorTrait, RedirectDestinationTrait, UrlGeneratorTrait, StringTranslationTrait
- class \Drupal\entity_embed\Form\EntityEmbedDialog
- class \Drupal\lightning_media\Form\EntityEmbedDialog
- class \Drupal\entity_embed\Form\EntityEmbedDialog
Expanded class hierarchy of EntityEmbedDialog
1 file declares its use of EntityEmbedDialog
- RouteSubscriber.php in src/
Routing/ RouteSubscriber.php
File
- src/
Form/ EntityEmbedDialog.php, line 9
Namespace
Drupal\lightning_media\FormView source
class EntityEmbedDialog extends BaseEntityEmbedDialog {
/**
* {@inheritdoc}
*/
public function buildEmbedStep(array $form, FormStateInterface $form_state) {
$entity = $form_state
->get('entity');
$element = $form_state
->get('entity_element');
$input = $form_state
->getUserInput();
// If we're working with an existing embed, $input['editor_object'] will be
// set, in which case we don't want to change anything (see ::buildForm()).
// Otherwise, if the entity being embedded is a media item, see if its type
// plugin has a preference regarding which display plugin to use.
if (empty($input['editor_object']) && $entity instanceof MediaInterface) {
$plugin_definition = $entity
->getSource()
->getPluginDefinition();
if (isset($plugin_definition['entity_embed_display'])) {
$element['data-entity-embed-display'] = $plugin_definition['entity_embed_display'];
$form_state
->set('entity_element', $element);
}
}
$form = parent::buildEmbedStep($form, $form_state);
// If the user can choose the display plugin, allow Lightning Media's
// settings to override that access.
$element =& $form['attributes']['data-entity-embed-display'];
if ($element['#access']) {
$element['#access'] = $this
->config('lightning_media.settings')
->get('entity_embed.choose_display');
}
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
EntityEmbedDialog:: |
protected | property | The entity browser. | |
EntityEmbedDialog:: |
protected | property | The entity browser settings from the entity embed button. | |
EntityEmbedDialog:: |
protected | property | The entity embed display manager. | |
EntityEmbedDialog:: |
protected | property | The entity field manager. | |
EntityEmbedDialog:: |
protected | property | The entity type manager service. | |
EntityEmbedDialog:: |
protected | property | Event dispatcher service. | |
EntityEmbedDialog:: |
protected | property | The form builder. | |
EntityEmbedDialog:: |
protected | property | The module handler service. | |
EntityEmbedDialog:: |
public | function |
Form constructor for the entity embedding step. Overrides EntityEmbedDialog:: |
|
EntityEmbedDialog:: |
public | function |
Form constructor. Overrides FormInterface:: |
|
EntityEmbedDialog:: |
public | function | Form constructor for the entity review step. | |
EntityEmbedDialog:: |
public | function | Form constructor for the entity selection step. | |
EntityEmbedDialog:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
|
EntityEmbedDialog:: |
public static | function | Form element validation handler; Escapes the value an element. | |
EntityEmbedDialog:: |
public | function | Returns the allowed display plugins given an embed button and an entity. | |
EntityEmbedDialog:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
EntityEmbedDialog:: |
protected | function | Load the current entity browser and its settings from the form state. | |
EntityEmbedDialog:: |
protected | function | Loads an entity (in the appropriate translation) given HTML attributes. | |
EntityEmbedDialog:: |
public | function | Registers JS callbacks. | |
EntityEmbedDialog:: |
public | function | Submit and show embed step after submit. | |
EntityEmbedDialog:: |
public | function | Submit and show review step after submit. | |
EntityEmbedDialog:: |
public | function | Submit and show select step after submit. | |
EntityEmbedDialog:: |
public | function | Form submission handler for the entity embedding step. | |
EntityEmbedDialog:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
EntityEmbedDialog:: |
public | function | Form submission handler for the entity selection step. | |
EntityEmbedDialog:: |
public | function | Form submission handler to to another step of the form. | |
EntityEmbedDialog:: |
public | function | Form submission handler to update the plugin configuration form. | |
EntityEmbedDialog:: |
public | function | Form validation handler for the entity embedding step. | |
EntityEmbedDialog:: |
public | function |
Form validation handler. Overrides FormBase:: |
|
EntityEmbedDialog:: |
public | function | Form validation handler for the entity selection step. | |
EntityEmbedDialog:: |
public | function | Constructs a EntityEmbedDialog object. | |
FormBase:: |
protected | property | The config factory. | 1 |
FormBase:: |
protected | property | The request stack. | 1 |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 1 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function |
Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait:: |
|
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
LinkGeneratorTrait:: |
protected | property | The link generator. | 1 |
LinkGeneratorTrait:: |
protected | function | Returns the link generator. | |
LinkGeneratorTrait:: |
protected | function | Renders a link to a route given a route name and its parameters. | |
LinkGeneratorTrait:: |
public | function | Sets the link generator service. | |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UrlGeneratorTrait:: |
protected | property | The url generator. | |
UrlGeneratorTrait:: |
protected | function | Returns the URL generator service. | |
UrlGeneratorTrait:: |
public | function | Sets the URL generator service. | |
UrlGeneratorTrait:: |
protected | function | Generates a URL or path for a specific route based on the given parameters. |