[dev] RTL patch for tree

Vahid Ghafarpour vahid at ghafarpour.com
Tue Dec 14 03:00:38 PST 2004


tree menu has some problem in RTL direction
this patch fix some of this errors
images should added in horde/themes/graphics/tree/ directory and patch
file is for horde/templates/javascript/tree.js

-- 
Vahid Ghafarpour.
vahid at ghafarpour.com
http://vahid.ghafarpour.com/

-------------- next part --------------
--- tree.js.bak	2004-12-14 10:04:47.000000000 +0000
+++ tree.js	2004-12-14 10:38:04.000000000 +0000
@@ -21,6 +21,8 @@
 
     /* Image variables. */
     this.imgDir         = '<?php echo $GLOBALS['registry']->getImageDir('horde') . '/tree'; ?>';
+<?php global $nls;global $language;if(empty($nls['rtl'][$language])){?>
+    this.floatDir	= 'float:left;';
     this.imgLine        = 'line.png';
     this.imgBlank       = 'blank.png';
     this.imgJoin        = 'join.png';
@@ -35,7 +37,23 @@
     this.imgFolder      = 'folder.png';
     this.imgFolderOpen  = 'folderopen.png';
     this.imgLeaf        = 'leaf.png';
-
+<?php }else{?>
+    this.floatDir	= 'float:right;';
+    this.imgLine        = 'rev-line.png';
+    this.imgBlank       = 'rev-blank.png';
+    this.imgJoin        = 'rev-join.png';
+    this.imgJoinBottom  = 'rev-joinbottom.png';
+    this.imgPlus        = 'rev-plus.png';
+    this.imgPlusBottom  = 'rev-plusbottom.png';
+    this.imgPlusOnly    = 'rev-plusonly.png';
+    this.imgMinus       = 'rev-minus.png';
+    this.imgMinusBottom = 'rev-minusbottom.png';
+    this.imgMinusOnly   = 'rev-minusonly.png';
+    this.imgNullOnly    = 'rev-nullonly.png';
+    this.imgFolder      = 'rev-folder.png';
+    this.imgFolderOpen  = 'rev-folderopen.png';
+    this.imgLeaf        = 'rev-leaf.png';
+<?php }?>
     /* Tree building variables. */
     this.renderStatic   = false;
     this.target         = '';
@@ -105,7 +123,7 @@
             html += ' class="' + this.header[i]['class'] + '"';
         }
 
-        var style = 'float:left;';
+        var style = this.floatDir;
         if (this.header[i]['width']) {
             style += 'width:' + this.header[i]['width'] + ';';
         }
@@ -180,7 +198,7 @@
         typeof(this.nodes[nodeId]['extra'][0]) != 'undefined') {
         var extra = this.nodes[nodeId]['extra'][0];
         for (var c = 0; c < extra.length; c++) {
-            style = 'float:left;';
+            style = this.floatDir;
             if (this.header[column] && this.header[column]['width']) {
                 style += 'width:' + this.header[column]['width'] + ';';
             }
@@ -188,7 +206,7 @@
             column++;
         }
         for (var d = c; d < extraColsLeft; d++) {
-            style = 'float:left;';
+            style = this.floatDir;
             if (this.header[column] && this.header[column]['width']) {
                 style += 'width:' + this.header[column]['width'] + ';';
             }
@@ -197,7 +215,7 @@
         }
     } else {
         for (var c = 0; c < extraColsLeft; c++) {
-            style = 'float:left;';
+            style = this.floatDir;
             if (this.header[column] && this.header[column]['width']) {
                 style += 'width:' + this.header[column]['width'] + ';';
             }
@@ -206,7 +224,7 @@
         }
     }
 
-    style = 'float:left;';
+    style = this.floatDir;
     if (this.header[column] && this.header[column]['width']) {
         style += 'width:' + this.header[column]['width'] + ';';
     }
@@ -240,7 +258,7 @@
         typeof(this.nodes[nodeId]['extra'][1]) != 'undefined') {
         var extra = this.nodes[nodeId]['extra'][1];
         for (var c = 0; c < extra.length; c++) {
-            style = 'float:left;';
+            style = this.floatDir;
             if (this.header[column] && this.header[column]['width']) {
                 style += 'width:' + this.header[column]['width'] + ';';
             }
@@ -248,7 +266,7 @@
             column++;
         }
         for (var d = c; d < extraColsRight; d++) {
-            style = 'float:left;';
+            style = this.floatDir;
             if (this.header[column] && this.header[column]['width']) {
                 style += 'width:' + this.header[column]['width'] + ';';
             }
@@ -257,7 +275,7 @@
         }
     } else {
         for (var c = 0; c < extraColsRight; c++) {
-            style = 'float:left;';
+            style = this.floatDir;
             if (this.header[column] && this.header[column]['width']) {
                 style += 'width:' + this.header[column]['width'] + ';';
             }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree.tar.gz
Type: application/x-gzip-compressed
Size: 2348 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20041214/74b987b2/tree.tar.bin


More information about the dev mailing list