Happy New Year
[squirrelmail.git] / templates / default / image.tpl
CommitLineData
efb5bde8 1<?php
2
3/**
4 * image.tpl
5 *
6 * Template for constructing an image.
7 *
8 * The following variables are available in this template:
9 * + $src - the image source path
522a2253 10 * + $id - ID name (optional; may not be present)
efb5bde8 11 * + $class - CSS class name (optional; may not be present)
12 * + $alt - alternative link text
13 * (optional; may not be present)
14 * + $title - the image's title attribute value
15 * (optional; may not be present)
16 * + $width - the width the image should be shown in
17 * (optional; may not be present)
18 * + $height - the height the image should be shown in
19 * (optional; may not be present)
20 * + $align - the image's alignment attribute value
21 * (optional; may not be present)
22 * + $border - the image's border attribute value
23 * (optional; may not be present)
24 * + $hspace - the image's hspace attribute value
25 * (optional; may not be present)
26 * + $vspace - the image's vspace attribute value
27 * (optional; may not be present)
28 * + $onclick - onClick JavaScript handler (optional; may not be present)
bcc55e4b 29 * + $text_alternative - A text replacement for the entire
30 * image tag, if for some reason the
31 * image tag cannot or should not be
32 * produced (optional; may not be present)
6edb574e 33 * + $aAttribs - Any extra attributes: an associative array, where
34 * keys are attribute names, and values (which are
35 * optional and might be null) should be placed
36 * in double quotes as attribute values (optional;
37 * may not be present)
efb5bde8 38 *
c4faef33 39 * @copyright 1999-2020 The SquirrelMail Project Team
efb5bde8 40 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
41 * @version $Id$
42 * @package squirrelmail
43 * @subpackage templates
44 */
45
46
47// retrieve the template vars
48//
49extract($t);
50
51
6edb574e 52echo '<img src="' . $src . '"';
53if (!empty($class)) echo ' class="' . $class . '"';
54if (!empty($id)) echo ' id="' . $id . '"';
55if (!empty($alt)) echo ' alt="' . $alt . '"';
56if (!empty($title)) echo ' title="' . $title . '"';
57if (!empty($onclick)) echo ' onclick="' . $onclick . '"';
84849024 58if (!empty($width) || $width === '0') echo ' width="' . $width . '"';
59if (!empty($height) || $height === '0') echo ' height="' . $height . '"';
6edb574e 60if (!empty($align)) echo ' align="' . $align . '"';
84849024 61if (!empty($border) || $border === '0') echo ' border="' . $border . '"';
62if (!empty($hspace) || $hspace === '0') echo ' hspace="' . $hspace . '"';
63if (!empty($vspace) || $vspace === '0') echo ' vspace="' . $vspace . '"';
6edb574e 64foreach ($aAttribs as $key => $value) {
65 echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
66}
67echo ' />';
68
69