Fix hook for folders page
[squirrelmail.git] / templates / default / folder_manip.tpl
1 <?php
2 /**
3  * folder_manip.tpl
4  *
5  * Template for folder management (create, rename, delete, (un)subscribe)
6  *
7  * The following variables are available in this template:
8  *      + $mbx_option_list - string containing all mailboxes as <option>'s for
9  *                           use in <select>'s on this page.
10  *      + $rendel_folder_list - string containing all mailboxes available for
11  *                           delete/rename as <option>'s for use in <select>'s
12  *                           on this page. 
13  *      + $show_subfolders_option - boolean TRUE if the a folder can contain
14  *                           subfolders in conf.pl > Folder Options
15  *      + $show_only_subscribed_folders - boolean TRUE if the user only wants
16  *                           to see subscribed folders.
17  *      + $no_list_for_subscribe = boolean TRUE if the subscribe list should NOT
18  *                           be displayed in conf.pl
19  *      + $subbox_option_list - array containing a list of folders that can be
20  *                           subscribed to.  Each array element contains an
21  *                           array with the following elements:
22  *                              $el['Value'] - encoded string for the VALUE
23  *                                             field of an input element
24  *                              $el['Display'] - string containing the display
25  *                                             name for the element
26  *                            
27  * @copyright &copy; 1999-2006 The SquirrelMail Project Team
28  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
29  * @version $Id$
30  * @package squirrelmail
31  * @subpackage templates
32  */
33
34 /* retrieve the template vars */
35 extract($t);
36 ?>
37 <div class="dialogbox">
38 <table cellspacing="0" class="wrapper">
39  <tr>
40   <td class="header1">
41    <?php echo _("Folders"); ?>
42   </td>
43  </tr>
44  <tr>
45   <td>
46    <table cellspacing="0">
47     <tr>
48      <td class="header2">
49       <?php echo _("Create Folder") ?>
50      </td>
51     </tr>
52     <tr>
53      <td>
54       <form method="post" action="folders.php" name="cf" id="cf">
55       <input type="hidden" name="smaction" value="create" />
56       <input type="text" name="folder_name" size="25" value="" />
57       <br />
58       <?php echo _("as a subfolder of") ?>
59       <br />
60       <select name="subfolder">
61        <?php echo $mbx_option_list; ?>
62       </select>
63       <?php 
64         if ($show_subfolders_option) {
65             ?>
66       <br />
67       <input type="checkbox" name="contain_subs" id="contain_subs" value="1" />
68       &nbsp;
69       <label for="contain_subs"><?php echo _("Let this folder contain subfolders") ?></label>
70       <br />
71             <?php
72         }
73       ?>
74       <input type="submit" value="<?php echo _("Create") ?>" />
75       </form>
76      </td>
77     </tr>
78    </table>
79   </td>
80  </tr>
81  <tr>
82   <td>
83    <table cellspacing="0">
84     <tr>
85      <td class="header2">
86       <?php echo _("Rename a Folder") ?>
87      </td>
88     </tr>
89     <tr>
90      <td>
91       <?php
92         if ( !empty($rendel_folder_list) ) {
93             ?>
94      <form method="post" action="folders.php" name="rf" id="rf">
95      <input type="hidden" name="smaction" value="rename" />
96      <select name="old_name">
97       <option value="">[ <?php echo _("Select a folder") ?> ]</option>
98       <?php echo $rendel_folder_list ?>
99      </select>
100      <input type="submit" value="<?php echo _("Rename") ?>" />
101      </form>
102             <?php
103         } else {
104             echo _("No folders found");
105         }
106       ?>
107      </td>
108     </tr>
109    </table>
110   </td>
111  </tr>
112  <tr>
113   <td>
114    <table cellspacing="0">
115     <tr>
116      <td class="header2">
117       <?php echo _("Delete Folder") ?>
118      </td>
119     </tr>
120     <tr>
121      <td>
122       <?php
123         if ( !empty($rendel_folder_list) ) { 
124             ?>
125       <form method="post" action="folders.php" name="df" id="df">
126       <input type="hidden" name="smaction" value="delete" />
127       <select name="folder_name">
128        <option value="">[ <?php echo _("Select a folder") ?> ]</option>
129        <?php echo $rendel_folder_list ?>
130       </select>
131       <input type="submit" value="<?php echo _("Delete") ?>" />
132       </form>
133             <?php
134         } else {
135             echo _("No folders found");
136         }
137       ?>
138      </td>
139     </tr>
140    </table>
141   </td>
142  </tr>
143  <tr>
144   <td>
145    <?php
146     if ($show_only_subscribed_folders) {
147         ?>
148    <table cellspacing="0">
149     <tr>
150      <td class="header2" colspan="2">
151       <?php echo _("Unsubscribe") .'/'. _("Subscribe"); ?>
152      </td>
153     </tr>
154     <tr>
155      <td>
156       <?php
157         if (!empty($rendel_folder_list)) {
158             ?>
159       <form method="post" action="folders.php" name="uf" id="uf">
160       <input type="hidden" name="smaction" value="unsubscribe" />
161       <select name="folder_names[]" multiple="multiple" size="8">
162        <?php echo $rendel_folder_list ?>
163       </select>
164       <br /><br />
165       <input type="submit" value="<?php echo _("Unsubscribe") ?>" />
166       </form>
167             <?php
168         } else {
169             echo _("No folders were found to unsubscribe from.");
170         }
171       ?>
172      </td>
173      <td>
174      <?php
175         if ($no_list_for_subscribe) {
176             ?>
177       <form method="post" action="folders.php" name="sf" id="sf">
178       <input type="hidden" name="smaction" value="subscribe" />
179       <input type="text" name="folder_names[]" size="25" />
180       <input type="submit" value="<?php echo _("Subscribe") ?>" />
181       </form>
182             <?php
183         } elseif (!empty($subbox_option_list)) {
184             ?>
185       <form method="post" action="folders.php" name="sf" id="sf">
186       <input type="hidden" name="smaction" value="subscribe" />
187       <div>
188             <?php
189 /*
190       <select name="folder_names[]" multiple="multiple" size="8">
191        <?php echo $subbox_option_list ?>
192       </select>
193 */
194             foreach ($subbox_option_list as $folder) {
195                 echo '<input type="checkbox" name="folder_names[]" id="sub_'.$folder['Value'].'" value="'.$folder['Value'].'" /> '.
196                     '<label for="sub_'.$folder['Value'].'">'.$folder['Display'].'</label><br />';
197             }
198             ?>
199       </div>
200       <br />
201       <input type="submit" value="<?php echo _("Subscribe") ?>" />
202       </form>
203             <?php
204         } else {
205             echo _("No folders were found to subscribe to.");
206         }
207      ?>
208      </td>
209     </tr>
210    </table>
211         <?php
212     }
213    ?>
214 <?php /* Known plugins using this output point: empty_folders */ if (!empty($plugin_output['folders_bottom'])) echo $plugin_output['folders_bottom']; ?>
215   </td>
216  </tr>
217 </table>
218 </div>