summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2010-10-02 07:54:51 -0400
committerPaul W. Frields <stickster@gmail.com>2010-10-02 07:54:51 -0400
commita4b4347d86f79ec2c14314b44a366c75df62b982 (patch)
treea97e19abda232bef25be16694c976e70b90e3c64
parent486c4a82805ab778e6e9d63b69ffc6f1819ca2c0 (diff)
downloaddrupal-fedora-hooks-a4b4347d86f79ec2c14314b44a366c75df62b982.zip
drupal-fedora-hooks-a4b4347d86f79ec2c14314b44a366c75df62b982.tar.gz
drupal-fedora-hooks-a4b4347d86f79ec2c14314b44a366c75df62b982.tar.xz
Add some preliminary module code and remove cruft
-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';
+}