You are here

function dnd_admin_form in Scald: Media Management made easy 7

Same name and namespace in other branches
  1. 6 dnd/dnd.admin.inc \dnd_admin_form()

Provides the main DnD settings form.

1 string reference to 'dnd_admin_form'
dnd_menu in modules/library/dnd/dnd.module
Implementation of hook_menu().

File

modules/library/dnd/dnd.admin.inc, line 10
Provides the administration related parts of the DnD module.

Code

function dnd_admin_form() {
  $libraries = dnd_get_libraries();
  $form['dnd_callback_url'] = array(
    '#type' => 'select',
    '#title' => t('Library'),
    '#default_value' => dnd_get_library(),
    '#description' => t('The library that will available on node edit forms if they contains fields referencing rich media content, such as Multimedia Editorial Element or Resource reference fields.'),
    '#options' => $libraries,
  );
  $form['dnd_modal_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Modal width'),
    '#size' => 5,
    '#maxlength' => 5,
    '#default_value' => variable_get('dnd_modal_width', 500),
    '#description' => t('The width of the modal window opened from the library in pixels or percentage. Example: 100 for 100 pixels, 0.5 for 50%.'),
  );
  $form['dnd_modal_height'] = array(
    '#type' => 'textfield',
    '#title' => t('Modal height'),
    '#size' => 5,
    '#maxlength' => 5,
    '#default_value' => variable_get('dnd_modal_height', 300),
    '#description' => t('The height of the modal window opened from the library in pixels or percentage. Example: 100 for 100 pixels, 0.5 for 50%.'),
  );
  $form['dnd_modal_admin'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use the admin theme'),
    '#default_value' => variable_get('dnd_modal_admin', FALSE),
    '#description' => t('If enabled, the library will be considered to be administrative.'),
  );
  if (function_exists('qtip_fetch_instances_field')) {
    $form['dnd_qtip_instance'] = qtip_fetch_instances_field(variable_get('dnd_qtip_instance', ''));
  }
  $mee_store_format = module_exists('mee') ? mee_store_format() : '';
  if (!empty($mee_store_format)) {
    if ($mee_store_format === 'embed_div') {
      $form['dnd_uses_caption_default'] = array(
        '#type' => 'checkbox',
        '#title' => t('Enable captions by default'),
        '#default_value' => variable_get('dnd_uses_caption_default', TRUE),
        '#description' => t('If enabled, captions in CKEditor will show up under Atoms by default.'),
      );
    }
    $form['mee_store_format'] = array(
      '#type' => 'select',
      '#options' => array(
        'sas' => t('Scald Atom Shorthand'),
        'embed_div' => t('Div attributes'),
      ),
      '#title' => t('Wysiwyg store format'),
      '#default_value' => $mee_store_format,
      '#description' => t('The store method used in Wysiwyg editors to embed atoms. The default value is "Scald Atom Shorthand", however to use the CKEditor widget plugin, the "Div attributes" value should be used.'),
    );
  }
  return system_settings_form($form);
}