You are here

public static function FileMiconFormatter::defaultSettings in Micon 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Field/FieldFormatter/FileMiconFormatter.php \Drupal\micon\Plugin\Field\FieldFormatter\FileMiconFormatter::defaultSettings()

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

File

src/Plugin/Field/FieldFormatter/FileMiconFormatter.php, line 27

Class

FileMiconFormatter
Plugin implementation of the 'file_micon' formatter.

Namespace

Drupal\micon\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
  $settings = [
    'title' => 'View',
    'icon' => 'fa-file',
    'position' => 'before',
    'target' => '',
    'text_only' => '',
  ];
  foreach (self::mimeGroups() as $id => $data) {
    $key = 'icon_' . $id;
    $settings[$key] = $data['icon'];
  }
  return $settings + parent::defaultSettings();
}