Happy New Year!
[squirrelmail.git] / templates / default / read_recipient_list.tpl
1 <?php
2 /**
3 * read_recipient_list.tpl
4 *
5 * Template to generate the listing of recipeients for the To, CC and BCC fields.
6 *
7 * The following variables are available in this template:
8 * $which_field - The field that is currently being displayed. Will be 'to',
9 * 'cc' or 'bcc'
10 * $more_less_toggle_href - URL to toggle more/less addresses for this field
11 * $show_more - boolean TRUE if we want to show all addresses for this field.
12 * $recipients - array containing all receipients for this field. Each element
13 * is an array representing a recipient and contains the following
14 * elements:
15 * $r['Name'] - The name attached to the receipient. Will contain the email
16 * if no name is provided.
17 * $r['Email'] - Email address of the recipient
18 * $a['Full'] - Full name + email
19 *
20 * @copyright 1999-2011 The SquirrelMail Project Team
21 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
22 * @version $Id$
23 * @package squirrelmail
24 * @subpackage templates
25 */
26
27 /** add required includes **/
28
29 /** extract template variables **/
30 extract($t);
31
32 /** Begin template **/
33 $count = 0;
34 echo "<span class=\"recpt_head\">";
35
36 foreach ($recipients as $r) {
37 $count++;
38
39 echo $r['Full'];
40 if ($count != count($recipients)) {
41 echo ", \n ";
42 }
43 if (!$show_more && $count == 3) {
44 echo "</span><span id=\"recpt_tail_" . $which_field . "\">";
45 }
46 }
47 echo "</span>\n";
48
49
50 if (count($recipients) > 3) {
51 if ( checkForJavascript() ) {
52 $url = "javascript:void(0)";
53 $onclick = ' onclick="showhide(\'' . $which_field . "','" . _("more") . "','" . _("less") . "')\"";
54 } else {
55 $url = $more_less_toggle_href;
56 $onlclick = '';
57 }
58
59 echo "&nbsp;(<a href=\"" . $url . "\"" . $onclick . " id=\"toggle_" . $which_field . "\">" .
60 ($show_more ? _("less") : _("more") ) .
61 "</a>)";
62 }
63