You are here

public static function ImceFileField::widgetSettingsForm in IMCE 8

Same name and namespace in other branches
  1. 8.2 src/ImceFileField.php \Drupal\imce\ImceFileField::widgetSettingsForm()

Returns widget settings form.

1 call to ImceFileField::widgetSettingsForm()
imce_field_widget_third_party_settings_form in ./imce.module
Implements hook_field_widget_third_party_settings_form().

File

src/ImceFileField.php, line 37

Class

ImceFileField
Defines methods for integrating Imce into file field widgets.

Namespace

Drupal\imce

Code

public static function widgetSettingsForm(WidgetInterface $widget) {
  $form = [];
  if (static::isWidgetSupported($widget)) {
    $form['enabled'] = [
      '#type' => 'checkbox',
      '#title' => t('Allow users to select files from <a href=":url">Imce File Manager</a> for this field.', [
        ':url' => Url::fromRoute('imce.admin')
          ->toString(),
      ]),
      '#default_value' => $widget
        ->getThirdPartySetting('imce', 'enabled'),
    ];
  }
  return $form;
}