/**
  * {@inheritdoc}
  */
 public static function defaultSettings()
 {
     $settings = parent::defaultSettings();
     $settings['link_to_file'] = TRUE;
     return $settings;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function settingsForm(array $form, FormStateInterface $form_state)
 {
     $form = parent::settingsForm($form, $form_state);
     $form['filemime_image'] = array('#title' => $this->t('Display an icon'), '#description' => $this->t('The icon is representing the file type, instead of the MIME text (such as "image/jpeg")'), '#type' => 'checkbox', '#default_value' => $this->getSetting('filemime_image'));
     return $form;
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public static function isApplicable(FieldDefinitionInterface $field_definition)
 {
     return parent::isApplicable($field_definition) && $field_definition->getName() === 'uri';
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public static function isApplicable(FieldDefinitionInterface $field_definition)
 {
     // Just show this file extension formatter on the filename field.
     return parent::isApplicable($field_definition) && $field_definition->getName() === 'filename';
 }