From: Michael M Slusarz Date: Fri, 7 Aug 2009 20:21:38 +0000 (-0600) Subject: All tree graphics are now handled via CSS X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dbcbdd697ef195471524bbfb755522697c2b9f95;p=horde.git All tree graphics are now handled via CSS --- 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 000000000..4bb82ebbe 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 index 000000000..8d8404066 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 index 000000000..26a05cd8b 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 index 000000000..9783e5b9b 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 index 000000000..fc36b6a4d 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 index 000000000..e113aff10 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 index 000000000..fdce6209a 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 index 000000000..48d3a97d7 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 index 000000000..9e47cc170 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 index 000000000..7530dcfdd 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 index 000000000..a2289187c 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 index 000000000..6802762f9 Binary files /dev/null and b/imp/themes/graphics/tree/rev-plustop.png differ diff --git a/imp/themes/ie6_or_less.css b/imp/themes/ie6_or_less.css index 06b9b1620..923bc9108 100644 --- a/imp/themes/ie6_or_less.css +++ b/imp/themes/ie6_or_less.css @@ -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; } diff --git a/imp/themes/ie7.css b/imp/themes/ie7.css index 781884554..6126d3766 100644 --- a/imp/themes/ie7.css +++ b/imp/themes/ie7.css @@ -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; } diff --git a/imp/themes/screen.css b/imp/themes/screen.css index 33ced98c8..9bec46f8b 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -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 {