Reverting to old string.
[squirrelmail.git] / templates / default / left_main_advanced.tpl
CommitLineData
29997535 1<?php
e945d2c2 2
29997535 3/**
4 * left_main_advanced.tpl
5 *
e945d2c2 6 * Displays an experimental mailbox-tree with dhtml behaviour.
29997535 7 * It only works on browsers which supports css and javascript. The used
8 * javascript is experimental and doesn't support all browsers.
9 * It has been tested on IE6 an Konquerer 3.0.0-2.
10 * It is now tested and working on: (please test and update this list)
11 * Windows: IE 5.5 SP2, IE 6 SP1, Gecko based (Mozilla, Firebird) and Opera7
12 * XWindow: ?
13 * Mac: ?
14 * In the function ListAdvancedBoxes there is another var $use_folder_images.
15 * setting this to true is only usefull if the images exists in ../images.
16 *
17 * Feel free to experiment with the code and report bugs and enhancements
18 *
19 * The following variables are avilable in this template:
20 * $clock - formatted string containing last refresh
21 * $mailbox_listing - string containing HTML to display default mailbox tree
22 * $location_of_bar - string "left" or "right" indicating where the frame
23 * is located. Currently only used in
24 * left_main_advanced.tpl
25 * $left_size - width of left column in pixels. Currently only used
26 * in left_main_advanced.tpl
e945d2c2 27 * $imapConnection - IMAP connection handle. Needed to allow plugins to
29997535 28 * read the mailbox.
29 * $icon_theme_path - Path to the desired icon theme. If no icon theme has
30 * been chosen, this will be the template directory. If
31 * the user has disabled icons, this will be NULL.
32 *
e945d2c2 33 * $unread_notification_enabled - Boolean TRUE if the user wants to see unread
29997535 34 * message count on mailboxes
35 * $unread_notification_cummulative - Boolean TRUE if the user has enabled
36 * cummulative message counts.
37 * $unread_notification_allFolders - Boolean TRUE if the user wants to see
38 * unread message count on ALL folders or just the
39 * mailbox.
40 * $unread_notification_displayTotal - Boolean TRUE if the user wants to
41 * see the total number of messages in addition to
42 * the unread message count.
43 * $collapsable_folders_enabled - Boolean TRUE if the user has enabled collapsable
44 * folders.
45 * $use_special_folder_color - Boolean TRUE if the use has chosen to tag
46 * "Special" folders in a different color.
47 * $message_recycling_enabled - Boolean TRUE if messages that get deleted go to
48 * the Trash folder. FALSE if they are permanently
49 * deleted.
50 * $trash_folder_name - Name of the Trash folder.
e945d2c2 51 *
29997535 52 * $mailboxes - Associative array of current mailbox structure.
53 * Provided so template authors know what they have to
54 * work with when building a custom mailbox tree.
55 * Array contains the following elements:
56 * $a['MailboxName'] = String containing the name of the mailbox
57 * $a['MailboxFullName'] = String containing full IMAP name of mailbox
58 * $a['MessageCount'] = integer of all messages in the mailbox
59 * $a['UnreadCount'] = integer of unseen message in the mailbox
60 * $a['ViewLink'] = array containing elements needed to view the
61 * mailbox. Elements are:
62 * 'Target' = target frame for link
63 * 'URL' = target URL for link
64 * $a['IsRecent'] = boolean TRUE if the mailbox is tagged "recent"
65 * $a['IsSpecial'] = boolean TRUE if the mailbox is tagged "special"
66 * $a['IsRoot'] = boolean TRUE if the mailbox is the root mailbox
67 * $a['IsNoSelect'] = boolean TRUE if the mailbox is tagged "noselect"
68 * $a['IsCollapsed'] = boolean TRUE if the mailbox is currently collapsed
69 * $a['CollapseLink'] = array containg elements needed to expand/collapse
70 * the mailbox. Elements are:
71 * 'Target' = target frame for link
72 * 'URL' = target URL for link
73 * 'Icon' = the icon to use, based on user prefs
74 * $a['ChildBoxes'] = array containing this same data structure for
75 * each child folder/mailbox of the current
e945d2c2 76 * mailbox.
29997535 77 * $a['CummulativeMessageCount'] = integer of total messages in all
78 * folders in this mailbox, exlcuding
79 * trash folders.
80 * $a['CummulativeUnreadCount'] = integer of total unseen messages
81 * in all folders in this mailbox,
82 * excluding trash folders.
83 *
84 * *
85 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
86 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
87 * @version $Id$
88 * @package squirrelmail
89 * @subpackage templates
90 */
91
92/*
93 * Recursively parse the mailbox structure to build the navigation tree.
e945d2c2 94 *
29997535 95 * @param array $box Array containing mailbox data
96 * @param array $settings Array containing perferences, etc, passed to template
97 * @param integer $indent_factor Counter used to control indent spacing
98 * @since 1.5.2
99 * @author Steve Brown
100 */
101function buildMailboxTree ($box, $settings, $indent_factor=0) {
102 // Work in progress...
103}
104
105/* retrieve the template vars */
106extract($t);
107
108/*
109 * Build an array to pass user prefs to the function that builds the tree in
110 * order to avoid using globals, which are dirty, filthy things in templates. :)
e945d2c2 111 */
29997535 112$settings = array();
113$settings['imapConnection'] = $imapConnection;
114$settings['iconThemePath'] = $icon_theme_path;
115$settings['unreadNotificationEnabled'] = $unread_notification_enabled;
116$settings['unreadNotificationAllFolders'] = $unread_notification_allFolders;
117$settings['unreadNotificationDisplayTotal'] = $unread_notification_displayTotal;
118$settings['unreadNotificationCummulative'] = $unread_notification_cummulative;
119$settings['useSpecialFolderColor'] = $use_special_folder_color;
120$settings['messageRecyclingEnabled'] = $message_recycling_enabled;
121$settings['trashFolderName'] = $trash_folder_name;
122$settings['collapsableFoldersEnabled'] = $collapsable_folders_enabled;
123
124?>
125<body class="sqm_leftMain">
126<script type="text/javascript" src="js/test.js"></script>
127<script type="text/javascript">
128<!--
129/**
e945d2c2 130 * Advanced tree makes uses dTree JavaScript package by Geir Landrö heavily.
29997535 131 * See http://www.destroydrop.com/javascripts/tree/
132 */
133 function preload() {
134 if (document.images) {
135 var treeImages = new Array;
136 var arguments = preload.arguments;
137 for (var i = 0; i<arguments.length; i++) {
138 treeImages[i] = new Image();
139 treeImages[i].src = arguments[i];
140 }
141 }
142 }
143 var vTreeImg;
144 var vTreeDiv;
145 var vTreeSrc;
146 function fTreeTimeout() {
147 if (vTreeDiv.readyState == "complete")
148 vTreeImg.src = vTreeSrc;
149 else
150 setTimeout("fTreeTimeout()", 100);
151 }
152 function hidechilds(img) {
153 id = img.id + ".0000";
154 form_id = "mbx[" + img.id +"F]";
155 if (document.all) { //IE, Opera7
156 div = document.all[id];
157 if (div) {
158 if (div.style.display == "none") {
159 vTreeSrc = "../images/minus.png";
160 style = "block";
161 value = 0;
162 }
163 else {
164 vTreeSrc = "../images/plus.png";
165 style = "none";
166 value = 1;
167 }
168 vTreeImg = img;
169 vTreeDiv = div;
170 if (typeof vTreeDiv.readyState != "undefined") //IE
171 setTimeout("fTreeTimeout()",100);
172 else //Non IE
173 vTreeImg.src = vTreeSrc;
174 div.style.display = style;
175 document.all[form_id].value = value;
176 }
177 }
178 else if (document.getElementById) { //Gecko
179 div = document.getElementById(id);
180 if (div) {
181 if (div.style.display == "none") {
182 src = "../images/minus.png";
183 style = "block";
184 value = 0;
185 }
186 else {
187 src = "../images/plus.png";
188 style = "none";
189 value = 1;
190 }
191 div.style.display = style;
192 img.src = src;
193 document.getElementById(form_id).value = value;
194 }
195 }
196 }
197 function buttonover(el,on) {
198 if (!on) {
199 el.style.background="$color[0]";}
200 else {
201 el.style.background="$color[9]";}
202 }
203 function buttonclick(el,on) {
204 if (!on) {
205 el.style.border="groove";}
206 else {
207 el.style.border="ridge";}
208 }
209 function hideframe(hide) {
210 left_size = "$left_size";
211 if (document.all) {
212 masterf = window.parent.document.all["fs1"];
213 leftf = window.parent.document.all["left"];
214 leftcontent = document.all["leftframe"];
215 leftbutton = document.all["showf"];
216 } else if (document.getElementById) {
217 masterf = window.parent.document.getElementById("fs1");
218 leftf = window.parent.document.getElementById("left");
219 leftcontent = document.getElementById("leftframe");
220 leftbutton = document.getElementById("showf");
221 } else {
222 return false;
223 }
224 if(hide) {
225 new_col = calc_col("20");
226 masterf.cols = new_col;
227 document.body.scrollLeft=0;
228 document.body.style.overflow="hidden";
229 leftcontent.style.display = "none";
230 leftbutton.style.display="block";
231 } else {
232 masterf.cols = calc_col(left_size);
233 document.body.style.overflow="";
234 leftbutton.style.display="none";
235 leftcontent.style.display="block";
236 }
237 }
238 function calc_col(c_w) {
239 <?php
240 if ($location_of_bar == 'right') {
241 echo ' right=true;';
242 } else {
243 echo ' right=false;';
244 }
245 ?>
246 if (right) {
247 new_col = '*,'+c_w;
248 } else {
249 new_col = c_w+',*';
250 }
251 return new_col;
252 }
253 function resizeframe(direction) {
254 if (document.all) {
255 masterf = window.parent.document.all["fs1"];
256 } else if (document.getElementById) {
257 window.parent.document.getElementById("fs1");
258 } else {
259 return false;
260 }
261 <?php
262 if ($location_of_bar == 'right') {
263 echo ' colPat=/^\*,(\d+)$/;';
264 } else {
265 echo ' colPat=/^(\d+),.*$/;';
266 }
267 ?>
268 old_col = masterf.cols;
269 colPat.exec(old_col);
270 if (direction) {
271 new_col_width = parseInt(RegExp.$1) + 25;
272 } else {
273 if (parseInt(RegExp.$1) > 35) {
274 new_col_width = parseInt(RegExp.$1) - 25;
275 }
276 }
277 masterf.cols = calc_col(new_col_width);
278 }
279//-->
280</script>
281<style type="text/css">
282<!--
283 body {
284 margin: 0px 0px 0px 0px;
285 padding: 5px 5px 5px 5px;
286 }
287 img {
288 vertical-align: middle;
289 }
290 .button {
291 border:outset;
292 border-color: <?php echo $color[9]; ?>;
293 background: <?php echo $color[0]; ?>;
294 color: <?php echo $color[6]; ?>;
295 width:99%;
296 heigth:99%;
297 }
298 .mbx_par {
299 font-size:1.0em;
300 margin-left:4px;
301 margin-right:0px;
302 white-space: nowrap;
303 }
304 a.mbx_link {
305 text-decoration: none;
306 background-color: <?php echo $color[0]; ?>;
307 display: inline;
308 }
309 a:hover.mbx_link {
310 background-color: <?php echo $color[9]; ?>;
311 }
312 a.mbx_link img {
313 border-style: none;
314 }
315 .mbx_sub {
316 padding-left:5px;
317 padding-right:0px;
318 margin-left:4px;
319 margin-right:0px;
320 font-size:0.9em;
321 white-space: nowrap;
322 }
323 .par_area {
324 margin-top:0px;
325 margin-left:4px;
326 margin-right:0px;
327 padding-left:10px;
328 padding-bottom:5px;
329 border-left: solid;
330 border-left-width:0.1em;
331 border-left-color: <?php echo $color[9]; ?>;
332 border-bottom: solid;
333 border-bottom-width:0.1em;
334 border-bottom-color: <?php echo $color[9]; ?>;
335 display: block;
336 }
337 .mailboxes {
338 padding-bottom:3px;
339 margin-right:4px;
340 padding-right:4px;
341 margin-left:4px;
342 padding-left:4px;
343 border: groove;
344 border-width:0.1em;
345 border-color: <?php echo $color[9]; ?>;
346 background: <?php echo $color[0]; ?>;
347 font-size: smaller;
348 }
349-->
350</style>
351<div class="sqm_leftMain">
352<?php
353$right_pos = $left_size - 20;
354?>
355<div style="position:absolute; top:0; border:0.1em solid blue;">
356 <div id="hidef" style="width=20;font-size:12"><a href="javascript:hideframe(true)"><b>&lt;&lt;</b></a></div>
357 <div id="showf" style="width=20;font-size:12;display:none;"><a href="javascript:hideframe(false)"><b>&gt;&gt;</b></a></div>
358 <div id="incrf" style="width=20;font-size:12"><a href="javascript:resizeframe(true)"><b>&gt;</b></a></div>
359 <div id="decrf" style="width=20;font-size:12"><a href="javascript:resizeframe(false)"><b>&lt;</b></a></div>
360</div>
361<div id="leftframe">
362<br />
363<br />
364<br />
365<?php do_hook('left_main_before'); ?>
366<table class="sqm_wrapperTable" cellspacing="0">
367 <tr>
368 <td>
369 <table cellspacing="0">
370 <tr>
371 <td style="text-align:center">
372 <span class="sqm_folderHeader"><?php echo _("Folders"); ?></span><br />
373 <span class="sqm_clock"><?php echo $clock; ?></span>
e945d2c2 374 <span class="sqm_refreshButton"><small>[<a href="../src/left_main.php" target="left"><?php echo _("Check mail"); ?></a>]</small></span>
29997535 375 </td>
376 </tr>
377 </table>
378 <br />
379 <?php echo $mailbox_listing; ?>
380 </tr>
381 </td>
382</table>
383<?php do_hook('left_main_after'); ?>
e945d2c2 384</div>
385<?php var_dump($template_dir); ?>