summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2009-03-10 21:42:37 (GMT)
committer Joao Ventura2009-03-10 21:42:37 (GMT)
commit4c80db2ef97b08006fbeff565cdc2fb9be4361f2 (patch)
treec2d76f73a55899b4d149ff6da8367f10a7e23200
parent3d1f2e4500309470e51da1d7678f304dd1b0613c (diff)
Fix #388008: implement CCK's hook_cck_extra_fields to manage the order of the per-content type settings
-rw-r--r--print.module16
1 files changed, 16 insertions, 0 deletions
diff --git a/print.module b/print.module
index 187078b..7892485 100644
--- a/print.module
+++ b/print.module
@@ -350,6 +350,10 @@ function print_form_alter(&$form, $form_state, $form_id) {
'#collapsed' => TRUE,
);
+ if (function_exists('cck_extra_field_weight')) {
+ $form['print']['#weight'] = cck_extra_field_weight($form['type']['#value'], 'print');
+ }
+
$form['print']['label'] = array(
'#type' => 'markup',
'#markup' => '<p><strong>'. t('Printer-friendly version') .'</strong></p>',
@@ -384,6 +388,18 @@ function print_form_alter(&$form, $form_state, $form_id) {
}
/**
+ * Implementation of hook_cck_extra_fields.
+ */
+function print_cck_extra_fields($type_name) {
+ $fields['print'] = array(
+ 'label' => t('Printer, e-mail and PDF versions'),
+ 'description' => t('Print module form.'),
+ 'weight' => 50,
+ );
+ return $fields;
+}
+
+/**
* Auxiliary function to assign the per-node settings to the node object fields
*
* @param $node