if we have javascript available, use that to toggle more/less links. This is
[squirrelmail.git] / templates / default / read_recipient_list.tpl
index b3f0b2ea18c29e95888af6f699e305b5bc0b003e..a50b7f280339cc313e7aba50d871048e25875c08 100644 (file)
@@ -31,25 +31,33 @@ extract($t);
 
 /** Begin template **/
 $count = 0;
+echo "<span class=\"recpt_head\">";
+
 foreach ($recipients as $r) {
     $count++;
-    if ($count > 3 && !$show_more)
-        continue;
+
     echo $r['Full'];
     if ($count != count($recipients)) {
         echo ", \n   ";
     }
+    if (!$show_more && $count == 3) {
+        echo "</span><span id=\"recpt_tail_" . $which_field . "\">";
+    }
 }
+echo "</span>\n";
 
-if (count($recipients) > 1) {
-    if ($show_more) {
-        ?>
-&nbsp;<small>(<a href="<?php echo $more_less_toggle_href; ?>"><?php echo _("less"); ?></a>)</small>
-        <?php
+
+if (count($recipients) > 3) {
+    if ( checkForJavascript() ) {
+        $url = "javascript:void(0)";
+        $onclick = ' onclick="showhide(\'' . $which_field . "','" . _("more") . "','" . _("less") . "')\"";
     } else {
-        ?>
-&nbsp;<small>(<a href="<?php echo $more_less_toggle_href; ?>"><?php echo _("more"); ?></a>)</small>
-        <?php
+        $url = $more_less_toggle_href;
+        $onlclick = '';
     }
+
+    echo "&nbsp;(<a href=\"" . $url . "\"" . $onclick . " id=\"toggle_" . $which_field . "\">" .
+        ($show_more ? _("less") : _("more") ) .
+        "</a>)";
 }