6 * Template for constructing a hyperlink.
8 * The following variables are available in this template:
9 * + $uri - the target link location
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;
23 * @copyright © 1999-2009 The SquirrelMail Project Team
24 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
26 * @package squirrelmail
27 * @subpackage templates
31 // retrieve the template vars
36 echo '<a href="' . $uri . '"';
37 if (!empty($target)) echo ' target="' . $target . '"';
38 if (!empty($onclick)) echo ' onclick="' . $onclick . '"';
39 if (!empty($name)) echo ' name="' . $name . '"';
40 if (!empty($class)) echo ' class="' . $class . '"';
41 if (!empty($id)) echo ' id="' . $id . '"';
42 else if (!empty($name)) echo ' id="' . $name . '"';
43 foreach ($aAttribs as $key => $value) {
44 echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
46 echo '>' . $text . '</a>';