--- /dev/null
+/*--------------------------------------------------|
+
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+
+|---------------------------------------------------|
+
+| Copyright (c) 2002-2003 Geir Landr? |
+
+| |
+
+| This script can be used freely as long as all |
+
+| copyright messages are intact. |
+
+| |
+
+| Updated: 17.04.2003 |
+
+|--------------------------------------------------*/
+
+
+
+// Node object
+
+function Node(id, pid, name, url, title, target, icon, iconOpen, open) {
+
+ this.id = id;
+
+ this.pid = pid;
+
+ this.name = name;
+
+ this.url = url;
+
+ this.title = title;
+
+ this.target = target;
+
+ this.icon = icon;
+
+ this.iconOpen = iconOpen;
+
+ this._io = open || false;
+
+ this._is = false;
+
+ this._ls = false;
+
+ this._hc = false;
+
+ this._ai = 0;
+
+ this._p;
+
+};
+
+
+
+// Tree object
+// imagePath parameter added by SquirrelMail Team
+function dTree(objName, imagePath) {
+
+ this.config = {
+
+ target : null,
+
+ folderLinks : true,
+
+ useSelection : true,
+
+ useCookies : true,
+
+ useLines : true,
+
+ useIcons : true,
+
+ useStatusText : false,
+
+ closeSameLevel : false,
+
+ inOrder : false
+
+ }
+
+ this.icon = {
+
+ root : imagePath+'/base.gif',
+
+ folder : imagePath+'/folder.gif',
+
+ folderOpen : imagePath+'/folderopen.gif',
+
+ node : imagePath+'/page.gif',
+
+ empty : imagePath+'/empty.gif',
+
+ line : imagePath+'/line.gif',
+
+ join : imagePath+'/join.gif',
+
+ joinBottom : imagePath+'/joinbottom.gif',
+
+ plus : imagePath+'/plus.gif',
+
+ plusBottom : imagePath+'/plusbottom.gif',
+
+ minus : imagePath+'/minus.gif',
+
+ minusBottom : imagePath+'/minusbottom.gif',
+
+ nlPlus : imagePath+'/nolines_plus.gif',
+
+ nlMinus : imagePath+'/nolines_minus.gif'
+
+ };
+
+ this.obj = objName;
+
+ this.aNodes = [];
+
+ this.aIndent = [];
+
+ this.root = new Node(-1);
+
+ this.selectedNode = null;
+
+ this.selectedFound = false;
+
+ this.completed = false;
+
+ this.imagePath = imagePath;
+
+};
+
+
+
+// Adds a new node to the node array
+
+dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
+
+ this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);
+
+};
+
+
+
+// Open/close all nodes
+
+dTree.prototype.openAll = function() {
+
+ this.oAll(true);
+
+};
+
+dTree.prototype.closeAll = function() {
+
+ this.oAll(false);
+
+};
+
+
+
+// Outputs the tree to the page
+
+dTree.prototype.toString = function() {
+
+ var str = '<div class="dtree">\n';
+
+ if (document.getElementById) {
+
+ if (this.config.useCookies) this.selectedNode = this.getSelected();
+
+ str += this.addNode(this.root);
+
+ } else str += 'Browser not supported.';
+
+ str += '</div>';
+
+ if (!this.selectedFound) this.selectedNode = null;
+
+ this.completed = true;
+
+ return str;
+
+};
+
+
+
+// Creates the tree structure
+
+dTree.prototype.addNode = function(pNode) {
+
+ var str = '';
+
+ var n=0;
+
+ if (this.config.inOrder) n = pNode._ai;
+
+ for (n; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n].pid == pNode.id) {
+
+ var cn = this.aNodes[n];
+
+ cn._p = pNode;
+
+ cn._ai = n;
+
+ this.setCS(cn);
+
+ if (!cn.target && this.config.target) cn.target = this.config.target;
+
+ if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
+
+ if (!this.config.folderLinks && cn._hc) cn.url = null;
+
+ if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
+
+ cn._is = true;
+
+ this.selectedNode = n;
+
+ this.selectedFound = true;
+
+ }
+
+ str += this.node(cn, n);
+
+ if (cn._ls) break;
+
+ }
+
+ }
+
+ return str;
+
+};
+
+
+
+// Creates the node icon, url and text
+
+dTree.prototype.node = function(node, nodeId) {
+
+ var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
+
+ if (this.config.useIcons) {
+
+ if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
+
+ if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
+
+ if (this.root.id == node.pid) {
+
+ node.icon = this.icon.root;
+
+ node.iconOpen = this.icon.root;
+
+ }
+
+ str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
+
+ }
+
+ if (node.url) {
+
+ str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';
+
+ if (node.title) str += ' title="' + node.title + '"';
+
+ if (node.target) str += ' target="' + node.target + '"';
+
+ if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
+
+ if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
+
+ str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
+
+ str += '>';
+
+ }
+
+ else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
+
+ str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
+
+ str += node.name;
+
+ if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
+
+ str += '</div>';
+
+ if (node._hc) {
+
+ str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
+
+ str += this.addNode(node);
+
+ str += '</div>';
+
+ }
+
+ this.aIndent.pop();
+
+ return str;
+
+};
+
+
+
+// Adds the empty and line icons
+
+dTree.prototype.indent = function(node, nodeId) {
+
+ var str = '';
+
+ if (this.root.id != node.pid) {
+
+ for (var n=0; n<this.aIndent.length; n++)
+
+ str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
+
+ (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
+
+ if (node._hc) {
+
+ str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
+
+ if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
+
+ else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
+
+ str += '" alt="" /></a>';
+
+ } else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
+
+ }
+
+ return str;
+
+};
+
+
+
+// Checks if a node has any children and if it is the last sibling
+
+dTree.prototype.setCS = function(node) {
+
+ var lastId;
+
+ for (var n=0; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n].pid == node.id) node._hc = true;
+
+ if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
+
+ }
+
+ if (lastId==node.id) node._ls = true;
+
+};
+
+
+
+// Returns the selected node
+
+dTree.prototype.getSelected = function() {
+
+ var sn = this.getCookie('cs' + this.obj);
+
+ return (sn) ? sn : null;
+
+};
+
+
+
+// Highlights the selected node
+
+dTree.prototype.s = function(id) {
+
+ if (!this.config.useSelection) return;
+
+ var cn = this.aNodes[id];
+
+ if (cn._hc && !this.config.folderLinks) return;
+
+ if (this.selectedNode != id) {
+
+ if (this.selectedNode || this.selectedNode==0) {
+
+ eOld = document.getElementById("s" + this.obj + this.selectedNode);
+
+ eOld.className = "node";
+
+ }
+
+ eNew = document.getElementById("s" + this.obj + id);
+
+ eNew.className = "nodeSel";
+
+ this.selectedNode = id;
+
+ if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
+
+ }
+
+};
+
+
+
+// Toggle Open or close
+
+dTree.prototype.o = function(id) {
+
+ var cn = this.aNodes[id];
+
+ this.nodeStatus(!cn._io, id, cn._ls);
+
+ cn._io = !cn._io;
+
+ if (this.config.closeSameLevel) this.closeLevel(cn);
+
+ if (this.config.useCookies) this.updateCookie();
+
+};
+
+
+
+// Open or close all nodes
+
+dTree.prototype.oAll = function(status) {
+
+ for (var n=0; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
+
+ this.nodeStatus(status, n, this.aNodes[n]._ls)
+
+ this.aNodes[n]._io = status;
+
+ }
+
+ }
+
+ if (this.config.useCookies) this.updateCookie();
+
+};
+
+
+
+// Opens the tree to a specific node
+
+dTree.prototype.openTo = function(nId, bSelect, bFirst) {
+
+ if (!bFirst) {
+
+ for (var n=0; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n].id == nId) {
+
+ nId=n;
+
+ break;
+
+ }
+
+ }
+
+ }
+
+ var cn=this.aNodes[nId];
+
+ if (cn.pid==this.root.id || !cn._p) return;
+
+ cn._io = true;
+
+ cn._is = bSelect;
+
+ if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
+
+ if (this.completed && bSelect) this.s(cn._ai);
+
+ else if (bSelect) this._sn=cn._ai;
+
+ this.openTo(cn._p._ai, false, true);
+
+};
+
+
+
+// Closes all nodes on the same level as certain node
+
+dTree.prototype.closeLevel = function(node) {
+
+ for (var n=0; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
+
+ this.nodeStatus(false, n, this.aNodes[n]._ls);
+
+ this.aNodes[n]._io = false;
+
+ this.closeAllChildren(this.aNodes[n]);
+
+ }
+
+ }
+
+}
+
+
+
+// Closes all children of a node
+
+dTree.prototype.closeAllChildren = function(node) {
+
+ for (var n=0; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
+
+ if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
+
+ this.aNodes[n]._io = false;
+
+ this.closeAllChildren(this.aNodes[n]);
+
+ }
+
+ }
+
+}
+
+
+
+// Change the status of a node(open or closed)
+
+dTree.prototype.nodeStatus = function(status, id, bottom) {
+
+ eDiv = document.getElementById('d' + this.obj + id);
+
+ eJoin = document.getElementById('j' + this.obj + id);
+
+ if (this.config.useIcons) {
+
+ eIcon = document.getElementById('i' + this.obj + id);
+
+ eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
+
+ }
+
+ eJoin.src = (this.config.useLines)?
+
+ ((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
+
+ ((status)?this.icon.nlMinus:this.icon.nlPlus);
+
+ eDiv.style.display = (status) ? 'block': 'none';
+
+};
+
+
+
+
+
+// [Cookie] Clears a cookie
+
+dTree.prototype.clearCookie = function() {
+
+ var now = new Date();
+
+ var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
+
+ this.setCookie('co'+this.obj, 'cookieValue', yesterday);
+
+ this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
+
+};
+
+
+
+// [Cookie] Sets value in a cookie
+
+dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
+
+ document.cookie =
+
+ escape(cookieName) + '=' + escape(cookieValue)
+
+ + (expires ? '; expires=' + expires.toGMTString() : '')
+
+ + (path ? '; path=' + path : '')
+
+ + (domain ? '; domain=' + domain : '')
+
+ + (secure ? '; secure' : '');
+
+};
+
+
+
+// [Cookie] Gets a value from a cookie
+
+dTree.prototype.getCookie = function(cookieName) {
+
+ var cookieValue = '';
+
+ var posName = document.cookie.indexOf(escape(cookieName) + '=');
+
+ if (posName != -1) {
+
+ var posValue = posName + (escape(cookieName) + '=').length;
+
+ var endPos = document.cookie.indexOf(';', posValue);
+
+ if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
+
+ else cookieValue = unescape(document.cookie.substring(posValue));
+
+ }
+
+ return (cookieValue);
+
+};
+
+
+
+// [Cookie] Returns ids of open nodes as a string
+
+dTree.prototype.updateCookie = function() {
+
+ var str = '';
+
+ for (var n=0; n<this.aNodes.length; n++) {
+
+ if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
+
+ if (str) str += '.';
+
+ str += this.aNodes[n].id;
+
+ }
+
+ }
+
+ this.setCookie('co' + this.obj, str);
+
+};
+
+
+
+// [Cookie] Checks if a node id is in a cookie
+
+dTree.prototype.isOpen = function(id) {
+
+ var aOpen = this.getCookie('co' + this.obj).split('.');
+
+ for (var n=0; n<aOpen.length; n++)
+
+ if (aOpen[n] == id) return true;
+
+ return false;
+
+};
+
+
+
+// If Push and pop is not implemented by the browser
+
+if (!Array.prototype.push) {
+
+ Array.prototype.push = function array_push() {
+
+ for(var i=0;i<arguments.length;i++)
+
+ this[this.length]=arguments[i];
+
+ return this.length;
+
+ }
+
+};
+
+if (!Array.prototype.pop) {
+
+ Array.prototype.pop = function array_pop() {
+
+ lastElement = this[this.length-1];
+
+ this.length = Math.max(this.length-1,0);
+
+ return lastElement;
+
+ }
+
+};
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * left_main.tpl
+ *
+ * Displays an experimental mailbox-tree with dhtml behaviour.
+ * Advanced tree makes uses dTree JavaScript package by Geir Landrö heavily.
+ * See http://www.destroydrop.com/javascripts/tree/
+ *
+ * It only works on browsers which supports css and javascript.
+ *
+ * The following variables are avilable in this template:
+ * $clock - formatted string containing last refresh
+ * $settings - Array containing user perferences needed by this
+ * template. Indexes are as follows:
+ * $settings['imapConnection'] - IMAP connection handle. Needed to
+ * allow plugins to read the mailbox.
+ * $settings['iconThemePath'] - Path to the desired icon theme. If
+ * the user has disabled icons, this will be NULL.
+ * $settings['templateDirectory'] - contains the path to the current
+ * template directory. This may be needed by third
+ * party packages that don't integrate easily.
+ * $settings['unreadNotificationEnabled'] - Boolean TRUE if the user
+ * wants to see unread message count on mailboxes
+ * $settings['unreadNotificationCummulative'] - Boolean TRUE if the
+ * user has enabled cummulative message counts.
+ * $settings['unreadNotificationAllFolders'] - Boolean TRUE if the
+ * user wants to see unread message count on ALL
+ * folders or just the Inbox.
+ * $settings['unreadNotificationDisplayTotal'] - Boolean TRUE if the
+ * user wants to see the total number of messages in
+ * addition to the unread message count.
+ * $settings['collapsableFoldersEnabled'] - Boolean TRUE if the user
+ * has enabled collapsable folders.
+ * $settings['useSpecialFolderColor'] - Boolean TRUE if the use has
+ * chosen to tag "Special" folders in a different color
+ * $settings['messageRecyclingEnabled'] - Boolean TRUE if messages
+ * that get deleted go to the Trash folder. FALSE if
+ * they are permanently deleted.
+ *
+ * $mailboxes - Associative array of current mailbox structure.
+ * Provided so template authors know what they have to
+ * work with when building a custom mailbox tree.
+ * Array contains the following elements:
+ * $a['MailboxName'] = String containing the name of the mailbox
+ * $a['MailboxFullName'] = String containing full IMAP name of mailbox
+ * $a['MessageCount'] = integer of all messages in the mailbox
+ * $a['UnreadCount'] = integer of unseen message in the mailbox
+ * $a['ViewLink'] = array containing elements needed to view the
+ * mailbox. Elements are:
+ * 'Target' = target frame for link
+ * 'URL' = target URL for link
+ * $a['IsRecent'] = boolean TRUE if the mailbox is tagged "recent"
+ * $a['IsSpecial'] = boolean TRUE if the mailbox is tagged "special"
+ * $a['IsRoot'] = boolean TRUE if the mailbox is the root mailbox
+ * $a['IsNoSelect'] = boolean TRUE if the mailbox is tagged "noselect"
+ * $a['IsCollapsed'] = boolean TRUE if the mailbox is currently collapsed
+ * $a['CollapseLink'] = array containg elements needed to expand/collapse
+ * the mailbox. Elements are:
+ * 'Target' = target frame for link
+ * 'URL' = target URL for link
+ * 'Icon' = the icon to use, based on user prefs
+ * $a['ChildBoxes'] = array containing this same data structure for
+ * each child folder/mailbox of the current
+ * mailbox.
+ * $a['CummulativeMessageCount'] = integer of total messages in all
+ * folders in this mailbox, exlcuding
+ * trash folders.
+ * $a['CummulativeUnreadCount'] = integer of total unseen messages
+ * in all folders in this mailbox,
+ * excluding trash folders.
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ * @author Steve Brown
+ */
+
+// include required files
+include_once(SM_PATH . 'templates/util_global.php');
+
+/*
+ * Recursively parse the mailbox structure to build the navigation tree.
+ *
+ * @param array $box Array containing mailbox data
+ * @param array $settings Array containing perferences, etc, passed to template
+ * @param integer $indent_factor Counter used to control indent spacing
+ * @since 1.5.2
+ * @author Steve Brown
+ */
+function buildMailboxTree ($box, $settings, $parent_node=-1) {
+ static $counter;
+
+ // stop condition
+ if (empty($box)) {
+ return '';
+ }
+
+ $image_path = $settings['templateDirectory'] . 'images/';
+ $out = '';
+ if ($box['IsRoot']) {
+ // Determine the path to the correct images
+ $out .= 'mailboxes = new dTree("mailboxes", "'.$image_path.'");'."\n";
+ $out .= 'mailboxes.config.inOrder = true;'."\n";
+ $counter = -1;
+ } else {
+ $counter++;
+ $name = $box['MailboxName'];
+ $pre = '<span style="white-space: nowrap;">';
+ $end = '';
+
+ // Get unseeen/total message info if needed
+ $unseen_str = '';
+ if ($settings['unreadNotificationEnabled']) {
+ // We only display the unread count if we on the Inbox or we are told
+ // to display it on all folders AND there is more than 1 unread message
+ if ( $settings['unreadNotificationAllFolders'] ||
+ (!$settings['unreadNotificationAllFolders'] && strtolower($box['MailboxFullName'])=='inbox')
+ ) {
+ $unseen = $settings['unreadNotificationCummulative'] ?
+ $box['CummulativeUnreadCount'] :
+ $box['UnreadCount'];
+
+ if ($unseen > 0) {
+ $unseen_str = $unseen;
+
+ // Add the total messages if desired
+ if ($settings['unreadNotificationDisplayTotal']) {
+ $unseen_str .= '/' . ($settings['unreadNotificationCummulative'] ?
+ $box['CummulativeMessageCount'] :
+ $box['MessageCount']);
+ }
+
+ $unseen_str = '<span class="'.
+ ($box['IsRecent'] ? 'leftrecent' : 'leftunseen') .
+ '">' . $unseen_str .
+ '</span>';
+ }
+ }
+ }
+
+ /**
+ * Add folder icon.
+ */
+ $img = '';
+ $img_open = '';
+ switch (true) {
+ case $box['IsInbox']:
+ $img = $image_path . 'base.gif';
+ $img_open = $image_path . 'base.gif';
+ break;
+ case $box['IsTrash']:
+ $img = $image_path . 'trash.gif';
+ $img_open = $image_path . 'trash.gif';
+ break;
+ case $box['IsNoSelect']:
+ case $box['IsNoInferiors']:
+ $img = $image_path . 'page.gif';
+ $img_open = $image_path . 'page.gif';
+ break;
+ default:
+ $img = $image_path . 'folder.gif';
+ $img_open = $image_path . 'folderopen.gif';
+ break;
+ }
+
+ $display_folder = true;
+ if (!$settings['messageRecyclingEnabled'] && $box['IsTrash']) {
+ $display_folder = false;
+ }
+
+ if($settings['messageRecyclingEnabled'] && $box['IsTrash']) {
+ // Boxes with unread messages should be emphasized
+ if ($box['UnreadCount'] > 0) {
+ $pre .= '<em>';
+ $end .= '</em>';
+ }
+
+ // Print unread info
+ if ($box['UnreadCount'] > 0) {
+ if (!empty($unseen_str)) {
+ $end .= ' <small>('.$unseen_str.')</small>';
+ }
+ }
+ } else {
+ // Add a few other things for all other folders...
+ if (!$box['IsNoSelect']) {
+ // Boxes with unread messages should be emphasized
+ if ($box['UnreadCount'] > 0) {
+ $pre .= '<em>';
+ $end .= '</em>';
+ }
+ }
+
+ // Display unread info...
+ if (!empty($unseen_str)) {
+ $end .= ' <small>('.$unseen_str.')</small>';
+ }
+ }
+
+ $span = '';
+ $spanend = '';
+ if ($settings['useSpecialFolderColor'] && $box['IsSpecial']) {
+ $span = '<span class="leftspecial">';
+ $spanend = '</span>';
+ } elseif ( $box['IsNoSelect'] ) {
+ $span = '<span class="leftnoselect">';
+ $spanend = '</span>';
+ }
+
+ /**
+ * NOTE: Plugins would horribly break this advanced tree, so we are
+ * going to skip that part altogether.
+ */
+
+ $name = str_replace(
+ array(' ','<','>'),
+ array(' ','<','>'),
+ $box['MailboxName']);
+ $title = $name;
+
+ if ($box['IsNoSelect']) {
+ $url = '';
+ $target = '';
+ } else {
+ $url = $box['ViewLink']['URL'];
+ $target = $box['ViewLink']['Target'];
+ $name = $span . $pre . $name . $end . $spanend;
+ }
+
+ if ($display_folder) {
+ $out .= 'mailboxes.add('.$counter.', '.$parent_node.', ' .
+ '"'.addslashes($name).'", "'.$url.'", "'.$title.'", ' .
+ '"'.$target.'", ' .
+ '"'.$img.'", ' .
+ '"'.$img_open.'"' .
+ ');'."\n";
+ }
+ }
+
+ $parent_node = $counter;
+ for ($i = 0; $i<sizeof($box['ChildBoxes']); $i++) {
+ $out .= buildMailboxTree($box['ChildBoxes'][$i], $settings, $parent_node);
+ }
+
+ if ($box['IsRoot']) {
+ $out .= 'document.write(mailboxes);'."\n";
+ }
+
+ return $out;
+}
+
+/* retrieve the template vars */
+extract($t);
+
+?>
+<body class="sqm_leftMain">
+<script type="text/javascript">
+<!--
+/**
+ * Advanced tree makes uses dTree JavaScript package by Geir Landrö heavily.
+ * See http://www.destroydrop.com/javascripts/tree/
+ *
+ * |---------------------------------------------------|
+ * | dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+ * |---------------------------------------------------|
+ * | Copyright (c) 2002-2003 Geir Landrö |
+ * | |
+ * | This script can be used freely as long as all |
+ * | copyright messages are intact. |
+ * | |
+ * | Updated: 17.04.2003 |
+ * |---------------------------------------------------|
+ **/
+//-->
+</script>
+<div class="sqm_leftMain">
+<?php do_hook('left_main_before'); ?>
+<div class="dtree">
+<table class="sqm_wrapperTable" cellspacing="0">
+ <tr>
+ <td>
+ <table cellspacing="0">
+ <tr>
+ <td style="text-align:center">
+ <span class="sqm_folderHeader"><?php echo _("Folders"); ?></span><br />
+ <span class="sqm_clock"><?php echo $clock; ?></span>
+ <span class="sqm_refreshButton"><small>[<a href="../src/left_main.php" target="left"><?php echo _("Check mail"); ?></a>]</small></span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<p>
+<a href="javascript:mailboxes.openAll()">Open All</a>
+ |
+<a href="javascript:mailboxes.closeAll()">Close All</a>
+<?php
+if ($settings['messageRecyclingEnabled']) {
+ echo '<br />';
+ echo '<a href="empty_trash.php">Purge Trash</a>';
+}
+?>
+</p>
+<script type="text/javascript">
+<!--
+<?php echo buildMailboxTree($mailboxes, $settings); ?>
+-->
+</script>
+</div>
+<?php do_hook('left_main_after'); ?>
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * SquirrelMail CSS template
+ *
+ * Template is used by style.php script to generate css file used by
+ * SquirrelMail scripts.
+ *
+ * Available constants
+ *
+ * Color codes used by selected theme:
+ * <ul>
+ * <li>SQM_BACKGROUND - background color
+ * <li>SQM_BACKGROUND_LEFT - background of folder tree
+ * <li>SQM_TEXT_STANDARD - text color
+ * <li>SQM_TEXT_STANDARD_LEFT - text color of folder tree
+ * <li>SQM_LINK - color of links
+ * <li>SQM_LINK_LEFT - color of links in folder tree
+ * <li>SQM_TEXT_SPECIAL - color of special folder links in folder tree
+ * <li>todo: other constants should be documented here
+ * </ul>
+ *
+ * Optional template variables
+ * <ul>
+ * <li>fontfamily - string with list of fonts used by selected style.
+ * <li>fontsize - integer with selected font size value.
+ * </ul>
+ * Variables are set to empty string, when value is not set.
+ *
+ * @copyright © 2005-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/* retrieve the template vars */
+extract($t);
+
+?>
+/* older css template */
+body, td, th, dd, dt, h1, h2, h3, h4, h5, h6, p, ol, ul, li {
+<?php
+if($fontfamily) echo ' font-family: '.$fontfamily.";\n";
+?>
+}
+body, small {
+<?php
+if($fontsize) echo ' font-size: '.($fontsize-2)."pt;\n";
+?>
+}
+td, th {
+<?php
+if($fontsize) echo ' font-size: '.$fontsize."pt;\n";
+?>
+}
+textarea, pre {
+font-family: monospace;
+<?php
+if($fontsize) echo ' font-size: '.($fontsize-1)."pt;\n";
+?>
+}
+
+/* page body formatting */
+body {
+ color: <?php echo SQM_TEXT_STANDARD; ?>;
+ background-color: <?php echo SQM_BACKGROUND; ?>;
+}
+body.sqm_leftMain {
+ color: <?php echo SQM_TEXT_STANDARD_LEFT; ?>;
+ background-color: <?php echo SQM_BACKGROUND_LEFT; ?>;
+ text-align: left;
+}
+
+/* right links */
+a:link, a:visited, a:hover, a:active {
+ color: <?php echo SQM_LINK; ?>;
+}
+
+/* left links */
+.sqm_leftMain a:link, .sqm_leftMain a:visited, .sqm_leftMain a:hover, .sqm_leftMain a:active {
+ color: <?php echo SQM_LINK_LEFT; ?>;
+}
+.leftunseen, .leftspecial, .leftspecial a:link, .leftspecial a:visited, .leftspecial a:hover, .leftspecial a:active {
+ color: <?php echo SQM_TEXT_SPECIAL; ?>;
+}
+.leftrecent {
+ font-weight:bold;
+}
+.leftnoselect a:link, .leftnoselect a:visited, .leftnoselect a:hover, .leftnoselect a:active {
+ color: <?php echo SQM_TEXT_HIGHLIGHT; ?>;
+}
+
+/* highlighted texts */
+.highlight {
+ color: <?php echo SQM_TEXT_HIGHLIGHT; ?>;
+}
+
+/* left_main.tpl definitions */
+.sqm_wrapperTable {
+ border:0;
+ padding:0;
+ margin-left:auto;
+ margin-right:auto;
+ border-spacing:0;
+ width:99%
+ text-align:center;
+}
+sqm_leftMain table {
+ border:0;
+ padding:0;
+ margin:0;
+ border-spacing:0;
+ margin-left:auto;
+ margin-right:auto;
+}
+.sqm_folderHeader {
+ font-size:18px;
+ font-weight:bold;
+ text-align:center;
+}
+.sqm_clock {
+}
+.sqm_lastRefreshTime {
+ white-space: nowrap;
+}
+.sqm_refreshButton {
+}
+
+.dtree {
+ font-size:11px;
+ white-space:nowrap;
+}
+.dtree p {
+ margin-top:12px;
+ margin-bottom:2px;
+ padding-bottom:4px;
+ text-align:center;
+ overflow: hidden;
+}
+.dtree a:hover {
+ text-decoration: underline;
+}
+.dtree a {
+ text-decoration:none;
+}
+.dtree img {
+ border:0;
+ vertical-align: middle;
+}
+.dtree a.node, .dtree a.nodeSel {
+ white-space: nowrap;
+ padding: 1px 2px 1px 2px;
+}
+.dtree a.node:hover, .dtree a.nodeSel:hover {
+ color: <?php echo SQM_TEXT_HIGHLIGHT; ?>;
+}
+.dtree a.nodeSel {
+ color: <?php echo SQM_TEXT_HIGHLIGHT; ?>;
+}
+.dtree .clip {
+ overflow: hidden;
+}
+
+/* formating of error template */
+.thead_caption {
+ font-weight: bold;
+ text-align: center;
+}
+
+.error_list {
+}
+.error_table {
+ color: <?php echo $color[14]; ?>;
+ border: 2px solid <?php echo $color[0]; ?>;
+ background-color: <?php echo $color[3]; ?>;
+ width: 100%;
+}
+.error_thead {
+ background-color: <?php echo $color[10]; ?>;
+}
+.error_thead_caption {
+ background-color: <?php echo $color[10]; ?>;
+}
+.error_row {
+ color: <?php echo $color[14]; ?>;
+}
+.error_val {
+ color: <?php echo $color[8]; ?>;
+ width: 80%;
+ border: 2px solid <?php echo $color[0]; ?>;
+
+}
+.error_key {
+ width: 20%;
+ border: 2px solid <?php echo $color[0]; ?>;
+ color: <?php echo $color[14]; ?>;
+ font-weight: bold;
+ font-style: italic;
+ background-color: <?php echo $color[0]; ?>;
+}
+
+/* form fields */
+input.sqmtextfield{
+}
+input.sqmpwfield {
+}
+input.sqmcheckbox {
+}
+input.sqmradiobox {
+}
+input.sqmhiddenfield {
+}
+input.sqmsubmitfield {
+}
+input.sqmresetfield {
+}
+input.sqmtextarea {
+}
+
+/* basic definitions */
+.table_empty {
+ width:100%;
+ border:0;
+ margin:0;
+ padding:0;
+ border-spacing:0;
+}
+
+.table_standard {
+ width:100%;
+ border:1px solid <?php echo $color[0]; ?>;
+ padding:0;
+ margin:0;
+ border-spacing:0;
+}
+
+em {
+ font-weight:bold;
+ font-style:normal;
+}
+
+small {
+ font-size:80%;
+}
+img {
+ border:0;
+}
+
+/* login.tpl definitions */
+#sqm_login table {
+ border:0;
+ margin:0;
+ padding:0;
+ border-spacing:0;
+ margin-left:auto;
+ margin-right:auto;
+}
+#sqm_login td {
+ padding:2px;
+}
+
+.sqm_loginImage {
+ margin-left:auto;
+ margin-right:auto;
+ padding:2px;
+}
+.sqm_loginTop {
+ text-align:center;
+ font-size:80%;
+}
+.sqm_loginOrgName {
+ font-weight:bold;
+ text-align:center;
+ background: <?php echo $color[0]; ?>;
+ width:350px;
+ border:0;
+}
+.sqm_loginFieldName {
+ text-align:right;
+ width:30%;
+}
+.sqm_loginFieldInput {
+ text-align:left;
+}
+.sqm_loginSubmit {
+ text-align:center;
+}
+
+/* page_header.tpl definitions */
+.sqm_currentFolder {
+ background: <?php echo $color[9]; ?>;
+ padding:2px;
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+.sqm_headerSignout {
+ background: <?php echo $color[9]; ?>;
+ padding:2px;
+ text-align: <?php echo SQM_ALIGN_RIGHT; ?>;
+ font-weight:bold;
+}
+.sqm_topNavigation {
+ padding:2px;
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+.sqm_providerInfo {
+ padding:2px;
+ text-align: <?php echo SQM_ALIGN_RIGHT; ?>;
+}
+
+/* message_list.tpl definitions */
+.table_messageListWrapper {
+ width:100%;
+ padding:0;
+ border-spacing:0;
+ border:0;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+ background: <?php echo $color[9]; ?>;
+}
+
+.table_messageList {
+ width:100%;
+ padding:0;
+ border-spacing:0;
+ border:0;
+ text-align:center;
+ margin-left:auto;
+ margin-right:auto;
+ background: <?php echo $color[5]; ?>;
+}
+
+.table_messageList a {
+ white-space:nowrap;
+}
+
+.table_messageList tr.headerRow {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+ white-space:nowrap;
+ font-weight:bold;
+}
+.table_messageList td.spacer {
+ height:1px;
+ background: <?php echo $color[0]; ?>;
+}
+
+.table_messageList tr {
+ vertical-align:top;
+}
+.table_messageList tr.even {
+ background: <?php echo $color[12]; ?>;
+}
+.table_messageList tr.odd {
+ background: <?php echo $color[4]; ?>;
+}
+.table_messageList tr.mouse_over {
+ background: <?php echo $color[5]; ?>;
+}
+.table_messageList tr.clicked {
+ background: <?php echo (!empty($color[16])) ? $color[16] : $color[2]; ?>;
+}
+
+.table_messageList td {
+ white-space:nowrap;
+}
+.table_messageList td.col_check {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+.table_messageList td.col_subject {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+.table_messageList td.col_flags {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+.table_messageList td.col_date {
+ text-align:center;
+}
+.table_messageList td.col_text {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+
+.unread {
+ font-weight:bold;
+}
+.deleted {
+ color: <?php echo $color[9]; ?>;
+}
+.flagged {
+ color: <?php echo $color[2]; ?>;
+}
+.high_priority {
+ color: <?php echo $color[1]; ?>;
+}
+.low_priority {
+ color: <?php echo $color[8]; ?>;
+}
+
+.col_checked {
+}
+
+.links_paginator {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+
+.message_count {
+ text-align:right;
+ font-size:8pt;
+}
+
+.message_list_controls {
+ background: <?php echo $color[0]; ?>;
+}
+
+.message_control_button {
+ padding:0px;
+ margin:0px;
+}
+.message_control_buttons {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+ font-size:10px; /* replaces <small> tags to allow greater control of fonts w/ using an id. */
+}
+.message_control_delete {
+ text-align: <?php echo SQM_ALIGN_RIGHT; ?>;
+ font-size:10px; /* replaces <small> tags to allow greater control of fonts w/ using an id. */
+}
+.message_control_move {
+ text-align: <?php echo SQM_ALIGN_RIGHT; ?>;
+ font-size:10px; /* replaces <small> tags to allow greater control of fonts w/ using an id. */
+}
+
+.spacer {
+ height:5px;
+ background: <?php echo $color[4]; ?>;
+}
+
+
--- /dev/null
+<?php
+/**
+ * Provides some basic configuration options to the template engine
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/**
+ * Each template provided by this set should be listed in this array. If a
+ * template is requested that is not listed here, the default template will be
+ * displayed. The templates listed below must be in the same directory as
+ * this file, e.g. the template root directory.
+ */
+$templates_provided = array (
+ 'left_main.tpl',
+ 'stylesheet.tpl'
+ );
+
+/**
+ * Required Javascript files for this template set. If a JS file is listed
+ * here, but not listed in the provided js files below, SquirrelMail will use
+ * the file by the same name in the default template directory.
+ */
+$required_js_files = array (
+ 'default.js',
+ 'dtree.js'
+ );
+
+/**
+ * Any aditional Javascript files that are needed by this template should be
+ * listed in this array. Javascript files must be in a directory called "js/"
+ * within the template root directory.
+ */
+$provided_js_files = array (
+ 'dtree.js'
+ );
+?>
\ No newline at end of file