? settings.diff.txt Index: listhandler.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/listhandler/listhandler.module,v retrieving revision 1.75 diff -u -3 -r1.75 listhandler.module --- listhandler.module 10 Jul 2007 16:51:10 -0000 1.75 +++ listhandler.module 4 Sep 2007 19:27:22 -0000 @@ -75,8 +75,14 @@ '#options' => array(0 => t('blocked'), 1 => t('active')), '#description' => t('The status of accounts created by listhandler.')); - $form['listhandler_list']['#tree'] = TRUE; - $form['listhandler_prefix']['#tree'] = TRUE; + $form['listhandler_list'] = array( + '#tree' => TRUE, + ); + + $form['listhandler_prefix'] = array( + '#tree' => TRUE, + ); + $result = db_query("SELECT * FROM {mailhandler} WHERE mailto != '' ORDER BY mailto"); while ($mailbox = db_fetch_object($result)) { @@ -84,7 +90,6 @@ '#value' => "
"); $form['listhandler_prefix'][$mailbox->mid] = array( '#type' => 'textfield', - '#title' => $mailbox->mid, '#default_value' => $mailbox->prefix, '#size' => 50, '#maxlength' => 100); @@ -97,7 +102,7 @@ * Theme call to render the tabular form of mailing lists and prefixes */ -function theme_listhandler_settings($form) { +function theme_listhandler_admin_settings($form) { $output = drupal_render($form['listhandler_from']); $output .= drupal_render($form['listhandler_strip_title']); $output .= drupal_render($form['listhandler_accountstatus']); @@ -121,16 +126,14 @@ } function listhandler_admin_settings_submit($form_id, &$form_values) { - $edit = $form_values['edit']; - variable_set('listhandler_from', $edit['listhandler_from']); - variable_set('listhandler_strip_title', $edit['listhandler_strip_title']); - variable_set('listhandler_accountstatus', $edit['listhandler_accountstatus']); - if (isset($edit['listhandler_prefix'])) { - foreach ($edit['listhandler_prefix'] as $key => $value) { + variable_set('listhandler_from', $form_values['listhandler_from']); + variable_set('listhandler_strip_title', $form_values['listhandler_strip_title']); + variable_set('listhandler_accountstatus', $form_values['listhandler_accountstatus']); + if (isset($form_values['listhandler_prefix'])) { + foreach ($form_values['listhandler_prefix'] as $key => $value) { db_query("UPDATE {mailhandler} SET prefix = '%s' WHERE mid = %d", $value, $key); } } - drupal_set_message('The configuration options have been saved.'); return system_settings_form_submit($form_id, $form_values); }