You are here

function _itweak_upload_admin_settings in iTweak Upload 6.2

Same name and namespace in other branches
  1. 7.3 itweak_upload.admin.inc \_itweak_upload_admin_settings()

Administration settings form worker code.

2 calls to _itweak_upload_admin_settings()
itweak_upload_admin_settings in ./itweak_upload.admin.inc
Administration settings form.
itweak_upload_form_alter in ./itweak_upload.module
Implementation of hook_form_alter().

File

./itweak_upload.admin.inc, line 135
Administration settings for iTweak Upload module

Code

function _itweak_upload_admin_settings(&$form) {
  $link_options = _itweak_upload_setting_link_options();
  $image_options = _itweak_upload_setting_image_options();
  $image_option_default = _itweak_upload_encode_derivative();
  $gallery_type_options = _itweak_upload_gallery_type_options();
  $form['itweak_upload'] = array(
    '#type' => 'fieldset',
    '#title' => t('Attachments display'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('These global settings apply to the display of attachments in all site content by default. Each content type can override these settings.'),
  );

  // Register our own form after_build function to order our fieldset
  //  if (!isset($form['#pre_render'])) $form['#pre_render'] = array();
  $form['#pre_render'][] = '_itweak_upload_admin_settings_alter_weights';
  $form['itweak_upload']['itweak_upload_progress_indicator'] = array(
    '#type' => 'radios',
    '#title' => t('Progress indicator'),
    '#options' => array(
      'bar' => t('Bar with progress meter'),
      'throbber' => t('Throbber'),
    ),
    '#default_value' => variable_get('itweak_upload_progress_indicator', 'bar'),
    '#description' => t('Your server supports upload progress capabilities. The "throbber" display does not indicate progress but takes up less room on the form, you may want to use it if you\'ll only be uploading small files or if experiencing problems with the progress bar.'),
    '#weight' => 5,
    '#access' => itweak_upload_progress_implementation(),
  );
  $form['itweak_upload']['itweak_upload_thumbnail_preset_default'] = array(
    '#type' => 'select',
    '#title' => t('Default preset for image thumbnail'),
    '#default_value' => variable_get('itweak_upload_thumbnail_preset_default', $image_option_default),
    '#options' => $image_options,
    '#description' => t('This preset will be used by default for image thumbnails. This setting can be overridden on each content type configuration page.') . (user_access('administer imagecache') ? ' ' . t('Presets can be edited on <a href="!link">ImageCache</a> page.', array(
      '!link' => '/admin/build/imagecache',
    )) : ''),
  );
  $form['itweak_upload']['itweak_upload_thumbnail_link_default'] = array(
    '#type' => 'select',
    '#title' => t('Default thumbnail link open mode'),
    '#default_value' => variable_get('itweak_upload_thumbnail_link_default', _itweak_upload_setting_link_default()),
    '#options' => $link_options,
    '#description' => t('This mode will be used by default for opening image thumbnails. This setting can be overridden on each content type configuration page.'),
  );
  $form['itweak_upload']['itweak_upload_thumbnail_title_default'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show file name on the opened thumbnail link'),
    '#default_value' => variable_get('itweak_upload_thumbnail_title_default', 1),
    '#description' => t('Check to show by default the file name on the image opened from thumbnails (only if selected link open mode supports it).'),
  );
  $form['itweak_upload']['itweak_upload_gallery_type_default'] = array(
    '#type' => 'select',
    '#title' => t('Default image gallery type'),
    '#default_value' => variable_get('itweak_upload_gallery_type_default', _itweak_upload_gallery_type_default()),
    '#options' => $gallery_type_options,
    '#description' => t('This gallery type will be used by default for image thumbnails. This setting can be overridden on each content type configuration page.'),
  );
  _itweak_upload_insert_form($form['itweak_upload'], 'default');
}