52639d23 |
1 | <?php |
2 | |
3 | /** |
4 | * edit_list_widget_list_style.tpl |
5 | * |
6 | * Template for constructing an edit list using a list-format layout. |
7 | * |
8 | * The following variables are available in this template: |
9 | * |
b6a08d2d |
10 | * string $name The name of the edit list |
11 | * string $input_widget A preconstructed input text box used |
12 | * for adding new elements to the edit list |
13 | * boolean $use_input_widget Whether or not to present the $input_widget |
de4c101c |
14 | * boolean $use_delete_widget Whether or not to present the $checkbox_widget |
15 | * string $select_widget A preconstructed select widget containing |
16 | * all the elements in the list |
17 | * string $checkbox_widget A preconstructed checkbox used for deleting |
18 | * elements from the edit list |
b6a08d2d |
19 | * string $trailing_text Any text given by the caller to be displayed |
20 | * after the edit list input |
21 | * array $possible_values The original list of options in the edit list, |
22 | * for use constructing layouts alternative to |
23 | * the select widget |
52639d23 |
24 | * |
25 | * @copyright © 1999-2008 The SquirrelMail Project Team |
26 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
27 | * @version $Id: select.tpl 12961 2008-02-24 22:35:08Z pdontthink $ |
28 | * @package squirrelmail |
29 | * @subpackage templates |
30 | */ |
31 | |
32 | |
33 | // retrieve the template vars |
34 | // |
35 | extract($t); |
36 | |
37 | |
b6a08d2d |
38 | echo '<table class="table2" cellspacing="0"><tr><td>'; |
39 | |
40 | if ($use_input_widget) |
41 | echo _("Add") . ' ' . $input_widget . '<br />'; |
42 | |
43 | echo '<table class="table_messageList" cellspacing="0">'; |
52639d23 |
44 | |
45 | $class = 'even'; |
46 | $index = 0; |
47 | |
48 | foreach ($possible_values as $key => $value) { |
49 | |
50 | if ($class == 'even') $class = 'odd'; |
51 | else $class = 'even'; |
52 | |
53 | echo '<tr class="' . $class . '">' |
54 | . '<td class="col_check" style="width:1%"><input type="checkbox" name="new_' . $name . '[' . ($index++) . ']" id="' . $name . '_list_item_' . $key . '" value="' . $value . '"></td>' |
55 | . '<td><label for="' . $name . '_list_item_' . $key . '">' . $value . '</label></td>' |
56 | . "</tr>\n"; |
57 | |
58 | } |
59 | |
60 | echo '</table>'; |
61 | |
de4c101c |
62 | if (!empty($possible_values) && $use_delete_widget) |
52639d23 |
63 | echo $checkbox_widget . ' <label for="delete_' . $name . '">' |
64 | . _("Delete Selected") . '</label>'; |
65 | |
66 | echo '</td></tr></table>'; |