Index: mail_logger.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mail_logger/mail_logger.install,v retrieving revision 1.4 diff -u -r1.4 mail_logger.install --- mail_logger.install 26 May 2008 00:08:41 -0000 1.4 +++ mail_logger.install 4 Dec 2008 20:23:25 -0000 @@ -70,12 +70,11 @@ '`language`' => array('`language`'), ), ); - + return $schema; } function mail_logger_install() { drupal_install_schema('mail_logger'); - } function mail_logger_uninstall() { drupal_uninstall_schema('mail_logger'); Index: mail_logger.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mail_logger/mail_logger.module,v retrieving revision 1.3 diff -u -r1.3 mail_logger.module --- mail_logger.module 26 May 2008 00:08:41 -0000 1.3 +++ mail_logger.module 4 Dec 2008 20:23:25 -0000 @@ -1,17 +1,17 @@ 'mail_logger'")); db_query("UPDATE {system} SET weight = %d WHERE name = 'mail_logger'", $max_weight + 100); } /** - * implementation of hook_perm(). + * Implementation of hook_perm(). * */ function mail_logger_perm() { @@ -24,20 +24,20 @@ function mail_logger_menu() { $items = array(); $items['admin/reports/mail-logger'] = array( - 'title' => t('Outgoing Mail log entries'), - 'description' => t('View Mails that have been sent from this site.'), + 'title' => 'Outgoing Mail log entries', + 'description' => 'View Mails that have been sent from this site.', 'page callback' => 'mail_logger_overview', 'access arguments' => array('access mail logger'), 'type' => MENU_NORMAL_ITEM, - ); + ); $items['admin/reports/mail-logger/mail/%'] = array( - 'title' => t('Outgoing Mail log entries'), - 'description' => t('View information about a single logged mail entry'), + 'title' => 'Outgoing Mail log entries', + 'description' => 'View information about a single logged mail entry', 'page callback' => 'mail_logger_read_mail', 'page arguments' => array(4), 'access arguments' => array('access mail logger'), 'type' => MENU_CALLBACK, - ); + ); return $items; } @@ -49,10 +49,10 @@ ); } function mail_logger_read_mail($id) { - if(!isset($id) || !is_numeric($id)) { - return 'Invalid Mail Logger ID parameter'; + if (!isset($id) || !is_numeric($id)) { + return 'Invalid Mail Logger ID parameter'; } - else if ($result = db_query('SELECT * FROM {mail_logger} WHERE mlid = %d LIMIT 1', $id) ) { + elseif ($result = db_query_range('SELECT * FROM {mail_logger} WHERE mlid = %d', $id, 0, 1)) { drupal_add_css(drupal_get_path('module', 'mail_logger') .'/mail_logger.css'); return theme('mail_logger_read_mail', db_fetch_object($result)); } @@ -75,7 +75,7 @@ } /** - * implementation of hook_mail_alter + * Implementation of hook_mail_alter(). * * Purpose of this function is to log all outgoing mail */ @@ -95,10 +95,10 @@ time(), $message['language']->language, ); - + db_query("INSERT INTO {mail_logger} ( `mlid` , `mailkey` , `to` , `subject` , `body` , `from` , `headers`, `date_sent`, `language` - ) VALUES ( + ) VALUES ( NULL, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s' )", $args); } @@ -142,8 +142,7 @@ * */ function mail_logger_form_overview_submit($form, &$form_state) { - $form_values = $form_state['values']; - $_SESSION['mail_logger_overview_filter'] = $form_values['filter']; + $_SESSION['mail_logger_overview_filter'] = $form_state['values']['filter']; } /** * theme function for mail_logger_form_overview @@ -170,7 +169,7 @@ $sql = "SELECT ml.mlid, ml.mailkey, ml.language, ml.to, ml.from, ml.subject, ml.date_sent FROM {mail_logger} ml"; $type = $_SESSION['mail_logger_overview_filter']; - + if ($type != 'all') { $result = pager_query($sql ." WHERE ml.mailkey = '%s'". $tablesort, 50, 0, NULL, $type); }