Happy New Year
[squirrelmail.git] / templates / default / hyperlink.tpl
... / ...
CommitLineData
1<?php
2
3/**
4 * hyperlink.tpl
5 *
6 * Template for constructing a hyperlink.
7 *
8 * The following variables are available in this template:
9 * + $uri - the target link location
10 * + $text - link text
11 * + $target - the location where the link should be opened
12 * (optional; may not be present)
13 * + $onclick - onClick JavaScript handler (optional; may not be present)
14 * + $class - CSS class name (optional; may not be present)
15 * + $id - ID name (optional; may not be present)
16 * + $name - Anchor name (optional; may not be present)
17 * + $aAttribs - Any extra attributes: an associative array, where
18 * keys are attribute names, and values (which are
19 * optional and might be null) should be placed
20 * in double quotes as attribute values (optional;
21 * may not be present)
22 *
23 * @copyright 1999-2018 The SquirrelMail Project Team
24 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25 * @version $Id$
26 * @package squirrelmail
27 * @subpackage templates
28 */
29
30
31// retrieve the template vars
32//
33extract($t);
34
35
36echo '<a href="' . $uri . '"';
37if (!empty($target)) echo ' target="' . $target . '"';
38if (!empty($onclick)) echo ' onclick="' . $onclick . '"';
39if (!empty($name)) echo ' name="' . $name . '"';
40if (!empty($class)) echo ' class="' . $class . '"';
41if (!empty($id)) echo ' id="' . $id . '"';
42else if (!empty($name)) echo ' id="' . $name . '"';
43foreach ($aAttribs as $key => $value) {
44 echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
45}
46echo '>' . $text . '</a>';
47
48