Happy New Year
[squirrelmail.git] / templates / default / image.tpl
index d9d4fbaa1c4ca125d11da7f6467b1c8a8458b32a..a451bfc99c3626fa73ac57b570c400ba4272e037 100644 (file)
@@ -7,6 +7,7 @@
   *
   * The following variables are available in this template:
   *      + $src     - the image source path
+  *      + $id      - ID name (optional; may not be present)
   *      + $class   - CSS class name (optional; may not be present)
   *      + $alt     - alternative link text
   *                   (optional; may not be present)
   *      + $vspace  - the image's vspace attribute value
   *                   (optional; may not be present)
   *      + $onclick - onClick JavaScript handler (optional; may not be present)
+  *      + $text_alternative - A text replacement for the entire
+  *                            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
+  * @copyright 1999-2020 The SquirrelMail Project Team
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
   * @version $Id$
   * @package squirrelmail
 extract($t);
 
 
-?><img src="<?php echo $src ?>"<?php if (!empty($class)) echo ' class="' . $class . '"'; ?><?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) || $width === '0') echo ' width="' . $width . '"';
+if (!empty($height) || $height === '0') echo ' height="' . $height . '"';
+if (!empty($align)) echo ' align="' . $align . '"';
+if (!empty($border) || $border === '0') echo ' border="' . $border . '"';
+if (!empty($hspace) || $hspace === '0') echo ' hspace="' . $hspace . '"';
+if (!empty($vspace) || $vspace === '0') echo ' vspace="' . $vspace . '"';
+foreach ($aAttribs as $key => $value) {
+    echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo ' />';
+
+