class Standalone in Entity Browser 8
Same name and namespace in other branches
- 8.2 src/Plugin/EntityBrowser/Display/Standalone.php \Drupal\entity_browser\Plugin\EntityBrowser\Display\Standalone
Presents entity browser as a standalone form.
Plugin annotation
@EntityBrowserDisplay(
id = "standalone",
label = @Translation("Standalone form"),
description = @Translation("Displays the entity browser as a standalone form. Only intended for testing or very specific use cases."),
uses_route = TRUE
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\entity_browser\DisplayBase implements ContainerFactoryPluginInterface, DisplayInterface uses PluginConfigurationFormTrait
- class \Drupal\entity_browser\Plugin\EntityBrowser\Display\Standalone implements DisplayRouterInterface
- class \Drupal\entity_browser\DisplayBase implements ContainerFactoryPluginInterface, DisplayInterface uses PluginConfigurationFormTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of Standalone
File
- src/
Plugin/ EntityBrowser/ Display/ Standalone.php, line 19
Namespace
Drupal\entity_browser\Plugin\EntityBrowser\DisplayView source
class Standalone extends DisplayBase implements DisplayRouterInterface {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['path'] = [
'#type' => 'textfield',
'#title' => $this
->t('Path'),
'#required' => TRUE,
'#description' => $this
->t('The path at which the browser will be accessible. Must begin with a forward slash.'),
'#default_value' => $this->configuration['path'],
];
return $form;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [
'path' => '',
];
}
/**
* {@inheritdoc}
*/
public function displayEntityBrowser(array $element, FormStateInterface $form_state, array &$complete_form, array $persistent_data = []) {
parent::displayEntityBrowser($element, $form_state, $complete_form, $persistent_data);
// @TODO Implement it.
}
/**
* {@inheritdoc}
*/
public function selectionCompleted(array $entities) {
// @TODO Implement it.
}
/**
* {@inheritdoc}
*/
public function path() {
return $this->configuration['path'];
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
$path = $form_state
->getValue('path');
if ($path[0] != '/') {
$form_state
->setError($form['path'], $this
->t('The Path field must begin with a forward slash.'));
}
}
}
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 | |
DisplayBase:: |
protected | property | Selected entities. | |
DisplayBase:: |
protected | property | Event dispatcher service. | |
DisplayBase:: |
protected | property | Plugin label. | |
DisplayBase:: |
protected | property | The selection storage. | |
DisplayBase:: |
protected | property | Instance UUID string. | |
DisplayBase:: |
protected | property | UUID generator interface. | |
DisplayBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
DisplayBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
1 |
DisplayBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
DisplayBase:: |
public | function |
Gets the uuid for this display. Overrides DisplayInterface:: |
|
DisplayBase:: |
public | function |
Returns the display label. Overrides DisplayInterface:: |
|
DisplayBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
DisplayBase:: |
public | function |
Sets the uuid for this display. Overrides DisplayInterface:: |
|
DisplayBase:: |
public | function |
Constructs display plugin. Overrides PluginBase:: |
1 |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginConfigurationFormTrait:: |
public | function | Implements PluginFormInterface::submitConfigurationForm(). | 3 |
Standalone:: |
public | function |
Implements PluginFormInterface::buildConfigurationForm(). Overrides PluginConfigurationFormTrait:: |
|
Standalone:: |
public | function |
Gets default configuration for this plugin. Overrides DisplayBase:: |
|
Standalone:: |
public | function |
Displays entity browser. Overrides DisplayBase:: |
|
Standalone:: |
public | function |
Gets page path. Overrides DisplayRouterInterface:: |
|
Standalone:: |
public | function |
Indicates completed selection. Overrides DisplayBase:: |
|
Standalone:: |
public | function |
Implements PluginFormInterface::validateConfigurationForm(). Overrides PluginConfigurationFormTrait:: |
|
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. |