fsf changes, meant to be rebased on upstream
[squirrelmail.git] / templates / default / read_recipient_list.tpl
CommitLineData
3cb5a0bb 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 *
77a1e3d1 20 * @copyright 1999-2022 The SquirrelMail Project Team
3cb5a0bb 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 **/
30extract($t);
31
32/** Begin template **/
33$count = 0;
c0b2f2e1 34echo "<span class=\"recpt_head\">";
35
3cb5a0bb 36foreach ($recipients as $r) {
37 $count++;
c0b2f2e1 38
3cb5a0bb 39 echo $r['Full'];
5d26624e 40 if ($count != count($recipients)) {
41 echo ", \n ";
3cb5a0bb 42 }
c0b2f2e1 43 if (!$show_more && $count == 3) {
44 echo "</span><span id=\"recpt_tail_" . $which_field . "\">";
45 }
3cb5a0bb 46}
c0b2f2e1 47echo "</span>\n";
48
3cb5a0bb 49
0ce793dc 50if (count($recipients) > 3) {
c0b2f2e1 51 if ( checkForJavascript() ) {
52 $url = "javascript:void(0)";
53 $onclick = ' onclick="showhide(\'' . $which_field . "','" . _("more") . "','" . _("less") . "')\"";
3cb5a0bb 54 } else {
c0b2f2e1 55 $url = $more_less_toggle_href;
56 $onlclick = '';
3cb5a0bb 57 }
c0b2f2e1 58
59 echo "&nbsp;(<a href=\"" . $url . "\"" . $onclick . " id=\"toggle_" . $which_field . "\">" .
60 ($show_more ? _("less") : _("more") ) .
61 "</a>)";
5d26624e 62}
63