? improve_log_1.patch
? improve_log_2.patch
Index: modr8_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8_admin.inc,v
retrieving revision 1.2.2.7
diff -u -p -r1.2.2.7 modr8_admin.inc
--- modr8_admin.inc	20 Jan 2007 15:18:34 -0000	1.2.2.7
+++ modr8_admin.inc	13 Feb 2007 02:30:03 -0000
@@ -138,6 +138,23 @@ function modr8_form($result = NULL) {
       '#type' => 'value',
       '#value' => $teaser,
     );
+
+    $log_link = '';
+    $events = db_query("SELECT modid FROM {modr8_log} WHERE nid = %d", $node->nid);
+    $count = db_num_rows($events);
+    if ($count) {
+      if ($count == 1) {
+        $url = 'admin/logs/modr8/event/'. db_result($events);
+      }
+      else {
+        $url = 'node/'. $node->nid .'/modr8/';
+      }
+      $message = format_plural($count, 'See the 1 moderation log event for this post', 'Overview of the @count moderation log events for this post');
+      $log_link .= l($message, $url);
+    }
+    $form[$node->nid]['log_link'] = array(
+      '#value' => $log_link,
+    );
     $form[$node->nid]['author_uid'] = array(
       '#type' => 'value',
       '#value' => $node->uid,
@@ -180,9 +197,9 @@ function theme_modr8_form(&$form) {
         'style' => 'vertical-align:top;'
       );
       $preview = $form[$key]['preview']['#value'];
-      if (db_result(db_query("SELECT COUNT(*) FROM {modr8_log} WHERE nid = %d", $key))) {
-        $preview .= '<div><em>'. l(t('See all moderation log events for this post'), 'node/'. $key .'/modr8/', array() , NULL, NULL, FALSE, TRUE) .'</em></div>';
-        // TODO: theme function?
+      
+      if (!empty($form[$key]['log_link']['#value'])) {;
+        $preview .= '<div><em>'. drupal_render($form[$key]['log_link']) .'</em></div>';
       }
       $row[] = array(
         'data' => $preview,
@@ -278,12 +295,12 @@ function modr8_usermail($op, $nid, $valu
     $sendmail_from = ini_get('sendmail_from');
     $site_mail = variable_get('site_mail', $sendmail_from);
     if (!strlen($site_mail) || $site_mail == $sendmail_from) {
-      drupal_set_message(t('You should create an administrator mail address for your site! <a href="@url">Do it here</a>.', array('@url' => url('admin/settings'))), 'error');
+      drupal_set_message(t('You should create an administrator mail address for your site! <a href="@url">Do it here</a>.', array('@url' => url('admin/settings/site-information'))), 'error');
     }
     // send the email
     if (drupal_mail('modr8_usermail',$account->mail, $subject, $message, $site_mail)) {
       drupal_set_message(t('%type message was sent to %username', array('%type' => $optype, '%username' => $account->name)));
-      $message = filter_filter('process', 2, -1, check_plain($message)); // Return sanitized e-mail with HTML breaks added.
+      $message = filter_xss(nl2br($message), array('br', 'a')); // Return sanitized e-mail with HTML breaks added.
     }
     else {
       $message = t('There was a problem sending the %type message to %username', array('%type' => $optype, '%username' => $account->name));
@@ -385,8 +402,7 @@ function modr8_log_overview($nid = 0) {
     l(truncate_utf8($event->title, 50, TRUE, TRUE), 'admin/logs/modr8/event/'. $event->modid, array(), NULL, NULL, FALSE, TRUE)
     );
   }
-  
-  
+
   if (!$rows) {
     $rows[] = array(array('data' => t('No log messages available.'), 'colspan' => 4));
   }
@@ -413,7 +429,7 @@ function modr8_log_event($modid) {
 
 function theme_moderation_event($event) {
   //drupal_set_message(print_r($event, TRUE));
-  $rows[] = array(array('data' => l(t('See all moderation log events for this post'), 'node/'. $event->nid .'/modr8/', array(), NULL, NULL, FALSE, TRUE), 'colspan' => 2));
+  $rows[] = array(array('data' => l(t('Overview of all moderation log events for this post'), 'node/'. $event->nid .'/modr8/'), 'colspan' => 2));
   $rows[] = array(t('Action:'), t($event->action));
   $rows[] = array(t('Date:'), format_date($event->timestamp, 'small'));
   $rows[] = array(t('Moderator:'), theme('username', $event));
