f7b996c3 |
1 | <?php |
2 | |
3 | /** |
4 | * hyperlink.tpl |
5 | * |
6 | * Template for constructing a hyperlink. |
7 | * |
8 | * The following variables are available in this template: |
6edb574e |
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) |
f7b996c3 |
22 | * |
23 | * @copyright © 1999-2006 The SquirrelMail Project Team |
24 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
25 | * @version $Id$ |
26 | * @package squirrelmail |
c3420f94 |
27 | * @subpackage templates |
f7b996c3 |
28 | */ |
29 | |
30 | |
31 | // retrieve the template vars |
32 | // |
33 | extract($t); |
34 | |
35 | |
6edb574e |
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 . '"'); |
45 | } |
46 | echo '>' . $text . '</a>'; |
47 | |
48 | |