function imageinfo_cache_admin_form in Imageinfo Cache 6.2
Same name and namespace in other branches
- 6 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 19 - Configuration page for imageinfo cache module.
Code
function imageinfo_cache_admin_form($form_state) {
$form = array();
$form['imageinfo_cache_imagecache_pregenerate'] = array(
'#type' => 'checkbox',
'#title' => t('Use imagecache pre-generation'),
'#default_value' => variable_get('imageinfo_cache_imagecache_pregenerate', IMAGEINFO_CACHE_IMAGECACHE_PREGENERATE),
'#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_fields'] = array(
'#type' => 'fieldset',
'#title' => t('Imageinfo Cache CCK Settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$links = array();
foreach (content_types() as $node_type => $info) {
foreach ($info['fields'] as $filed_name => $data) {
if ($data['type'] == 'filefield') {
$links[] = l($info['name'] . ' - ' . $data['field_name'], 'admin/content/node-type/' . str_replace('_', '-', $node_type) . '/fields/' . $filed_name);
}
}
}
$form['imageinfo_cache_fields']['list'] = array(
'#type' => 'markup',
'#value' => implode('<br />', $links),
);
$form['imageinfo_cache_httprl_mode'] = array(
'#type' => 'radios',
'#title' => t('HTTP Mode'),
'#default_value' => variable_get('imageinfo_cache_httprl_mode', IMAGEINFO_CACHE_HTTPRL_MODE),
'#description' => t('Blocking mode will wait for an acknowledgement from the server that the http request was recieved. Non Blocking mode will not wait for any acknowledgement that the request was recieved. Non Blocking mode is faster but does not guarantee that the work will be done. Blocking mode is slower and guarantees that the work will be done.'),
'#options' => array(
0 => t('Non Blocking'),
1 => t('Blocking'),
),
);
$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_url_key'] = array(
'#type' => 'textfield',
'#title' => t('Shared authentication key'),
'#default_value' => variable_get('imageinfo_cache_url_key', md5(drupal_get_private_key())),
'#description' => t('Use a 32 character md5 hash. This must match on all servers.'),
);
$form['imageinfo_cache_server_addr'] = array(
'#type' => 'textfield',
'#title' => t('Server/IP Address to send all image generation requests to'),
'#default_value' => variable_get('imageinfo_cache_server_addr', FALSE),
'#description' => t('If left blank it will use the settings found in the <a href="!link">HTTPRL module</a>.', array(
'!link' => url('admin/settings/httprl'),
)),
);
$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);
}