MediaLibraryUiBuilder
class MediaLibraryUiBuilder (View source)
| internal | This service is an internal part of the modal media library dialog and does not provide any extension points. |
Service which builds the media library.
Traits
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected FormBuilderInterface | $formBuilder | The form builder. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected Request | $request | The currently active request object. |
|
| protected ViewExecutableFactory | $viewsExecutableFactory | The views executable factory. |
|
| protected OpenerResolverInterface | $openerResolver | The media library opener resolver. |
Methods
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Constructs a MediaLibraryUiBuilder instance.
Get media library dialog options.
Check access to the media library.
Details
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
__construct(EntityTypeManagerInterface $entity_type_manager, RequestStack $request_stack, ViewExecutableFactory $views_executable_factory, FormBuilderInterface $form_builder, OpenerResolverInterface $opener_resolver = NULL)
Constructs a MediaLibraryUiBuilder instance.
static array
dialogOptions()
Get media library dialog options.
array
buildUi(MediaLibraryState $state = NULL)
Build the media library UI.
protected array
buildLibraryContent(MediaLibraryState $state)
Build the media library content area.
AccessResult
checkAccess(AccountInterface $account, MediaLibraryState $state = NULL)
Check access to the media library.
protected array
buildMediaTypeMenu(MediaLibraryState $state)
Get the media type menu for the media library.
protected array
buildMediaTypeAddForm(MediaLibraryState $state)
Get the add form for the selected media type.
protected array
buildMediaLibraryView(MediaLibraryState $state)
Get the media library view.