Add a link to password documentation.
[platal.git] / plugins / compiler.icon.php
index 330ea84..c675903 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   *
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
+require_once 'platal.inc.php';
 
 function smarty_compiler_icon($tag_attrs, &$compiler)
 {
     extract($compiler->_parse_attrs($tag_attrs));
 
+    $alt = 'alt=""';
+    
     if (isset($title)) {
-        $title = 'title="'.htmlentities(trim($title, '\'"'), ENT_QUOTES).'" ';
+        $title = pl_entities(trim($title, '\'"'), ENT_QUOTES);
+        $alt = 'alt="'.$title.'"';
+        $title = 'title="'. $title.'" ';
     }
 
-    $name = htmlentities(trim($name, '\'"'), ENT_QUOTES);
+    $name = pl_entities(trim($name, '\'"'), ENT_QUOTES);
     $name = "images/icons/$name.gif";
     if ($full) {
         global $globals;
         $name = $globals->baseurl . '/' . $name;
     }
 
-    return "?><img src='$name' alt='' $title /><?php";
+    return "?><img src='$name' $alt $title /><?php";
 }
 
-/* vim: set expandtab: */
+/* vim: set expandtab enc=utf-8: */
 
 ?>