function emthumb_emfield_widget_settings_extra in Embedded Media Field 6
Same name and namespace in other branches
- 5 contrib/emthumb/emthumb.module \emthumb_emfield_widget_settings_extra()
- 6.3 contrib/emthumb/emthumb.module \emthumb_emfield_widget_settings_extra()
- 6.2 contrib/emthumb/emthumb.module \emthumb_emfield_widget_settings_extra()
This provides extra widget settings to emfields. A checkbox to allow custom thumbnails, max resolution, image path, allow custom alt tags, allow custom title tags.
File
- contrib/
emthumb/ emthumb.module, line 351 - Allows for custom thumbnail overrides to Embedded Media Field.
Code
function emthumb_emfield_widget_settings_extra($op, $widget) {
switch ($op) {
case 'form':
$form = array();
$form['emthumb'] = array(
'#type' => 'fieldset',
'#title' => t('Embedded Custom Thumbnails'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['emthumb']['emthumb_store_local_thumbnail'] = array(
'#type' => 'checkbox',
'#title' => t('Store remote thumbnails for this field'),
'#description' => t('If checked, then remote thumbnails will be stored locally for this field..'),
'#default_value' => isset($widget['emthumb_store_local_thumbnail']) ? $widget['emthumb_store_local_thumbnail'] : TRUE,
);
$form['emthumb']['emthumb'] = array(
'#type' => 'checkbox',
'#title' => t('Allow custom thumbnails for this field'),
'#description' => t('If checked, then editors may specify a custom thumbnail to be used, overriding any automatic thumbnails otherwise created.'),
'#default_value' => isset($widget['emthumb']) ? $widget['emthumb'] : FALSE,
);
$form['emthumb']['emthumb_label'] = array(
'#type' => 'textfield',
'#title' => t('Custom thumbnail label'),
'#default_value' => isset($widget['emthumb_label']) ? $widget['emthumb_label'] : t('@field custom thumbnail', array(
'@field' => $widget['label'],
)),
'#description' => t('This label will be displayed when uploading a custom thumbnail.'),
);
$form['emthumb']['emthumb_description'] = array(
'#type' => 'textfield',
'#title' => t('Custom thumbnail description'),
'#default_value' => isset($widget['emthumb_description']) ? $widget['emthumb_description'] : t('If you upload a custom thumbnail, then this will be displayed when the @field thumbnail is called for, overriding any automatic thumbnails by custom providers.', array(
'@field' => $widget['label'],
)),
'#description' => t('This description will be displayed when uploading a custom thumbnail.'),
'#maxlength' => 512,
);
$form['emthumb']['emthumb_max_resolution'] = array(
'#type' => 'textfield',
'#title' => t('Maximum resolution for Images'),
'#default_value' => isset($widget['emthumb_max_resolution']) ? $widget['emthumb_max_resolution'] : 0,
'#size' => 15,
'#maxlength' => 10,
'#description' => t('The maximum allowed custom thumbnail size expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 for no restriction.'),
);
$form['emthumb']['emimport_image_path'] = array(
'#type' => 'textfield',
'#title' => t('Image path'),
'#default_value' => isset($widget['emimport_image_path']) ? $widget['emimport_image_path'] : '',
'#description' => t('Optional subdirectory within the "%dir" directory where images will be stored. Do not include trailing slash.', array(
'%dir' => variable_get('file_directory_path', 'files'),
)),
'#after_build' => array(
'emthumb_form_check_directory',
),
);
$form['emthumb']['emthumb_custom_alt'] = array(
'#type' => 'checkbox',
'#title' => t('Enable custom alternate text'),
'#default_value' => isset($widget['emthumb_custom_alt']) ? $widget['emthumb_custom_alt'] : 0,
'#description' => t('Enable custom alternate text for custom thumbnails. Filename will be used if not checked.'),
);
$form['emthumb']['emthumb_custom_title'] = array(
'#type' => 'checkbox',
'#title' => t('Enable custom title text'),
'#default_value' => isset($widget['emthumb_custom_title']) ? $widget['emthumb_custom_title'] : 0,
'#description' => t('Enable custom title text for custom thumbnails. Filename will be used if not checked.'),
);
$form['emthumb']['emthumb_start_collapsed'] = array(
'#type' => 'checkbox',
'#title' => t('Default display is collapsed'),
'#default_value' => isset($widget['emthumb_start_collapsed']) ? $widget['emthumb_start_collapsed'] : 0,
'#description' => t('Enable default display to be collapsed.'),
);
return $form;
case 'save':
return array(
'emthumb',
'emthumb_label',
'emthumb_description',
'emthumb_max_resolution',
'emimport_image_path',
'emthumb_custom_alt',
'emthumb_custom_title',
'emthumb_store_local_thumbnail',
'emthumb_start_collapsed',
);
}
}