From: garvinhicking Date: Fri, 22 Jul 2005 08:56:47 +0000 (+0000) Subject: Allow to make

-> \n replacements for mailer plugin X-Git-Tag: 0.9~299 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3f4ec642a10f62bf66031968bd6f2a038bfd891a;p=s9y.git Allow to make

-> \n replacements for mailer plugin --- diff --git a/plugins/serendipity_event_mailer/serendipity_event_mailer.php b/plugins/serendipity_event_mailer/serendipity_event_mailer.php index fab2fea..2a59526 100644 --- a/plugins/serendipity_event_mailer/serendipity_event_mailer.php +++ b/plugins/serendipity_event_mailer/serendipity_event_mailer.php @@ -16,6 +16,8 @@ switch ($serendipity['lang']) { @define('PLUGIN_EVENT_MAILER_LINKDESC', 'Verschickt die URL des Artikels.'); @define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'HTML entfernen?'); @define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Entfernt HTML-Anweisungen aus der Mail.'); + @define('PLUGIN_EVENT_MAILER_CONVERTP', 'HTML-Paragraphen in Leerzeilen wandeln?'); + @define('PLUGIN_EVENT_MAILER_CONVERTPDESC', 'Fügt einen Zeilenumbruch nach jedem HTML-Paragraphen ein. Besonders hilfreich im Zusammenhang mit der Option "HTML Entfernen", damit der Eintrag später selbst dann Umbrüche enthält, wenn sie nicht manuell eingegeben wurden.'); break; case 'en': @@ -29,6 +31,8 @@ switch ($serendipity['lang']) { @define('PLUGIN_EVENT_MAILER_LINKDESC', 'Include a link to the article in the mail.'); @define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'Remove HTML?'); @define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Remove HTML-Tags from the mail.'); + @define('PLUGIN_EVENT_MAILER_CONVERTP', 'Convert HTML-paragraphs to newlines?'); + @define('PLUGIN_EVENT_MAILER_CONVERTPDESC', 'Adds a newline after each HTML paragraph. This is very useful if you enable HTML removing, so that your paragraphs can be kept if not manually entered.'); break; } @@ -44,7 +48,7 @@ class serendipity_event_mailer extends serendipity_event $propbag->add('description', PLUGIN_EVENT_MAILER_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Sebastian Nohn, Kristian Köhntopp, Garvin Hicking'); - $propbag->add('version', '1.1'); + $propbag->add('version', '1.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -55,7 +59,7 @@ class serendipity_event_mailer extends serendipity_event )); $propbag->add('groups', array('FRONTEND_ENTRY_RELATED')); - $propbag->add('configuration', array('mailto', 'includelink', 'striptags')); + $propbag->add('configuration', array('mailto', 'includelink', 'striptags', 'convertp')); } function introspect_config_item($name, &$propbag) @@ -82,6 +86,13 @@ class serendipity_event_mailer extends serendipity_event $propbag->add('default', 'false'); break; + case 'convertp': + $propbag->add('type', 'boolean'); + $propbag->add('name', PLUGIN_EVENT_MAILER_CONVERTP); + $propbag->add('description', PLUGIN_EVENT_MAILER_CONVERTPDESC); + $propbag->add('default', 'false'); + break; + default: break; } @@ -109,6 +120,10 @@ class serendipity_event_mailer extends serendipity_event 'from' => $serendipity['serendipityEmail'] ); + if (serendipity_db_bool($this->get_config('convertp', false)) == true) { + $mail['body'] = str_replace('

', "

\n", $mail['body']); + } + if (serendipity_db_bool($this->get_config('striptags', false)) == true) { $mail['body'] = strip_tags($mail['body']); }