You are here

function LinkitPluginFile::buildSettingsForm in Linkit 7.2

Generate a settings form for this handler. Uses the standard Drupal FAPI. The element will be attached to the "data" key.

Return value

An array containing any custom form elements to be displayed in the profile editing form.

Overrides LinkitPluginEntity::buildSettingsForm

File

plugins/linkit_plugins/linkit-plugin-file.class.php, line 102
Define Linkit file plugin class.

Class

LinkitPluginFile
@file Define Linkit file plugin class.

Code

function buildSettingsForm() {
  $form = parent::buildSettingsForm();
  $form['entity:file']['show_scheme'] = array(
    '#title' => t('Show file scheme'),
    '#type' => 'checkbox',
    '#default_value' => isset($this->conf['show_scheme']) ? $this->conf['show_scheme'] : array(),
  );
  $form['entity:file']['group_by_scheme'] = array(
    '#title' => t('Group files by scheme'),
    '#type' => 'checkbox',
    '#default_value' => isset($this->conf['group_by_scheme']) ? $this->conf['group_by_scheme'] : array(),
  );
  $image_extra_info_options = array(
    'thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array(
      '!linkit_thumb_link' => l('linkit_thumb', 'admin/config/media/image-styles/edit/linkit_thumb'),
    )),
    'dimensions' => t('Show pixel dimensions'),
  );
  $form['entity:file']['image_extra_info'] = array(
    '#title' => t('Images'),
    '#type' => 'checkboxes',
    '#options' => $image_extra_info_options,
    '#default_value' => isset($this->conf['image_extra_info']) ? $this->conf['image_extra_info'] : array(
      'thumbnail',
      'dimensions',
    ),
  );
  return $form;
}