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 | * |
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 | * string $select_widget A preconstructed input text box used |
14 | * string $checkbox_widget A preconstructed input text box used |
15 | * string $trailing_text Any text given by the caller to be displayed |
16 | * after the edit list input |
17 | * array $possible_values The original list of options in the edit list, |
18 | * for use constructing layouts alternative to |
19 | * the select widget |
20 | * |
21 | * @copyright © 1999-2008 The SquirrelMail Project Team |
22 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
23 | * @version $Id: select.tpl 12961 2008-02-24 22:35:08Z pdontthink $ |
24 | * @package squirrelmail |
25 | * @subpackage templates |
26 | */ |
27 | |
28 | |
29 | // retrieve the template vars |
30 | // |
31 | extract($t); |
32 | |
33 | |
34 | echo '<table class="table2" cellspacing="0"><tr><td>' |
35 | . _("Add") . ' ' . $input_widget . '<br />' |
36 | . '<table class="table_messageList" cellspacing="0">'; |
37 | |
38 | $class = 'even'; |
39 | $index = 0; |
40 | |
41 | foreach ($possible_values as $key => $value) { |
42 | |
43 | if ($class == 'even') $class = 'odd'; |
44 | else $class = 'even'; |
45 | |
46 | echo '<tr class="' . $class . '">' |
47 | . '<td class="col_check" style="width:1%"><input type="checkbox" name="new_' . $name . '[' . ($index++) . ']" id="' . $name . '_list_item_' . $key . '" value="' . $value . '"></td>' |
48 | . '<td><label for="' . $name . '_list_item_' . $key . '">' . $value . '</label></td>' |
49 | . "</tr>\n"; |
50 | |
51 | } |
52 | |
53 | echo '</table>'; |
54 | |
55 | if (!empty($possible_values)) |
56 | echo $checkbox_widget . ' <label for="delete_' . $name . '">' |
57 | . _("Delete Selected") . '</label>'; |
58 | |
59 | echo '</td></tr></table>'; |