/** * {@inheritdoc} */ public static function defaultSettings() { $settings = parent::defaultSettings(); $settings['link_to_file'] = TRUE; return $settings; }
/** * {@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; }
/** * {@inheritdoc} */ public static function isApplicable(FieldDefinitionInterface $field_definition) { return parent::isApplicable($field_definition) && $field_definition->getName() === 'uri'; }
/** * {@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'; }