Add attribute array to hyperlink/image/span templates for future extensibility
[squirrelmail.git] / templates / default / image.tpl
index 61ad8cf83cc445e955869e7ac64e6a2d29d09109..5f3c0b26f1f17b533778e745716be932230d6570 100644 (file)
   *                            image tag, if for some reason the 
   *                            image tag cannot or should not be 
   *                            produced (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
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 extract($t);
 
 
-?><img src="<?php echo $src ?>"<?php if (!empty($class)) echo ' class="' . $class . '"'; ?><?php if (!empty($id)) echo ' id="' . $id . '"'; ?><?php if (!empty($alt)) echo ' alt="' . $alt . '"'; ?><?php if (!empty($title)) echo ' title="' . $title . '"'; ?><?php if (!empty($onclick)) echo ' onclick="' . $onclick . '"'; ?><?php if (!empty($width)) echo ' width="' . $width . '"'; ?><?php if (!empty($height)) echo ' height="' . $height . '"'; ?><?php if (!empty($align)) echo ' align="' . $align . '"'; ?><?php if (!empty($border)) echo ' border="' . $border . '"'; ?><?php if (!empty($hspace)) echo ' hspace="' . $hspace . '"'; ?><?php if (!empty($vspace)) echo ' vspace="' . $vspace . '"'; ?> />
+echo '<img src="' . $src . '"';
+if (!empty($class)) echo ' class="' . $class . '"';
+if (!empty($id)) echo ' id="' . $id . '"';
+if (!empty($alt)) echo ' alt="' . $alt . '"';
+if (!empty($title)) echo ' title="' . $title . '"';
+if (!empty($onclick)) echo ' onclick="' . $onclick . '"';
+if (!empty($width)) echo ' width="' . $width . '"';
+if (!empty($height)) echo ' height="' . $height . '"';
+if (!empty($align)) echo ' align="' . $align . '"';
+if (!empty($border)) echo ' border="' . $border . '"';
+if (!empty($hspace)) echo ' hspace="' . $hspace . '"';
+if (!empty($vspace)) echo ' vspace="' . $vspace . '"';
+foreach ($aAttribs as $key => $value) {
+    echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo ' />';
+
+