class MetadataInfoEventSubscriber in Filebrowser 8.2
Same name in this branch
- 8.2 src/EventSubscriber/MetadataInfoEventSubscriber.php \Drupal\filebrowser\EventSubscriber\MetadataInfoEventSubscriber
- 8.2 modules/src/EventSubscriber/MetadataInfoEventSubscriber.php \Drupal\filebrowser_extra\EventSubscriber\MetadataInfoEventSubscriber
Same name and namespace in other branches
- 3.x src/EventSubscriber/MetadataInfoEventSubscriber.php \Drupal\filebrowser\EventSubscriber\MetadataInfoEventSubscriber
Hierarchy
- class \Drupal\filebrowser\EventSubscriber\MetadataInfoEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface uses StringTranslationTrait
Expanded class hierarchy of MetadataInfoEventSubscriber
1 string reference to 'MetadataInfoEventSubscriber'
1 service uses MetadataInfoEventSubscriber
File
- src/
EventSubscriber/ MetadataInfoEventSubscriber.php, line 11
Namespace
Drupal\filebrowser\EventSubscriberView source
class MetadataInfoEventSubscriber implements EventSubscriberInterface {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events['filebrowser.metadata_info'][] = [
'setInfo',
0,
];
return $events;
}
public function setInfo($event) {
/** @var MetadataInfo $event */
$info = [
Common::ICON => [
'title' => $this
->t('Icon'),
],
Common::NAME => [
'title' => $this
->t('Name'),
'sortable' => TRUE,
'type' => 'string',
],
Common::CREATED => [
'title' => $this
->t('Created'),
//'sortable' => TRUE,
'type' => 'integer',
],
Common::SIZE => [
'title' => $this
->t('Size'),
// fixme: formatted size not sortable
'sortable' => false,
'type' => 'integer',
],
Common::MIME_TYPE => [
'title' => $this
->t('Mime type'),
'sortable' => TRUE,
'type' => 'string',
],
Common::DESCRIPTION => [
'title' => $this
->t('Description'),
'writable' => TRUE,
//'sortable' => TRUE,
'type' => 'string',
],
];
$event
->setMetaDataInfo($info);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MetadataInfoEventSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
MetadataInfoEventSubscriber:: |
public | function | ||
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. |