You are here

function imageinfo_cache_admin_form in Imageinfo Cache 6

Same name and namespace in other branches
  1. 6.2 imageinfo_cache.admin.inc \imageinfo_cache_admin_form()

Form builder; Displays DB Tuners configuration page.

1 string reference to 'imageinfo_cache_admin_form'
imageinfo_cache_admin_page in ./imageinfo_cache.admin.inc
Page generation fucntion for admin/settings/imageinfo-cache

File

./imageinfo_cache.admin.inc, line 20
Configuration page for imageinfo cache module.

Code

function imageinfo_cache_admin_form($form_state) {
  $form = array();

  //   $form['imageinfo_cache_theme_imagecache'] = array(
  //     '#type'           => 'checkbox',
  //     '#title'          => t('Use caching for theme_imagecache'),
  //     '#default_value'  => variable_get('imageinfo_cache_theme_imagecache', IMAGEINFO_CACHE_THEME_IMAGECACHE),
  //   );
  //   $form['imageinfo_cache_theme_imagefield_image'] = array(
  //     '#type'           => 'checkbox',
  //     '#title'          => t('Use caching for theme_imagefield_image'),
  //     '#default_value'  => variable_get('imageinfo_cache_theme_imagefield_image', IMAGEINFO_CACHE_THEME_IMAGEFIELD_IMAGE),
  //   );
  $form['imageinfo_cache_imagecache_pregenerate'] = array(
    '#type' => 'radios',
    '#title' => t('Use imagecache pre-generation'),
    '#default_value' => variable_get('imageinfo_cache_imagecache_pregenerate', IMAGEINFO_CACHE_IMAGECACHE_PREGENERATE),
    '#options' => array(
      0 => t('None'),
      2 => t('Per CCK Field'),
      1 => t('All'),
    ),
    '#description' => t('What presets are pre-generated can be selected on the CCK filefield widget settings on the admin/content/node-type/%/fields/% page.'),
  );
  $form['imageinfo_cache_async'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use asynchronous image operations'),
    '#default_value' => variable_get('imageinfo_cache_async', IMAGEINFO_CACHE_ASYNC),
    '#description' => t('Create a second request that generates the extra info. This is generally faster.'),
  );
  $form['imageinfo_cache_socket_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Asynchronous socket timeout (seconds)'),
    '#default_value' => variable_get('imageinfo_cache_socket_timeout', IMAGEINFO_CACHE_SOCKET_TIMEOUT),
    '#description' => t('Keep this as low as possible. If you start to get <em>Asynchronous imageinfo cache primer failed. Using Synchronous mode</em> errors then you might want to increase this number. Must be an INT.'),
  );
  $form['imageinfo_cache_async_max'] = array(
    '#type' => 'textfield',
    '#title' => t('Max number of files to send to each async worker'),
    '#default_value' => variable_get('imageinfo_cache_async_max', IMAGEINFO_CACHE_ASYNC_MAX),
  );
  $form['imageinfo_cache_server_addr'] = array(
    '#type' => 'textfield',
    '#title' => t('IP Address to send all asynchronous requests to'),
    '#default_value' => variable_get('imageinfo_cache_server_addr', FALSE),
    '#description' => t('If left blank it will use the same server as the request.'),
  );
  $form['imageinfo_cache_url_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Shared authentication key'),
    '#default_value' => variable_get('imageinfo_cache_url_key', FALSE),
    '#description' => t('Use at least a 9 digit key. This must match on all async servers.'),
  );
  $period = drupal_map_assoc(array(
    1800,
    2700,
    3600,
    10800,
    21600,
    32400,
    43200,
    64800,
    86400,
    2 * 86400,
    3 * 86400,
    4 * 86400,
    5 * 86400,
    6 * 86400,
    604800,
  ), 'format_interval');
  $form['imageinfo_cache_lifetime'] = array(
    '#type' => 'select',
    '#title' => t('Theme cache lifetime'),
    '#default_value' => variable_get('imageinfo_cache_lifetime', IMAGEINFO_CACHE_LIFETIME),
    '#options' => $period,
  );
  return system_settings_form($form);
}