summaryrefslogtreecommitdiffstats
path: root/fedora.module
diff options
context:
space:
mode:
Diffstat (limited to 'fedora.module')
-rw-r--r--fedora.module19
1 files changed, 19 insertions, 0 deletions
diff --git a/fedora.module b/fedora.module
new file mode 100644
index 0000000..e4894e7
--- /dev/null
+++ b/fedora.module
@@ -0,0 +1,19 @@
+<?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) {
+ $form['title']['#value'] = 'FWN ' . $form['field_issue']['#value'] . ' ' .
+ $form['field_beat']['#value'];
+}
+
+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';
+}