Let rtl.css deal with the proper override of tree images
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 19 Aug 2010 23:03:14 +0000 (17:03 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Aug 2010 16:15:12 +0000 (10:15 -0600)
horde/themes/rtl.css
horde/themes/screen.css
imp/lib/Imap/Thread.php
imp/lib/Ui/Folder.php

index 5abb0e4..4084cad 100644 (file)
@@ -101,7 +101,7 @@ option {
     padding-right: 0;
     padding-left: 2px;
 }
+
 /* Preferences. */
 #services_prefs .header ul {
     float: left;
@@ -131,6 +131,50 @@ option {
     text-align: right;
 }
 
+/* Tree styles. */
+span.treeImg1 {
+    background-image: url("graphics/tree/rev-line.png");
+}
+span.treeImg2 {
+    background-image: url("graphics/tree/rev-join.png");
+}
+span.treeImg3 {
+    background-image: url("graphics/tree/rev-joinbottom-down.png");
+}
+span.treeImg4 {
+    background-image: url("graphics/tree/rev-joinbottom.png");
+}
+span.treeImg5 {
+    background-image: url("graphics/tree/rev-minustop.png");
+}
+span.treeImg6 {
+    background-image: url("graphics/tree/rev-minus.png");
+}
+span.treeImg7 {
+    background-image: url("graphics/tree/rev-minusbottom.png");
+}
+span.treeImg8 {
+    background-image: url("graphics/tree/rev-minusonly.png");
+}
+span.treeImg9 {
+    background-image: url("graphics/tree/rev-plustop.png");
+}
+span.treeImg10 {
+    background-image: url("graphics/tree/rev-plus.png");
+}
+span.treeImg11 {
+    background-image: url("graphics/tree/rev-plusbottom.png");
+}
+span.treeImg12 {
+    background-image: url("graphics/tree/rev-plusonly.png");
+}
+span.treeImg13 {
+    background-image: url("graphics/tree/rev-nullonly.png");
+}
+span.treeImg16 {
+    background-image: url("graphics/tree/rev-leaf.png");
+}
+
 /* Color picker styles. */
 #color-picker .north div {
     float: left;
index 99eceda..f2f071f 100644 (file)
@@ -415,52 +415,40 @@ span.treeImg4 {
     background-image: url("graphics/tree/joinbottom.png");
 }
 span.treeImg5 {
-    background-image: url("graphics/tree/rev-line.png");
+    background-image: url("graphics/tree/minustop.png");
 }
 span.treeImg6 {
-    background-image: url("graphics/tree/rev-join.png");
+    background-image: url("graphics/tree/minus.png");
 }
 span.treeImg7 {
-    background-image: url("graphics/tree/rev-joinbottom-down.png");
+    background-image: url("graphics/tree/minusbottom.png");
 }
 span.treeImg8 {
-    background-image: url("graphics/tree/rev-joinbottom.png");
+    background-image: url("graphics/tree/minusonly.png");
 }
 span.treeImg9 {
-    background-image: url("graphics/tree/minustop.png");
+    background-image: url("graphics/tree/plustop.png");
 }
 span.treeImg10 {
-    background-image: url("graphics/tree/minus.png");
+    background-image: url("graphics/tree/plus.png");
 }
 span.treeImg11 {
-    background-image: url("graphics/tree/minusbottom.png");
+    background-image: url("graphics/tree/plusbottom.png");
 }
 span.treeImg12 {
-    background-image: url("graphics/tree/rev-minustop.png");
+    background-image: url("graphics/tree/plusonly.png");
 }
 span.treeImg13 {
-    background-image: url("graphics/tree/rev-minus.png");
+    background-image: url("graphics/tree/nullonly.png");
 }
 span.treeImg14 {
-    background-image: url("graphics/tree/rev-minusbottom.png");
+    background-image: url("graphics/tree/folder.png");
 }
 span.treeImg15 {
-    background-image: url("graphics/tree/plustop.png");
+    background-image: url("graphics/tree/folderopen.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");
+    background-image: url("graphics/tree/leaf.png");
 }
 
 /* Menu styles. */
index 66db745..aa09f91 100644 (file)
@@ -47,16 +47,11 @@ class IMP_Imap_Thread
      * 2 - join
      * 3 - joinbottom-down
      * 4 - joinbottom
-     * 5 - line (reverse)
-     * 6 - join (reverse)
-     * 7 - joinbottom-down (reverse)
-     * 8 - joinbottom (reverse)
      * </pre>
      */
     public function getThreadTreeOb($indices, $sortdir)
     {
         $container = $last_level = $last_thread = null;
-        $rtl = !empty($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]);
         $thread_level = $tree = array();
         $t = &$this->_thread;
 
@@ -96,15 +91,11 @@ 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 : ($rtl ? 5 : 1);
+                $line .= intval(isset($thread_level[$i]) && !$thread_level[$i]);
             }
             $tree[$val] = $line . $join_img;
         }
index 046ce99..08bf3e0 100644 (file)
@@ -77,30 +77,18 @@ class IMP_Ui_Folder
                     $alt = _("Collapse Folder");
                 }
 
-                if (empty($registry->nlsconfig['rtl'][$GLOBALS['language']])) {
-                    $tree_img = ($elt->value == 'INBOX')
-                        ? 9
-                        : ($peek ? 10 : 11);
-                } else {
-                    $tree_img = ($elt->value == 'INBOX')
-                        ? 12
-                        : ($peek ? 13 : 14);
-                }
+                $tree_img = ($elt->value == 'INBOX')
+                    ? 5
+                    : ($peek ? 6 : 7);
             } else {
                 if (!is_null($dir)) {
                     $dir->add('actionID', 'expand_folder');
                     $alt = _("Expand Folder");
                 }
 
-                if (empty($registry->nlsconfig['rtl'][$GLOBALS['language']])) {
-                    $tree_img = ($elt->value == 'INBOX')
-                        ? 15
-                        : ($peek ? 16 : 17);
-                } else {
-                    $tree_img = ($elt->value == 'INBOX')
-                        ? 18
-                        : ($peek ? 19 : 20);
-                }
+                $tree_img = ($elt->value == 'INBOX')
+                        ? 9
+                        : ($peek ? 10 : 11);
             }
 
             if (!is_null($dir)) {
@@ -110,15 +98,9 @@ class IMP_Ui_Folder
             if (($elt->value == 'INBOX') && !$peek) {
                 $dir = '<span class="treeImg"></span>' . $dir2;
             } else {
-                if (empty($registry->nlsconfig['rtl'][$GLOBALS['language']])) {
-                    $tree_img = ($elt->value == 'INBOX')
-                        ? 3
-                        : ($peek ? 2 : 4);
-                } else {
-                    $tree_img = ($elt->value == 'INBOX')
-                        ? 7
-                        : ($peek ? 6 : 8);
-                }
+                $tree_img = ($elt->value == 'INBOX')
+                    ? 3
+                    : ($peek ? 2 : 4);
                 $dir = '<span class="treeImg treeImg' . $tree_img . '"></span>' . $dir2;
             }
         }
@@ -126,7 +108,7 @@ class IMP_Ui_Folder
         $this->_moreMbox[$elt->level] = $peek;
         for ($i = 0; $i < $elt->level; ++$i) {
             $line .= $this->_moreMbox[$i]
-                ? '<span class="treeImg treeImg' . (empty($registry->nlsconfig['rtl'][$GLOBALS['language']]) ? 1 : 5) . '"></span>'
+                ? '<span class="treeImg treeImg1"></span>'
                 : '<span class="treeImg"></span>';
         }