From dbcbdd697ef195471524bbfb755522697c2b9f95 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 7 Aug 2009 14:21:38 -0600 Subject: [PATCH] All tree graphics are now handled via CSS --- imp/folders.php | 74 +++++++++++++++------------ imp/js/DimpBase.js | 2 +- imp/lib/Imap/Thread.php | 2 +- imp/themes/graphics/tree/minus.png | Bin 0 -> 211 bytes imp/themes/graphics/tree/minusbottom.png | Bin 0 -> 208 bytes imp/themes/graphics/tree/minustop.png | Bin 0 -> 212 bytes imp/themes/graphics/tree/plus.png | Bin 0 -> 213 bytes imp/themes/graphics/tree/plusbottom.png | Bin 0 -> 214 bytes imp/themes/graphics/tree/plustop.png | Bin 0 -> 215 bytes imp/themes/graphics/tree/rev-minus.png | Bin 0 -> 133 bytes imp/themes/graphics/tree/rev-minusbottom.png | Bin 0 -> 134 bytes imp/themes/graphics/tree/rev-minustop.png | Bin 0 -> 130 bytes imp/themes/graphics/tree/rev-plus.png | Bin 0 -> 137 bytes imp/themes/graphics/tree/rev-plusbottom.png | Bin 0 -> 139 bytes imp/themes/graphics/tree/rev-plustop.png | Bin 0 -> 135 bytes imp/themes/ie6_or_less.css | 2 +- imp/themes/ie7.css | 2 +- imp/themes/screen.css | 56 ++++++++++++++++---- 18 files changed, 90 insertions(+), 48 deletions(-) create mode 100644 imp/themes/graphics/tree/minus.png create mode 100644 imp/themes/graphics/tree/minusbottom.png create mode 100644 imp/themes/graphics/tree/minustop.png create mode 100644 imp/themes/graphics/tree/plus.png create mode 100644 imp/themes/graphics/tree/plusbottom.png create mode 100644 imp/themes/graphics/tree/plustop.png create mode 100644 imp/themes/graphics/tree/rev-minus.png create mode 100644 imp/themes/graphics/tree/rev-minusbottom.png create mode 100644 imp/themes/graphics/tree/rev-minustop.png create mode 100644 imp/themes/graphics/tree/rev-plus.png create mode 100644 imp/themes/graphics/tree/rev-plusbottom.png create mode 100644 imp/themes/graphics/tree/rev-plustop.png diff --git a/imp/folders.php b/imp/folders.php index 57739a9c5..78981d8bc 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -16,22 +16,18 @@ /** * 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') . "$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') . "$dir2"; } + $dir = Horde::link($dir, $alt) . '' . $dir2; } else { - if ($val['value'] == 'INBOX') { - $join_img = ($val['peek']) ? 'joinbottom-down.png' : 'blank.png'; + if (($val['value'] == 'INBOX') && !$val['peek']) { + $dir = '' . $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 = '' . $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 .= ''; + } else { + $line .= ''; + } } $val['line'] = $line . $dir; $rows[] = $val; diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 223577126..059f05ef9 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -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] = ''; + this.tcache[c] = ''; } row.subjectdata += this.tcache[c]; }, this); diff --git a/imp/lib/Imap/Thread.php b/imp/lib/Imap/Thread.php index 6dba5f9c9..b783814ea 100644 --- a/imp/lib/Imap/Thread.php +++ b/imp/lib/Imap/Thread.php @@ -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] .= ''; + $tree[$k] .= ''; } } return $tree; diff --git a/imp/themes/graphics/tree/minus.png b/imp/themes/graphics/tree/minus.png new file mode 100644 index 0000000000000000000000000000000000000000..4bb82ebbea936f437da70dfc80109da1f747e0af GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf%)r3d{@^GFki(Mh=OQOYu8I4U$VqC zq9iy!t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5odr;i0gz26M)SB|NnO~_$vZg z%q2m7!TbfRNaJ#16vvr z6B8I_uzd_)>-2y%MxZKHOiRA0kzwi;CZ`;gU0w|TlN|HRY+LpN4P)?h^>bP0l+XkK Dc?m*V literal 0 HcmV?d00001 diff --git a/imp/themes/graphics/tree/minusbottom.png b/imp/themes/graphics/tree/minusbottom.png new file mode 100644 index 0000000000000000000000000000000000000000..8d840406698d0d85389cb7868d30302007a1680e GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf%)r3d{@^GFki(Mh=OQOYu8I4U$VqC zq9iy!t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5odr;i0gz26M)SB|NnO~_$vZg z%q2m7!TOQOYu8I4U$VqC zq9iy!t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5odr;i0gz26M)SB|NnO~_$vZg z%q2m7!TOQOYu8I4U$VqC zq9iy!t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5odr;i0gz26M)SB|NnO~_$vZg z%q2m7!Thm=EGVhQ?@oFGG1nCYi(pq zkUA2-m8(&_!12Y@$Q3mlY)m0R+#HQ5VnUo^j^UgPPwqL~3QdpT1RBTS>FVdQ&MBb@ E02A*%W&i*H literal 0 HcmV?d00001 diff --git a/imp/themes/graphics/tree/plusbottom.png b/imp/themes/graphics/tree/plusbottom.png new file mode 100644 index 0000000000000000000000000000000000000000..fc36b6a4d0808721e326949dd7c81aaed6bdb771 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf%)r3d{@^GFki(Mh=OQOYu8I4U$VqC zq9iy!t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5odr;i0gz26M)SB|NnO~_$vZg z%q2m7!T$>OW|@puIWZrvMMjiX~zKOeb|zgmjwL2{Ev*b<~Q?s(Ar4kHOQ`&t;uc GLK6TJIzlx7 literal 0 HcmV?d00001 diff --git a/imp/themes/graphics/tree/plustop.png b/imp/themes/graphics/tree/plustop.png new file mode 100644 index 0000000000000000000000000000000000000000..e113aff1024c1e85a138ad7224f8bc41ed563429 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf%)r3d{@^GFki(Mh=OQOYu8I4U$VqC zq9iy!t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5odr;i0gz26M)SB|NnO~_$vZg z%q2m7!TbP0 Hl+XkK+*U#2 literal 0 HcmV?d00001 diff --git a/imp/themes/graphics/tree/rev-minus.png b/imp/themes/graphics/tree/rev-minus.png new file mode 100644 index 0000000000000000000000000000000000000000..fdce6209aaebc23217a1d3766502137e285c0c3a GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyaR&H=xK5Zb0m%IS|9>Zgzao&u zToU9L{Qp10^;5i#K(2scvyZgzao&u zToU9L{Qp10^;5i#K(3~zi(?2!baKSjtf#9&c~(0#FsfIxGBbCuIEfTJ>scvymnak{odwjy;OXk;vd$@?2>^$ODIx#> literal 0 HcmV?d00001 diff --git a/imp/themes/graphics/tree/rev-minustop.png b/imp/themes/graphics/tree/rev-minustop.png new file mode 100644 index 0000000000000000000000000000000000000000..9e47cc170043db934847cbb8bc4e4a268234b68e GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyaR&H=xK5Zb0m%IS|9>Zgzao&u zToU9L{Qp10^;5i#K(4B%i(?2!baDhM6A#M?Q63%zA&$TkGmV$IB?z~#YM-^CNL0*> Z;o2N~$!nq)W&t%Yc)I$ztaD0e0sva|B!vI~ literal 0 HcmV?d00001 diff --git a/imp/themes/graphics/tree/rev-plus.png b/imp/themes/graphics/tree/rev-plus.png new file mode 100644 index 0000000000000000000000000000000000000000..7530dcfdd81f22db9b5c3a917aeecca1db1ada2e GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyaR&H=xK5Zb0m%IS|9>Zgzao&u zToU9L{Qp10^;5i#K(3Cbi(?2!baKSjtf#9&c~(0#FsfIxGBbCuI4SHD@;f)j(3B~Z gWf|KVx%o30uGHEKeFZgzao&u zToU9L{Qp10^;5i#K(3yri(?2!baKSjtf#9&c~(0#FsfIxGBbCuI4SHD@;f)j(3B~Z iWf|KVxh%dgA%-in?M2e^F2n+LGI+ZBxvXZgzao&u zToU9L{Qp10^;5i#K(3aji(?2!baDhM6A#M?Q63%zA&$l;UKWK>_z$f3%>((F?hQAxvX