Permalink
Browse files

Merge branch 'master' of https://github.com/KyleAMathews/og_mailinglist

… into module_weight_fix

Conflicts:
	og_mailinglist.install
  • Loading branch information...
2 parents 42fc497 + 911f827 commit dbace5ca0d6e3165487f0fc862e423b28ca60f9b @letapjar letapjar committed Nov 21, 2010
Showing with 8 additions and 23 deletions.
  1. +4 −20 og_mailinglist.install
  2. +2 −2 og_mailinglist_digest_email.inc
  3. +2 −1 og_mailinglist_filter.inc
View
@@ -1,7 +1,6 @@
<?php
// $Id$
-include_once 'og_mailinglist_utilities.inc'; //needed to the hook_requirements to work right
-
+include_once 'og_mailinglist_utilities.inc'; //Load our utilities so the hook_requirements can call those functions.
/**
* Implementation of hook_install().
*/
@@ -17,11 +16,6 @@ function og_mailinglist_install() {
else {
drupal_set_message(st('The installation of the OG Mailinglist tables failed.'), 'error');
}
-
- //set OGM's module_weight to be after pathauto so our email footers always use the correct path
-
- $weight = db_result(db_query("SELECT weight FROM {system} WHERE type = 'module' AND name = 'pathauto'"));
- db_query("UPDATE {system} SET weight = %d WHERE type = 'module' AND name = 'og_mailinglist'", $weight + 1);
}
/**
@@ -55,7 +49,9 @@ function og_mailinglist_requirements($phase) {
$requirements['og_mailinglist_phpmailer']['description'] = t('The <a href="@phpmailer">PHPMailer</a> library is missing or not installed correctly. <a href="@download">Download</a> and extract it to your <em>og_mailinglist</em> module directory. See the INSTALL.txt file for more information at path/to/drupal@install.', array('@phpmailer' => 'http://phpmailer.worxware.com/index.php?pg=phpmailer', '@download' => 'http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php5_6/', '@install' => url(drupal_get_path('module', 'og_mailinglist') . '/INSTALL.txt')));
$requirements['og_mailinglist_phpmailer']['severity'] = REQUIREMENT_ERROR;
}
- og_mailinglist_mimeDecode_load_library();
+
+ //Check for the Mail_mimeDecode library.
+ og_mailinglist_mimeDecode_load_library();
$requirements['og_mailinglist_mimeDecode']['title'] = t('Mail_mimeDecode PEAR extension');
if (class_exists('Mail_mimeDecode')) {
$requirements['og_mailinglist_mimeDecode']['value'] = 'Mail_mimeDecode PEAR Extension found';
@@ -315,18 +311,6 @@ function og_mailinglist_update_6004() {
return $ret;
}
-/**
-* Change module weight to ensure we fire after pathauto if its present.
-*/
-function og_mailinglist_update_6005() {
- $ret = array();
-
- $weight = db_result(db_query("SELECT weight FROM {system} WHERE type = 'module' AND name = 'pathauto'"));
- db_query("UPDATE {system} SET weight = %d WHERE type = 'module' AND name = 'og_mailinglist'", $weight + 1);
-
- return $ret;
-}
-
function add_groups_to_og_mailinglist() {
if (!module_exists('purl') && !module_exists('spaces_og')) {
$results = db_query("SELECT nid, title FROM {node} WHERE type = 'group'");
@@ -186,15 +186,15 @@ function og_mailinglist_style_node_message($node) {
// Prepare node body for viewing.
$node = og_mailinglist_render_node_body($node);
- $body .= og_mailinglist_prepare_web_content($node->body); // TODO Test if names go out correctly + switch it to use watchdog.
+ $body .= og_mailinglist_prepare_web_content($node->body);
$body .= "<br />\n";
return $body;
}
function og_mailinglist_style_comment_message($comment) {
$user = user_load(array('uid' => $comment->uid));
- $body .= "<div style=\"" . MESSAGE_HEADER . "\"><strong>" .
+ $body = "<div style=\"" . MESSAGE_HEADER . "\"><strong>" .
l((isset($user->realname) ? $user->realname : $user->name), "user/" . $user->uid, array('absolute' => TRUE))
. "</strong> " . $user->mail . " " .
date("d M Y — g:ia O", $comment->timestamp) . "</div>\n";
@@ -61,6 +61,7 @@ function _og_mailinglist_filter_quotes($text) {
$lines = explode("\n", $text);
$quotes = array();
$count = 0;
+ $in_quote = FALSE;
foreach ($lines as $line) {
if (preg_match("/On\s\w{3},\s\w{3}\s\d{1,2},\s\d{4}\sat\s\d{1,2}:\d{2}\s[PM|AM]/s", #Gmail
$line, $matches)
@@ -78,7 +79,7 @@ function _og_mailinglist_filter_quotes($text) {
$quotes[$count][] = $line;
- $in_quote = true;
+ $in_quote = TRUE;
}
else if ($in_quote && (trim($line) === "" || substr(trim($line), 0, 1) === ">"
// or the previous line ended w/ a "<" Long emails addresses

0 comments on commit dbace5c

Please sign in to comment.