Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module |
— | — | @@ -17,22 +17,33 @@ |
18 | 18 | require_once( drupal_get_path( 'module', 'queue2civicrm' ) . '/queue2civicrm_common.inc' ); |
19 | 19 | |
20 | 20 | /** |
21 | | - * Implementation of hook_form_alter |
| 21 | + * Implementation of hook_menu_alter |
22 | 22 | * |
23 | | - * To expand the configuration form for queue2civicrm_settings to include |
24 | | - * settings for recurring donations. |
| 23 | + * Used to inject recurring menu item to Queue2civicrm configuration |
25 | 24 | */ |
26 | | -function recurring_form_alter( &$form, &$form_state, $form_id ) { |
27 | | - |
28 | | - // make sure we're altering the correct form |
29 | | - if ( $form_id != 'queue2civicrm_settings' ) { |
30 | | - return; |
31 | | - } |
32 | | - |
33 | | - $form[ 'recurring' ] = array( |
| 25 | +function recurring_menu_alter( &$items ) { |
| 26 | + $items['admin/settings/queue2civicrm/recurring'] = array( |
| 27 | + 'title' => 'Recurring payments', |
| 28 | + 'description' => t( 'Configure recurring payments-related settings' ), |
| 29 | + 'access arguments' => array( 'administer queue2civicrm' ), |
| 30 | + 'page callback' => 'drupal_get_form', |
| 31 | + 'page arguments' => array( 'recurring_settings' ), |
| 32 | + 'type' => MENU_LOCAL_TASK |
| 33 | + ); |
| 34 | + return $items; |
| 35 | +} |
| 36 | + |
| 37 | +/** |
| 38 | + * Settings form for recurring payments configuration |
| 39 | + */ |
| 40 | +function recurring_settings() { |
| 41 | + $form = array(); |
| 42 | + |
| 43 | + $form[ 'recurring' ][ 'description' ] = array( |
34 | 44 | '#type' => 'fieldset', |
35 | 45 | '#title' => t( 'Recurring payments' ), |
36 | | - '#collapsible' => TRUE, |
| 46 | + '#description' => t( 'Use the form below to configure settings pertinent to recurring contributions.' ), |
| 47 | + '#collapsible' => FALSE, |
37 | 48 | '#collapsed' => FALSE, |
38 | 49 | ); |
39 | 50 | |
— | — | @@ -65,7 +76,7 @@ |
66 | 77 | ), |
67 | 78 | ); |
68 | 79 | |
69 | | - return $form; |
| 80 | + return system_settings_form( $form ); |
70 | 81 | } |
71 | 82 | |
72 | 83 | /** |
— | — | @@ -633,4 +644,4 @@ |
634 | 645 | $msg_normalized[ 'date' ] = $timestamp; |
635 | 646 | |
636 | 647 | return $msg_normalized; |
637 | | -} |
\ No newline at end of file |
| 648 | +} |