From: Michael M Slusarz Date: Mon, 2 Mar 2009 22:39:29 +0000 (-0700) Subject: Update thread image handling for imp view. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f672e1e90d1bddb6d6dc6870376488936f36206b;p=horde.git Update thread image handling for imp view. Reimplement RTL thread graphics for dimp. --- diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 1379fd20b..6df32faa3 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -427,7 +427,7 @@ var DimpBase = { tmp = elt.cloneNode(false); u = thread.get(row.imapuid); $R(0, u.length, true).each(function(i) { - tmp.insert(new Element('SPAN', { className: 'iconImg threadImg threadImg' + u.charAt(i) })); + tmp.insert(new Element('SPAN', { className: 'threadImg threadImg' + u.charAt(i) })); }); elt.replace(tmp.insert(elt.getText().escapeHTML())); } diff --git a/imp/lib/Imap/Thread.php b/imp/lib/Imap/Thread.php index 9a409ce90..6dba5f9c9 100644 --- a/imp/lib/Imap/Thread.php +++ b/imp/lib/Imap/Thread.php @@ -21,19 +21,6 @@ class IMP_Imap_Thread protected $_thread; /** - * Images used and their internal representations. - * - * @var array - */ - static protected $_imglist = array( - '0' => 'blank.png', - '1' => 'line.png', - '2' => 'join.png', - '3' => 'joinbottom-down.png', - '4' => 'joinbottom.png' - ); - - /** * Constructor. * * @param Horde_Imap_Client_Thread $thread The thread data object. @@ -45,18 +32,29 @@ class IMP_Imap_Thread /** * Generate the thread representation for the given index list in the - * internal format (a string with each character representing the graphic - * to be displayed from $_imglist). + * internal format. * * @param array $indices The list of indices to create a tree for. * @param boolean $sortdir True for newest first, false for oldest first. * * @return array An array with the index as the key and the internal * thread representation as the value. + *
+     * 0 - blank
+     * 1 - line
+     * 2 - join
+     * 3 - joinbottom-down
+     * 4 - joinbottom
+     * 5 - line (reverse)
+     * 6 - join (reverse)
+     * 7 - joinbottom-down (reverse)
+     * 8 - joinbottom (reverse)
+     * 
*/ public function getThreadTreeOb($indices, $sortdir) { $container = $last_level = $last_thread = null; + $rtl = !empty($GLOBALS['nls']['rtl'][$GLOBALS['language']]); $thread_level = $tree = array(); $t = &$this->_thread; @@ -96,11 +94,15 @@ class IMP_Imap_Thread $join_img = 2; } + if ($rtl) { + $join_img += 4; + } + $thread_level[$indentLevel] = $lastinlevel; $line = ''; for ($i = 1; $i < $indentLevel; ++$i) { - $line .= (!isset($thread_level[$i]) || ($thread_level[$i])) ? 0 : 1; + $line .= (!isset($thread_level[$i]) || ($thread_level[$i])) ? 0 : ($rtl ? 5 : 1); } $tree[$val] = $line . $join_img; } @@ -119,16 +121,12 @@ class IMP_Imap_Thread */ public function getThreadImageTree($indices, $sortdir) { - $imgs = $tree = array(); - - foreach (self::$_imglist as $key => $val) { - $imgs[$key] = Horde::img('tree/' . (($key != 0 && !empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) ? ('rev-' . $val) : $val), null, null, $GLOBALS['registry']->getImageDir('horde')); - } + $tree = array(); foreach ($this->getThreadTreeOb($indices, $sortdir) as $k => $v) { $tree[$k] = ''; for ($i = 0, $length = strlen($v); $i < $length; ++$i) { - $tree[$k] .= $imgs[$v[$i]]; + $tree[$k] .= ''; } } return $tree; diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index c8bc954c3..bb6d473cb 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -1135,7 +1135,7 @@ class IMP_Imap_Tree /** * Initializes and returns the list of mailboxes to poll. * - * @param boolean $prune Prune non-existant folders from list? + * @param boolean $prune Prune non-existent folders from list? * @param boolean $sort Sort the directory list? * * @return array The list of mailboxes to poll. @@ -1144,7 +1144,10 @@ class IMP_Imap_Tree { $this->_initPollList(); - $plist = ($prune) ? array_values(array_intersect(array_keys($this->_poll), $this->folderList())) : $this->_poll; + $plist = ($prune) + ? array_values(array_intersect(array_keys($this->_poll), $this->folderList())) + : $this->_poll; + if ($sort) { $ns_new = $this->_getNamespace(null); Horde_Imap_Client_Sort::sortMailboxes($plist, array('delimiter' => $ns_new['delimiter'], 'inbox' => true)); diff --git a/imp/themes/graphics/tree/rev-join.png b/imp/themes/graphics/tree/rev-join.png new file mode 100644 index 000000000..6697b5ff8 Binary files /dev/null and b/imp/themes/graphics/tree/rev-join.png differ diff --git a/imp/themes/graphics/tree/rev-joinbottom-down.png b/imp/themes/graphics/tree/rev-joinbottom-down.png new file mode 100644 index 000000000..2cfce1e47 Binary files /dev/null and b/imp/themes/graphics/tree/rev-joinbottom-down.png differ diff --git a/imp/themes/graphics/tree/rev-joinbottom.png b/imp/themes/graphics/tree/rev-joinbottom.png new file mode 100644 index 000000000..027f85a58 Binary files /dev/null and b/imp/themes/graphics/tree/rev-joinbottom.png differ diff --git a/imp/themes/graphics/tree/rev-line.png b/imp/themes/graphics/tree/rev-line.png new file mode 100644 index 000000000..92745e51c Binary files /dev/null and b/imp/themes/graphics/tree/rev-line.png differ diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 01f127621..015530feb 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -1080,22 +1080,7 @@ span.dimpactionDrafts { /* Thread images */ span.threadImg { margin-top: -4px; - padding-right: 5px; margin-right: 0; - height: 20px; -} - -span.threadImg1 { - background-image: url("graphics/tree/line.png"); -} -span.threadImg2 { - background-image: url("graphics/tree/join.png"); -} -span.threadImg3 { - background-image: url("graphics/tree/joinbottom-down.png"); -} -span.threadImg4 { - background-image: url("graphics/tree/joinbottom.png"); } /* Other images */ diff --git a/imp/themes/screen.css b/imp/themes/screen.css index 1a0ba1387..08e4cbb37 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -24,9 +24,6 @@ border: 1px solid #ddd; vertical-align: middle; } -.messageList img { - padding-right: 1px; -} .messageList td label input { vertical-align: middle; } @@ -439,6 +436,39 @@ ul.nav-audio { text-decoration: underline; } +/* Thread images */ +span.threadImg { + height: 20px; + width: 20px; + display: inline-block; + vertical-align: middle; +} + +span.threadImg1 { + background-image: url("graphics/tree/line.png"); +} +span.threadImg2 { + background-image: url("graphics/tree/join.png"); +} +span.threadImg3 { + background-image: url("graphics/tree/joinbottom-down.png"); +} +span.threadImg4 { + background-image: url("graphics/tree/joinbottom.png"); +} +span.threadImg5 { + background-image: url("graphics/tree/rev-line.png"); +} +span.threadImg6 { + background-image: url("graphics/tree/rev-join.png"); +} +span.threadImg7 { + background-image: url("graphics/tree/rev-joinbottom-down.png"); +} +span.threadImg8 { + background-image: url("graphics/tree/rev-joinbottom.png"); +} + /* MIME styles. */ .mimeStatusMessage, .mimeStatusWarning, .mimeHeaders, .mimePartInfo { padding: 4px;