function flickr_block_form_node_form_alter in Flickr 7
Implements hook_form_BASE_FORM_ID_alter().
Alter the node forms.
File
- block/
flickr_block.module, line 1521 - The Flickr block module
Code
function flickr_block_form_node_form_alter(&$form, &$form_state, $form_id) {
if (isset($form['field_flickr_tags']) || isset($form['field_flickr_date']) || isset($form['field_flickr_geo'])) {
// Move the Flickr fields in a fieldset on the node edit form.
// Only works for the default created Flickr fields during install.
// To make them work on other fields copy the code for an existing field and
// substitute the field's machine name.
$form['flickr'] = array(
'#type' => 'fieldset',
'#title' => t('Flickr'),
'#description' => t('If there is a Flickr block active that shows images related to the node dynamically, give some filter criteria below.'),
'#weight' => 5,
'#collapsed' => TRUE,
'#collapsible' => TRUE,
);
if (isset($form['field_flickr_tags'])) {
$form['flickr']['field_flickr_tags'] = $form['field_flickr_tags'];
unset($form['field_flickr_tags']);
}
if (isset($form['field_flickr_date'])) {
$form['flickr']['field_flickr_date'] = $form['field_flickr_date'];
unset($form['field_flickr_date']);
}
if (isset($form['field_flickr_geo'])) {
$form['flickr']['field_flickr_geo'] = $form['field_flickr_geo'];
unset($form['field_flickr_geo']);
}
}
}