Merge branch 0.9.17
[platal.git] / plugins / modifier.miniwiki.php
index d437c3f..d47e221 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
 
 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: