blob: 5bb4e06778ac33543d3f6b37e71989d7e804497a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<?php
// $Id$
/**
* Change content creation form to remove "title" field for FWN
* beats. For that content type we will autocompute the results from
* the issue and beat number provided through CCK.
*/
function fedora_fwnbeat_node_form_validate($form, &$form_state) {
$newtitle = 'FWN ' . $form['field_issue']['#value'] . ' ' . $form['field_beat']['#value'];
$form_set_value($form['title'], $newtitle, &$form_state);
$form_state['rebuild'] = TRUE;
drupal_set_message('Created beat with title '.$newtitle);
return TRUE;
}
function fedora_form_fwnbeat_node_form_alter(&$form, $form_state) {
// In the FWN beat content entry form, remove the title field
$form['title']['#access'] = false;
$form['#validate'][] = 'fedora_fwnbeat_node_form_validate';
}
|