Convert miniwiki of the freetext to text in the vcards.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 5 Jul 2008 15:54:45 +0000 (17:54 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 5 Jul 2008 15:54:45 +0000 (17:54 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
plugins/modifier.miniwiki.php
templates/core/vcard.tpl

index aef58da..d47e221 100644 (file)
 
 require_once 'platal.inc.php';
 
-function smarty_modifier_miniwiki($string, $format = 'no_title')
+function smarty_modifier_miniwiki($string, $format = 'no_title', $type = 'html')
 {
-    return MiniWiki::wikiToHTML($string, $format == 'title');
+    if ($type == 'html') {
+        return MiniWiki::wikiToHTML($string, $format == 'title');
+    } else {
+        return MiniWiki::wikiToText($string, false, 0, 80, $format == 'title');
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index c3e3097..d0524a1 100644 (file)
@@ -75,7 +75,7 @@ URL:{$vcard.web}
 {if strlen(trim($vcard.freetext)) == 0}
 NOTE:(X{$vcard.promo})
 {else}
-NOTE:(X{$vcard.promo})\n{$vcard.freetext|vcard_enc}
+NOTE:(X{$vcard.promo})\n{$vcard.freetext|miniwiki:'no_title':'text'|vcard_enc}
 {/if}
 {if $vcard.section}
 X-SECTION:{$vcard.section}