Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\file\FileViewsData.
|
||||
*/
|
||||
|
||||
namespace Drupal\file;
|
||||
|
||||
use Drupal\views\EntityViewsData;
|
||||
|
|
@ -21,7 +16,7 @@ class FileViewsData extends EntityViewsData {
|
|||
$data = parent::getViewsData();
|
||||
|
||||
// @TODO There is no corresponding information in entity metadata.
|
||||
$data['file_managed']['table']['base']['help'] = t('Files maintained by Drupal and various modules.');
|
||||
$data['file_managed']['table']['base']['help'] = $this->t('Files maintained by Drupal and various modules.');
|
||||
$data['file_managed']['table']['base']['defaults']['field'] = 'filename';
|
||||
$data['file_managed']['table']['wizard_id'] = 'file_managed';
|
||||
|
||||
|
|
@ -32,13 +27,13 @@ class FileViewsData extends EntityViewsData {
|
|||
'numeric' => TRUE,
|
||||
);
|
||||
$data['file_managed']['fid']['relationship'] = array(
|
||||
'title' => t('File usage'),
|
||||
'help' => t('Relate file entities to their usage.'),
|
||||
'title' => $this->t('File usage'),
|
||||
'help' => $this->t('Relate file entities to their usage.'),
|
||||
'id' => 'standard',
|
||||
'base' => 'file_usage',
|
||||
'base field' => 'fid',
|
||||
'field' => 'fid',
|
||||
'label' => t('File usage'),
|
||||
'label' => $this->t('File usage'),
|
||||
);
|
||||
|
||||
$data['file_managed']['uri']['field']['default_formatter'] = 'file_uri';
|
||||
|
|
@ -46,8 +41,8 @@ class FileViewsData extends EntityViewsData {
|
|||
$data['file_managed']['filemime']['field']['default_formatter'] = 'file_filemime';
|
||||
|
||||
$data['file_managed']['extension'] = array(
|
||||
'title' => t('Extension'),
|
||||
'help' => t('The extension of the file.'),
|
||||
'title' => $this->t('Extension'),
|
||||
'help' => $this->t('The extension of the file.'),
|
||||
'real field' => 'filename',
|
||||
'field' => array(
|
||||
'entity_type' => 'file',
|
||||
|
|
@ -63,14 +58,14 @@ class FileViewsData extends EntityViewsData {
|
|||
$data['file_managed']['status']['field']['default_formatter_settings'] = [
|
||||
'format' => 'custom',
|
||||
'format_custom_false' => $this->t('Temporary'),
|
||||
'format_custom_true' => t('Permanent'),
|
||||
'format_custom_true' => $this->t('Permanent'),
|
||||
];
|
||||
$data['file_managed']['status']['filter']['id'] = 'file_status';
|
||||
|
||||
$data['file_managed']['uid']['relationship']['title'] = t('User who uploaded');
|
||||
$data['file_managed']['uid']['relationship']['label'] = t('User who uploaded');
|
||||
$data['file_managed']['uid']['relationship']['title'] = $this->t('User who uploaded');
|
||||
$data['file_managed']['uid']['relationship']['label'] = $this->t('User who uploaded');
|
||||
|
||||
$data['file_usage']['table']['group'] = t('File Usage');
|
||||
$data['file_usage']['table']['group'] = $this->t('File Usage');
|
||||
|
||||
// Provide field-type-things to several base tables; on the core files table
|
||||
// ("file_managed") so that we can create relationships from files to
|
||||
|
|
@ -119,15 +114,15 @@ class FileViewsData extends EntityViewsData {
|
|||
|
||||
// Describes relationships between files and nodes.
|
||||
$data['file_usage']['file_to_node'] = array(
|
||||
'title' => t('Content'),
|
||||
'help' => t('Content that is associated with this file, usually because this file is in a field on the content.'),
|
||||
'title' => $this->t('Content'),
|
||||
'help' => $this->t('Content that is associated with this file, usually because this file is in a field on the content.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'file_managed' base table is present.
|
||||
'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'id',
|
||||
'relationship' => array(
|
||||
'title' => t('Content'),
|
||||
'label' => t('Content'),
|
||||
'title' => $this->t('Content'),
|
||||
'label' => $this->t('Content'),
|
||||
'base' => 'node_field_data',
|
||||
'base field' => 'nid',
|
||||
'relationship field' => 'id',
|
||||
|
|
@ -135,15 +130,15 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['node_to_file'] = array(
|
||||
'title' => t('File'),
|
||||
'help' => t('A file that is associated with this node, usually because it is in a field on the node.'),
|
||||
'title' => $this->t('File'),
|
||||
'help' => $this->t('A file that is associated with this node, usually because it is in a field on the node.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'node' base table is present.
|
||||
'skip base' => array('file_managed', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'fid',
|
||||
'relationship' => array(
|
||||
'title' => t('File'),
|
||||
'label' => t('File'),
|
||||
'title' => $this->t('File'),
|
||||
'label' => $this->t('File'),
|
||||
'base' => 'file_managed',
|
||||
'base field' => 'fid',
|
||||
'relationship field' => 'fid',
|
||||
|
|
@ -152,15 +147,15 @@ class FileViewsData extends EntityViewsData {
|
|||
|
||||
// Describes relationships between files and users.
|
||||
$data['file_usage']['file_to_user'] = array(
|
||||
'title' => t('User'),
|
||||
'help' => t('A user that is associated with this file, usually because this file is in a field on the user.'),
|
||||
'title' => $this->t('User'),
|
||||
'help' => $this->t('A user that is associated with this file, usually because this file is in a field on the user.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'file_managed' base table is present.
|
||||
'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'id',
|
||||
'relationship' => array(
|
||||
'title' => t('User'),
|
||||
'label' => t('User'),
|
||||
'title' => $this->t('User'),
|
||||
'label' => $this->t('User'),
|
||||
'base' => 'users',
|
||||
'base field' => 'uid',
|
||||
'relationship field' => 'id',
|
||||
|
|
@ -168,15 +163,15 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['user_to_file'] = array(
|
||||
'title' => t('File'),
|
||||
'help' => t('A file that is associated with this user, usually because it is in a field on the user.'),
|
||||
'title' => $this->t('File'),
|
||||
'help' => $this->t('A file that is associated with this user, usually because it is in a field on the user.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'users' base table is present.
|
||||
'skip base' => array('file_managed', 'node_field_data', 'node_field_revision', 'comment_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'fid',
|
||||
'relationship' => array(
|
||||
'title' => t('File'),
|
||||
'label' => t('File'),
|
||||
'title' => $this->t('File'),
|
||||
'label' => $this->t('File'),
|
||||
'base' => 'file_managed',
|
||||
'base field' => 'fid',
|
||||
'relationship field' => 'fid',
|
||||
|
|
@ -185,15 +180,15 @@ class FileViewsData extends EntityViewsData {
|
|||
|
||||
// Describes relationships between files and comments.
|
||||
$data['file_usage']['file_to_comment'] = array(
|
||||
'title' => t('Comment'),
|
||||
'help' => t('A comment that is associated with this file, usually because this file is in a field on the comment.'),
|
||||
'title' => $this->t('Comment'),
|
||||
'help' => $this->t('A comment that is associated with this file, usually because this file is in a field on the comment.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'file_managed' base table is present.
|
||||
'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'id',
|
||||
'relationship' => array(
|
||||
'title' => t('Comment'),
|
||||
'label' => t('Comment'),
|
||||
'title' => $this->t('Comment'),
|
||||
'label' => $this->t('Comment'),
|
||||
'base' => 'comment_field_data',
|
||||
'base field' => 'cid',
|
||||
'relationship field' => 'id',
|
||||
|
|
@ -201,15 +196,15 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['comment_to_file'] = array(
|
||||
'title' => t('File'),
|
||||
'help' => t('A file that is associated with this comment, usually because it is in a field on the comment.'),
|
||||
'title' => $this->t('File'),
|
||||
'help' => $this->t('A file that is associated with this comment, usually because it is in a field on the comment.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'comment' base table is present.
|
||||
'skip base' => array('file_managed', 'node_field_data', 'node_field_revision', 'users_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'fid',
|
||||
'relationship' => array(
|
||||
'title' => t('File'),
|
||||
'label' => t('File'),
|
||||
'title' => $this->t('File'),
|
||||
'label' => $this->t('File'),
|
||||
'base' => 'file_managed',
|
||||
'base field' => 'fid',
|
||||
'relationship field' => 'fid',
|
||||
|
|
@ -218,15 +213,15 @@ class FileViewsData extends EntityViewsData {
|
|||
|
||||
// Describes relationships between files and taxonomy_terms.
|
||||
$data['file_usage']['file_to_taxonomy_term'] = array(
|
||||
'title' => t('Taxonomy Term'),
|
||||
'help' => t('A taxonomy term that is associated with this file, usually because this file is in a field on the taxonomy term.'),
|
||||
'title' => $this->t('Taxonomy Term'),
|
||||
'help' => $this->t('A taxonomy term that is associated with this file, usually because this file is in a field on the taxonomy term.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'file_managed' base table is present.
|
||||
'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'),
|
||||
'real field' => 'id',
|
||||
'relationship' => array(
|
||||
'title' => t('Taxonomy Term'),
|
||||
'label' => t('Taxonomy Term'),
|
||||
'title' => $this->t('Taxonomy Term'),
|
||||
'label' => $this->t('Taxonomy Term'),
|
||||
'base' => 'taxonomy_term_data',
|
||||
'base field' => 'tid',
|
||||
'relationship field' => 'id',
|
||||
|
|
@ -234,15 +229,15 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['taxonomy_term_to_file'] = array(
|
||||
'title' => t('File'),
|
||||
'help' => t('A file that is associated with this taxonomy term, usually because it is in a field on the taxonomy term.'),
|
||||
'title' => $this->t('File'),
|
||||
'help' => $this->t('A file that is associated with this taxonomy term, usually because it is in a field on the taxonomy term.'),
|
||||
// Only provide this field/relationship/etc.,
|
||||
// when the 'taxonomy_term_data' base table is present.
|
||||
'skip base' => array('file_managed', 'node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data'),
|
||||
'real field' => 'fid',
|
||||
'relationship' => array(
|
||||
'title' => t('File'),
|
||||
'label' => t('File'),
|
||||
'title' => $this->t('File'),
|
||||
'label' => $this->t('File'),
|
||||
'base' => 'file_managed',
|
||||
'base field' => 'fid',
|
||||
'relationship field' => 'fid',
|
||||
|
|
@ -253,8 +248,8 @@ class FileViewsData extends EntityViewsData {
|
|||
// we've declared joins to, because there is no 'skip base' property on these
|
||||
// fields.
|
||||
$data['file_usage']['module'] = array(
|
||||
'title' => t('Module'),
|
||||
'help' => t('The module managing this file relationship.'),
|
||||
'title' => $this->t('Module'),
|
||||
'help' => $this->t('The module managing this file relationship.'),
|
||||
'field' => array(
|
||||
'id' => 'standard',
|
||||
),
|
||||
|
|
@ -269,8 +264,8 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['type'] = array(
|
||||
'title' => t('Entity type'),
|
||||
'help' => t('The type of entity that is related to the file.'),
|
||||
'title' => $this->t('Entity type'),
|
||||
'help' => $this->t('The type of entity that is related to the file.'),
|
||||
'field' => array(
|
||||
'id' => 'standard',
|
||||
),
|
||||
|
|
@ -285,8 +280,8 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['id'] = array(
|
||||
'title' => t('Entity ID'),
|
||||
'help' => t('The ID of the entity that is related to the file.'),
|
||||
'title' => $this->t('Entity ID'),
|
||||
'help' => $this->t('The ID of the entity that is related to the file.'),
|
||||
'field' => array(
|
||||
'id' => 'numeric',
|
||||
),
|
||||
|
|
@ -301,8 +296,8 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['count'] = array(
|
||||
'title' => t('Use count'),
|
||||
'help' => t('The number of times the file is used by this entity.'),
|
||||
'title' => $this->t('Use count'),
|
||||
'help' => $this->t('The number of times the file is used by this entity.'),
|
||||
'field' => array(
|
||||
'id' => 'numeric',
|
||||
),
|
||||
|
|
@ -314,8 +309,8 @@ class FileViewsData extends EntityViewsData {
|
|||
),
|
||||
);
|
||||
$data['file_usage']['entity_label'] = array(
|
||||
'title' => t('Entity label'),
|
||||
'help' => t('The label of the entity that is related to the file.'),
|
||||
'title' => $this->t('Entity label'),
|
||||
'help' => $this->t('The label of the entity that is related to the file.'),
|
||||
'real field' => 'id',
|
||||
'field' => array(
|
||||
'id' => 'entity_label',
|
||||
|
|
|
|||
Reference in a new issue