class File

Tests creating managed files views with the wizard.

Plugin annotation


@Plugin(
  id = "file_managed",
  module = "file",
  base_table = "file_managed",
  title = @Translation("Files")
)

Hierarchy

Expanded class hierarchy of File

27 string references to 'File'
DirectoryTest::testFileCheckDirectoryHandling in drupal/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
Test directory handling functions.
DirectoryTest::testFileCreateNewFilepath in drupal/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
This will take a directory and path, and find a valid filepath that is not taken by another file.
DirectoryTest::testFileDestination in drupal/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
This will test the filepath for a destination based on passed flags and whether or not the file exists.
FileFieldDisplayTest::getInfo in drupal/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
FileFieldPathTest::getInfo in drupal/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php

... See full list

File

drupal/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php, line 24
Definition of Drupal\file\Plugin\views\wizard\File.

Namespace

Drupal\file\Plugin\views\wizard
View source
class File extends WizardPluginBase {

  /**
   * Set the created column.
   */
  protected $createdColumn = 'timestamp';

  /**
   * Set default values for the path field options.
   */
  protected $pathField = array(
    'id' => 'uri',
    'table' => 'file_managed',
    'field' => 'uri',
    'exclude' => TRUE,
    'file_download_path' => TRUE,
  );

  /**
   * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
   */
  protected function default_display_options() {
    $display_options = parent::default_display_options();

    // Add permission-based access control.
    $display_options['access']['type'] = 'perm';

    // Remove the default fields, since we are customizing them here.
    unset($display_options['fields']);

    /* Field: File: Name */
    $display_options['fields']['filename']['id'] = 'filename';
    $display_options['fields']['filename']['table'] = 'file_managed';
    $display_options['fields']['filename']['field'] = 'filename';
    $display_options['fields']['filename']['label'] = '';
    $display_options['fields']['filename']['alter']['alter_text'] = 0;
    $display_options['fields']['filename']['alter']['make_link'] = 0;
    $display_options['fields']['filename']['alter']['absolute'] = 0;
    $display_options['fields']['filename']['alter']['trim'] = 0;
    $display_options['fields']['filename']['alter']['word_boundary'] = 0;
    $display_options['fields']['filename']['alter']['ellipsis'] = 0;
    $display_options['fields']['filename']['alter']['strip_tags'] = 0;
    $display_options['fields']['filename']['alter']['html'] = 0;
    $display_options['fields']['filename']['hide_empty'] = 0;
    $display_options['fields']['filename']['empty_zero'] = 0;
    $display_options['fields']['filename']['link_to_file'] = 1;
    return $display_options;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
File::$createdColumn protected property Set the created column. Overrides WizardPluginBase::$createdColumn
File::$pathField protected property Set default values for the path field options. Overrides WizardPluginBase::$pathField
File::default_display_options protected function Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options(). Overrides WizardPluginBase::default_display_options
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$discovery protected property The discovery object.
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$plugin_id protected property The plugin_id.
PluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. 8
PluginBase::$view public property The top object of a view. 1
PluginBase::additionalThemeFunctions public function Provide a list of additional theme functions for the theme information page
PluginBase::buildOptionsForm public function Provide a form to edit options for this plugin. 15
PluginBase::defineOptions protected function Information about options for all kinds of purposes will be held here. @code 'option_name' => array( 14
PluginBase::destroy public function Clears a plugin. 2
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements.
PluginBase::getDefinition public function Implements Drupal\Component\Plugin\PluginInterface::getDefinition(). Overrides PluginInspectionInterface::getDefinition
PluginBase::getPluginId public function Implements Drupal\Component\Plugin\PluginInterface::getPluginId(). Overrides PluginInspectionInterface::getPluginId
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form.
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced.
PluginBase::pluginTitle public function Return the human readable name of the display.
PluginBase::query public function Add anything to the query that we might need to. 13
PluginBase::setOptionDefaults protected function
PluginBase::submitOptionsForm public function Handle any special handling on the validate form. 10
PluginBase::summaryTitle public function Returns the summary of the settings in the display. 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. 1
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
PluginBase::usesOptions public function Returns the usesOptions property. 8
PluginBase::validate public function Validate that the plugin is correct and can be saved. 4
PluginBase::validateOptionsForm public function Validate the options form. 11
WizardPluginBase::$availableSorts protected property The available store criteria.
WizardPluginBase::$base_table protected property The base table connected with the wizard.
WizardPluginBase::$entity_info protected property Contains the information from entity_get_info of the $entity_type.
WizardPluginBase::$entity_type protected property The entity type connected with the wizard.
WizardPluginBase::$filters protected property Views items configuration arrays for filters added by the wizard. 4
WizardPluginBase::$filter_defaults protected property Default values for filters.
WizardPluginBase::$pathFieldsSupplemental protected property Additional fields required to generate the pathField. 1
WizardPluginBase::$sorts protected property Views items configuration arrays for sorts added by the wizard.
WizardPluginBase::$validated_views protected property An array of validated view objects, keyed by a hash.
WizardPluginBase::addDisplays protected function Adds the array of display options to the view, with appropriate overrides.
WizardPluginBase::alter_display_options protected function Alters the full array of display options before they are added to the view.
WizardPluginBase::block_display_options protected function Retrieves the block display options. 2
WizardPluginBase::build_display_options protected function Builds an array of display options for the view.
WizardPluginBase::build_filters protected function Builds the form structure for selecting the view's filters. 1
WizardPluginBase::build_form function Implements Drupal\views\Plugin\views\wizard\WizardInterface::build_form(). Overrides WizardInterface::build_form
WizardPluginBase::build_form_style protected function Adds the style options to the wizard form. 2
WizardPluginBase::build_sorts protected function Builds the form structure for selecting the view's sort order.
WizardPluginBase::create_view function Implements Drupal\views\Plugin\views\wizard\WizardInterface::create_view(). Overrides WizardInterface::create_view
WizardPluginBase::default_display_filters protected function Retrieves all filter information used by the default display.
WizardPluginBase::default_display_filters_user protected function Retrieves filter information based on user input for the default display. 1
WizardPluginBase::default_display_sorts protected function Retrieves all sort information used by the default display.
WizardPluginBase::default_display_sorts_user protected function Retrieves sort information based on user input for the default display.
WizardPluginBase::getAvailableSorts public function Gets the availableSorts property. 1
WizardPluginBase::getCreatedColumn public function Gets the createdColumn property.
WizardPluginBase::getFilters public function Gets the filters property.
WizardPluginBase::getPathField public function Gets the pathField property.
WizardPluginBase::getPathFieldsSupplemental public function Gets the pathFieldsSupplemental property.
WizardPluginBase::getSelected public static function Gets the current value of a #select element, from within a form constructor function.
WizardPluginBase::getSorts public function Gets the sorts property.
WizardPluginBase::instantiate_view protected function Instantiates a view object from form values.
WizardPluginBase::page_display_options protected function Retrieves the page display options. 2
WizardPluginBase::page_feed_display_options protected function Retrieves the feed display options.
WizardPluginBase::retrieve_validated_view protected function Retrieves a validated view for a form submission.
WizardPluginBase::row_style_options protected function Retrieves row style plugin names. 3
WizardPluginBase::setDefaultOptions protected function Sets options for a display and makes them the default options if possible.
WizardPluginBase::set_override_options protected function Sets options for a display, inheriting from the defaults when possible.
WizardPluginBase::set_validated_view protected function Stores a validated view from a form submission.
WizardPluginBase::validateView public function Implements Drupal\views\Plugin\views\wizard\WizardInterface::validate(). Overrides WizardInterface::validateView
WizardPluginBase::__construct public function Constructs a WizardPluginBase object. Overrides PluginBase::__construct