All tree graphics are now handled via CSS
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 7 Aug 2009 20:21:38 +0000 (14:21 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 7 Aug 2009 20:21:38 +0000 (14:21 -0600)
18 files changed:
imp/folders.php
imp/js/DimpBase.js
imp/lib/Imap/Thread.php
imp/themes/graphics/tree/minus.png [new file with mode: 0644]
imp/themes/graphics/tree/minusbottom.png [new file with mode: 0644]
imp/themes/graphics/tree/minustop.png [new file with mode: 0644]
imp/themes/graphics/tree/plus.png [new file with mode: 0644]
imp/themes/graphics/tree/plusbottom.png [new file with mode: 0644]
imp/themes/graphics/tree/plustop.png [new file with mode: 0644]
imp/themes/graphics/tree/rev-minus.png [new file with mode: 0644]
imp/themes/graphics/tree/rev-minusbottom.png [new file with mode: 0644]
imp/themes/graphics/tree/rev-minustop.png [new file with mode: 0644]
imp/themes/graphics/tree/rev-plus.png [new file with mode: 0644]
imp/themes/graphics/tree/rev-plusbottom.png [new file with mode: 0644]
imp/themes/graphics/tree/rev-plustop.png [new file with mode: 0644]
imp/themes/ie6_or_less.css
imp/themes/ie7.css
imp/themes/screen.css

index 57739a9..78981d8 100644 (file)
 /**
  * Utility function to return a url for the various images.
  */
-function _image($name, $alt, $type)
+function _image($name, $alt)
 {
     static $cache = array();
 
-    $val = ($type == 'folder') ? $name['value'] : $name;
-    if (!empty($cache[$type][$val])) {
-        return $cache[$type][$val];
+    $val = $name['value'];
+    if (!empty($cache[$val])) {
+        return $cache[$val];
     }
 
-    if ($type == 'folder') {
-        $cache[$type][$val] = Horde::img($name['icon'], $name['alt'], null, $name['icondir']);
-    } else {
-        $cache[$type][$val] = Horde::img('tree/' . $name, $alt, null, $GLOBALS['registry']->getImageDir('horde'));
-    }
+    $cache[$val] = Horde::img($name['icon'], $name['alt'], null, $name['icondir']);
 
-    return $cache[$type][$val];
+    return $cache[$val];
 }
 
 require_once dirname(__FILE__) . '/lib/base.php';
@@ -467,45 +463,55 @@ foreach ($raw_rows as $val) {
         $dir = Horde_Util::addParameter($folders_url, 'folder', $val['value']);
         if ($imaptree->isOpen($val['base_elt'])) {
             $dir = Horde_Util::addParameter($dir, 'actionID', 'collapse_folder');
-            if ($val['value'] == 'INBOX') {
-                $minus_img = 'minustop.png';
+            $alt = _("Collapse Folder");
+            if (empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) {
+                $tree_img = ($val['value'] == 'INBOX')
+                    ? 9
+                    : ($val['peek'] ? 10 : 11);
             } else {
-                $minus_img = ($val['peek']) ? 'minus.png' : 'minusbottom.png';
-            }
-            if (!empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) {
-                $minus_img = 'rev-' . $minus_img;
+                $tree_img = ($val['value'] == 'INBOX')
+                    ? 12
+                    : ($val['peek'] ? 13 : 14);
             }
-            $dir = Horde::link($dir, _("Collapse Folder")) . _image($minus_img, _("Collapse"), 'tree') . "</a>$dir2";
         } else {
             $dir = Horde_Util::addParameter($dir, 'actionID', 'expand_folder');
-            if ($val['value'] == 'INBOX') {
-                $plus_img = 'plustop.png';
+            $alt = _("Expand Folder");
+            if (empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) {
+                $tree_img = ($val['value'] == 'INBOX')
+                    ? 15
+                    : ($val['peek'] ? 16 : 17);
             } else {
-                $plus_img = ($val['peek']) ? 'plus.png' : 'plusbottom.png';
+                $tree_img = ($val['value'] == 'INBOX')
+                    ? 18
+                    : ($val['peek'] ? 19 : 20);
             }
-            if (!empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) {
-                $plus_img = 'rev-' . $plus_img;
-            }
-            $dir = Horde::link($dir, _("Expand Folder")) . _image($plus_img, _("Expand"), 'tree') . "</a>$dir2";
         }
+        $dir = Horde::link($dir, $alt) . '<span class="treeImg treeImg' . $tree_img . '"></span></a>' . $dir2;
     } else {
-        if ($val['value'] == 'INBOX') {
-            $join_img = ($val['peek']) ? 'joinbottom-down.png' : 'blank.png';
+        if (($val['value'] == 'INBOX') && !$val['peek']) {
+            $dir = '<span class="treeImg"></span>' . $dir2;
         } else {
-            $join_img = ($val['peek']) ? 'join.png' : 'joinbottom.png';
-        }
-        if (!empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) {
-            $join_img = 'rev-' . $join_img;
+            if (empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) {
+                $tree_img = ($val['value'] == 'INBOX')
+                    ? 3
+                    : ($val['peek'] ? 2 : 4);
+            } else {
+                $tree_img = ($val['value'] == 'INBOX')
+                    ? 7
+                    : ($val['peek'] ? 6 : 8);
+            }
+            $dir = '<span class="treeImg treeImg' . $tree_img . '"></span>' . $dir2;
         }
-        $dir = _image($join_img, '', 'tree') . $dir2;
     }
 
     $line = '';
     $morembox[$val['level']] = $val['peek'];
     for ($i = 0; $i < $val['level']; $i++) {
-        $line .= _image(($morembox[$i]) ?
-            (empty($GLOBALS['nls']['rtl'][$GLOBALS['language']]) ? 'line.png' : 'rev-line.png') :
-            'blank.png', '', 'tree');
+        if ($morembox[$i]) {
+            $line .= '<span class="treeImg treeImg' . (empty($GLOBALS['nls']['rtl'][$GLOBALS['language']]) ? 1 : 5) . '"></span>';
+        } else {
+            $line .= '<span class="treeImg"></span>';
+        }
     }
     $val['line'] = $line . $dir;
     $rows[] = $val;
index 2235771..059f05e 100644 (file)
@@ -441,7 +441,7 @@ var DimpBase = {
                         $R(0, u.length, true).each(function(i) {
                             var c = u.charAt(i);
                             if (!this.tcache[c]) {
-                                this.tcache[c] = '<span class="threadImg threadImg' + c + '"></span>';
+                                this.tcache[c] = '<span class="treeImg treeImg' + c + '"></span>';
                             }
                             row.subjectdata += this.tcache[c];
                         }, this);
index 6dba5f9..b783814 100644 (file)
@@ -126,7 +126,7 @@ class IMP_Imap_Thread
         foreach ($this->getThreadTreeOb($indices, $sortdir) as $k => $v) {
             $tree[$k] = '';
             for ($i = 0, $length = strlen($v); $i < $length; ++$i) {
-                $tree[$k] .= '<span class="threadImg threadImg' . $v[$i] . '"></span>';
+                $tree[$k] .= '<span class="treeImg treeImg' . $v[$i] . '"></span>';
             }
         }
         return $tree;
diff --git a/imp/themes/graphics/tree/minus.png b/imp/themes/graphics/tree/minus.png
new file mode 100644 (file)
index 0000000..4bb82eb
Binary files /dev/null and b/imp/themes/graphics/tree/minus.png differ
diff --git a/imp/themes/graphics/tree/minusbottom.png b/imp/themes/graphics/tree/minusbottom.png
new file mode 100644 (file)
index 0000000..8d84040
Binary files /dev/null and b/imp/themes/graphics/tree/minusbottom.png differ
diff --git a/imp/themes/graphics/tree/minustop.png b/imp/themes/graphics/tree/minustop.png
new file mode 100644 (file)
index 0000000..26a05cd
Binary files /dev/null and b/imp/themes/graphics/tree/minustop.png differ
diff --git a/imp/themes/graphics/tree/plus.png b/imp/themes/graphics/tree/plus.png
new file mode 100644 (file)
index 0000000..9783e5b
Binary files /dev/null and b/imp/themes/graphics/tree/plus.png differ
diff --git a/imp/themes/graphics/tree/plusbottom.png b/imp/themes/graphics/tree/plusbottom.png
new file mode 100644 (file)
index 0000000..fc36b6a
Binary files /dev/null and b/imp/themes/graphics/tree/plusbottom.png differ
diff --git a/imp/themes/graphics/tree/plustop.png b/imp/themes/graphics/tree/plustop.png
new file mode 100644 (file)
index 0000000..e113aff
Binary files /dev/null and b/imp/themes/graphics/tree/plustop.png differ
diff --git a/imp/themes/graphics/tree/rev-minus.png b/imp/themes/graphics/tree/rev-minus.png
new file mode 100644 (file)
index 0000000..fdce620
Binary files /dev/null and b/imp/themes/graphics/tree/rev-minus.png differ
diff --git a/imp/themes/graphics/tree/rev-minusbottom.png b/imp/themes/graphics/tree/rev-minusbottom.png
new file mode 100644 (file)
index 0000000..48d3a97
Binary files /dev/null and b/imp/themes/graphics/tree/rev-minusbottom.png differ
diff --git a/imp/themes/graphics/tree/rev-minustop.png b/imp/themes/graphics/tree/rev-minustop.png
new file mode 100644 (file)
index 0000000..9e47cc1
Binary files /dev/null and b/imp/themes/graphics/tree/rev-minustop.png differ
diff --git a/imp/themes/graphics/tree/rev-plus.png b/imp/themes/graphics/tree/rev-plus.png
new file mode 100644 (file)
index 0000000..7530dcf
Binary files /dev/null and b/imp/themes/graphics/tree/rev-plus.png differ
diff --git a/imp/themes/graphics/tree/rev-plusbottom.png b/imp/themes/graphics/tree/rev-plusbottom.png
new file mode 100644 (file)
index 0000000..a228918
Binary files /dev/null and b/imp/themes/graphics/tree/rev-plusbottom.png differ
diff --git a/imp/themes/graphics/tree/rev-plustop.png b/imp/themes/graphics/tree/rev-plustop.png
new file mode 100644 (file)
index 0000000..6802762
Binary files /dev/null and b/imp/themes/graphics/tree/rev-plustop.png differ
index 06b9b16..923bc91 100644 (file)
@@ -8,7 +8,7 @@
 }
 
 /* Fixes broken inline-block. */
-div.msgflags, span.spellcheckPopdownImg, span.threadImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .stripAtc, span.mimePartInfo {
+div.msgflags, span.spellcheckPopdownImg, span.treeImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .stripAtc, span.mimePartInfo {
     zoom: 1;
     *display: inline;
 }
index 7818845..6126d37 100644 (file)
@@ -8,7 +8,7 @@
 }
 
 /* Fixes broken inline-block. */
-div.msgflags, span.spellcheckPopdownImg, span.threadImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .stripAtc, span.mimePartInfo {
+div.msgflags, span.spellcheckPopdownImg, span.treeImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .stripAtc, span.mimePartInfo {
     zoom: 1;
     *display: inline;
 }
index 33ced98..9bec46f 100644 (file)
@@ -485,8 +485,8 @@ ul.nav-audio {
     text-decoration: underline;
 }
 
-/* Thread images */
-span.threadImg {
+/* Thread/folder images */
+span.treeImg {
     height: 20px;
     width: 20px;
     display: -moz-inline-stack;
@@ -494,30 +494,66 @@ span.threadImg {
     vertical-align: middle;
 }
 
-span.threadImg1 {
+span.treeImg1 {
     background-image: url("graphics/tree/line.png");
 }
-span.threadImg2 {
+span.treeImg2 {
     background-image: url("graphics/tree/join.png");
 }
-span.threadImg3 {
+span.treeImg3 {
     background-image: url("graphics/tree/joinbottom-down.png");
 }
-span.threadImg4 {
+span.treeImg4 {
     background-image: url("graphics/tree/joinbottom.png");
 }
-span.threadImg5 {
+span.treeImg5 {
     background-image: url("graphics/tree/rev-line.png");
 }
-span.threadImg6 {
+span.treeImg6 {
     background-image: url("graphics/tree/rev-join.png");
 }
-span.threadImg7 {
+span.treeImg7 {
     background-image: url("graphics/tree/rev-joinbottom-down.png");
 }
-span.threadImg8 {
+span.treeImg8 {
     background-image: url("graphics/tree/rev-joinbottom.png");
 }
+span.treeImg9 {
+    background-image: url("graphics/tree/minustop.png");
+}
+span.treeImg10 {
+    background-image: url("graphics/tree/minus.png");
+}
+span.treeImg11 {
+    background-image: url("graphics/tree/minusbottom.png");
+}
+span.treeImg12 {
+    background-image: url("graphics/tree/rev-minustop.png");
+}
+span.treeImg13 {
+    background-image: url("graphics/tree/rev-minus.png");
+}
+span.treeImg14 {
+    background-image: url("graphics/tree/rev-minusbottom.png");
+}
+span.treeImg15 {
+    background-image: url("graphics/tree/plustop.png");
+}
+span.treeImg16 {
+    background-image: url("graphics/tree/plus.png");
+}
+span.treeImg17 {
+    background-image: url("graphics/tree/plusbottom.png");
+}
+span.treeImg18 {
+    background-image: url("graphics/tree/rev-plustop.png");
+}
+span.treeImg19 {
+    background-image: url("graphics/tree/rev-plus.png");
+}
+span.treeImg20 {
+    background-image: url("graphics/tree/rev-plusbottom.png");
+}
 
 /* Loading graphic */
 span.loadingImg {