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