Merge branch 'master' of /home/git/platal
[platal.git] / plugins / block.tidy.php
index 3af18ee..d74de2f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-$tidy_on = Array(
-    'drop-empty-paras',
-    'drop-font-tags',
-    'drop-proprietary-attributes',
-    'hide-comments',
-    'logical-emphasis',
-    'output-xhtml',
-    'replace-color',
-    'show-body-only'
-);
-$tidy_off = Array(
-    'clean',
-    'join-styles',
-    'join-classes'
-);
-
-foreach($tidy_on as $opt) { tidy_setopt($opt, true); }
-foreach($tidy_off as $opt) { tidy_setopt($opt, false); }
-tidy_setopt('alt-text', '[ inserted by TIDY ]');
-tidy_setopt('wrap', '120');
-unset($tidy_o, $tydy_off);
+global $tidy_config;
+$tidy_config = array(
+    'drop-empty-paras' => true,
+    'drop-font-tags' => true,
+    'drop-proprietary-attributes' => true,
+    'hide-comments' => true,
+    'logical-emphasis' => true,
+    'output-xhtml' => true,
+    'replace-color' => true,
+    'show-body-only' => true,
+    'clean' => false,
+    'join-styles' => false,
+    'join-classes' => false,
+    'alt-text' => '[ inserted by TIDY ]',
+    'wrap' => '120');
 
 /*
  * Smarty plugin
@@ -47,12 +41,14 @@ unset($tidy_o, $tydy_off);
  * File:     block.min_perms.php
  * Type:     block
  * Name:     min_perms
- * Purpose:  
+ * Purpose:
  * -------------------------------------------------------------
  */
 function smarty_block_tidy($params, $content, &$smarty)
 {
-    return tidy_repair_string($content);
+    global $tidy_config;
+    return tidy_repair_string($content, $tidy_config, 'utf8');
 }
 
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>