fsf changes, meant to be rebased on upstream
[squirrelmail.git] / templates / default / edit_list_widget.tpl
index 372e2a6a8f9640106bdad854079e29574801a4ed..cde4b20b6594256df24e2bc433c865611e11a167 100644 (file)
@@ -7,20 +7,25 @@
   *
   * The following variables are available in this template:
   *
-  * string  $name            The name of the edit list
-  * string  $input_widget    A preconstructed input text box used
-  *                          for adding new elements to the edit list
-  * string  $select_widget   A preconstructed input text box used
-  * string  $checkbox_widget A preconstructed input text box used
-  * string  $trailing_text   Any text given by the caller to be displayed
-  *                          after the edit list input
-  * array   $possible_values The original list of options in the edit list,
-  *                          for use constructing layouts alternative to
-  *                          the select widget
+  * string   $name              The name of the edit list
+  * string   $input_widget      A preconstructed input text box used
+  *                             for adding new elements to the edit list
+  * boolean  $use_input_widget  Whether or not to present the $input_widget
+  * boolean  $use_delete_widget Whether or not to present the $checkbox_widget
+  * string   $select_widget     A preconstructed select widget containing
+  *                             all the elements in the list
+  * string   $checkbox_widget   A preconstructed checkbox used for deleting
+  *                             elements from the edit list
+  * string   $trailing_text     Any text given by the caller to be displayed
+  *                             after the edit list input
+  * array    $possible_values   The original list of options in the edit list,
+  *                             for use constructing layouts alternative to
+  *                             the select widget
+  * mixed    $current_value     The currently selected value(s)
   *
-  * @copyright © 1999-2008 The SquirrelMail Project Team
+  * @copyright 1999-2021 The SquirrelMail Project Team
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
-  * @version $Id: select.tpl 12961 2008-02-24 22:35:08Z pdontthink $
+  * @version $Id$
   * @package squirrelmail
   * @subpackage templates
   */
 extract($t);
 
 
-echo _("Add") . '&nbsp;' . $input_widget . '<br />' . $select_widget 
-   . '<br />' . $checkbox_widget . '&nbsp;<label for="delete_' . $name . '">' 
-   . _("Delete Selected") . '</label>';
+if ($use_input_widget) 
+    echo _("Add") . '&nbsp;' . $input_widget . '<br />';
+if (!empty($trailing_text))
+    echo ($trailing_text_small ? '<small>' : '') . ($trailing_text_is_html ? $trailing_text : sm_encode_html_special_chars($trailing_text)) . ($trailing_text_small ? '</small>' : '') . '<br />';
+
+echo $select_widget;
+
+if (!empty($possible_values) && $use_delete_widget)
+   echo '<br />' . $checkbox_widget . '&nbsp;<label for="delete_' . $name . '">' 
+      . _("Delete Selected") . '</label>';