Happy New Year
[squirrelmail.git] / templates / default / hyperlink.tpl
index 7b31e5b41eea60528503062539407c42606c84c2..3df4121b9b50f652e9ee6af390619048147df163 100644 (file)
@@ -6,16 +6,21 @@
   * Template for constructing a hyperlink.
   *
   * The following variables are available in this template:
-  *      + $uri     - the target link location
-  *      + $text    - link text
-  *      + $target  - the location where the link should be opened 
-  *                   (optional; may not be present)
-  *      + $onclick - onClick JavaScript handler (optional; may not be present)
-  *      + $class   - CSS class name (optional; may not be present)
-  *      + $id      - ID name (optional; may not be present)
-  *      + $name    - Anchor name (optional; may not be present)
+  *      + $uri      - the target link location
+  *      + $text     - link text
+  *      + $target   - the location where the link should be opened 
+  *                    (optional; may not be present)
+  *      + $onclick  - onClick JavaScript handler (optional; may not be present)
+  *      + $class    - CSS class name (optional; may not be present)
+  *      + $id       - ID name (optional; may not be present)
+  *      + $name     - Anchor name (optional; may not be present)
+  *      + $aAttribs - Any extra attributes: an associative array, where 
+  *                    keys are attribute names, and values (which are 
+  *                    optional and might be null) should be placed
+  *                    in double quotes as attribute values (optional; 
+  *                    may not be present)
   *
-  * @copyright © 1999-2006 The SquirrelMail Project Team
+  * @copyright 1999-2020 The SquirrelMail Project Team
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
   * @version $Id$
   * @package squirrelmail
 extract($t);
 
 
-?><a href="<?php echo $uri ?>"<?php if (!empty($target)) echo ' target="' . $target . '"'; ?><?php if (!empty($onclick)) echo ' onclick="' . $onclick . '"'; ?><?php if (!empty($name)) echo ' name="' . $name . '"'; ?><?php if (!empty($class)) echo ' class="' . $class . '"'; ?><?php if (!empty($id)) echo ' id="' . $id . '"'; ?>><?php echo $text; ?></a>
+echo '<a href="' . $uri . '"';
+if (!empty($target)) echo ' target="' . $target . '"';
+if (!empty($onclick)) echo ' onclick="' . $onclick . '"';
+if (!empty($name)) echo ' name="' . $name . '"';
+if (!empty($class)) echo ' class="' . $class . '"';
+if (!empty($id)) echo ' id="' . $id . '"';
+else if (!empty($name)) echo ' id="' . $name . '"';
+foreach ($aAttribs as $key => $value) {
+    echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo '>' . $text . '</a>';
+
+