function taxonomy_image_form_alter in Taxonomy Image 5
Same name and namespace in other branches
- 6 taxonomy_image.module \taxonomy_image_form_alter()
File
- ./
taxonomy_image.module, line 940 - taxonomy_image.module Simple module for providing an association between taxonomy terms and images. Written by Jeremy Andrews <jeremy@kerneltrap.org>, May 2004.
Code
function taxonomy_image_form_alter($form_id, &$form) {
switch ($form_id) {
case 'taxonomy_form_term':
$preview = @taxonomy_image_display($form['tid']['#value']);
$form['#attributes'] = array(
'enctype' => 'multipart/form-data',
);
$form['taxonomy_image'] = array(
'#type' => 'fieldset',
'#title' => t('Term Image'),
'#collapsible' => TRUE,
'#collapsed' => empty($preview),
);
if ($preview) {
$form['taxonomy_image']['current_image'] = array(
'#type' => 'fieldset',
'#title' => t('Current Image'),
);
$form['taxonomy_image']['current_image']['image'] = array(
'#value' => $preview,
);
$form['taxonomy_image']['current_image']['current_image_delete'] = array(
'#type' => 'checkbox',
'#title' => t('Delete'),
'#prefix' => '<div class="taxonomy_image_checkboxes">',
'#suffix' => '</div>',
);
}
$form['taxonomy_image']['new_image']['path'] = array(
'#type' => 'file',
'#title' => t('Upload image'),
'#size' => 40,
'#description' => t("The image file you wish to associate this term."),
);
$form['submit']['#weight'] = 10;
$form['delete']['#weight'] = 10;
break;
}
return $form;
}