Index: misc/tabledrag.js =================================================================== RCS file: /cvs/drupal/drupal/misc/tabledrag.js,v retrieving revision 1.9 diff -u -r1.9 tabledrag.js --- misc/tabledrag.js 6 Dec 2007 09:53:53 -0000 1.9 +++ misc/tabledrag.js 12 Dec 2007 04:15:26 -0000 @@ -47,6 +47,7 @@ this.oldY = 0; // Used to determine up or down direction from last mouse move. this.changed = false; // Whether anything in the entire table has changed. this.maxDepth = 0; // Maximum amount of allowed parenting. + this.rtl = 1 // -1 if the current language is right-to-left. // Configure the scroll settings. this.scrollSettings = { amount: 4, interval: 50, trigger: 70 }; @@ -66,6 +67,9 @@ if (tableSettings[group][n]['limit'] > 0) { this.maxDepth = tableSettings[group][n]['limit']; } + if (tableSettings[group][n]['rtl'] == 1) { + this.rtl = -1; + } } } if (this.indentEnabled) { @@ -255,7 +259,7 @@ case 37: // Left arrow. case 63234: // Safari left arrow. keyChange = true; - self.rowObject.indent(-1); + self.rowObject.indent(-1 * self.rtl); break; case 38: // Up arrow. case 63232: // Safari up arrow. @@ -282,7 +286,7 @@ case 39: // Right arrow. case 63235: // Safari right arrow. keyChange = true; - self.rowObject.indent(1); + self.rowObject.indent(1 * self.rtl); break; case 40: // Down arrow. case 63233: // Safari down arrow. @@ -379,7 +383,7 @@ self.oldX = x; var xDiff = self.currentMouseCoords.x - self.dragObject.indentMousePos.x; // Set the number of indentations the mouse has been moved left or right. - var indentDiff = parseInt(xDiff / self.indentAmount); + var indentDiff = parseInt(xDiff / self.indentAmount * self.rtl); // Limit the indentation to no less than the left edge of the table and no // more than the total amount of indentation in the table. indentDiff = indentDiff > 0 ? Math.min(indentDiff, self.indentCount - self.rowObject.indents + 1) : Math.max(indentDiff, -self.rowObject.indents); @@ -389,7 +393,7 @@ var indentChange = self.rowObject.indent(indentDiff); // Update table and mouse indentations. - self.dragObject.indentMousePos.x += self.indentAmount * indentChange; + self.dragObject.indentMousePos.x += self.indentAmount * indentChange * self.rtl; self.indentCount = Math.max(self.indentCount, self.rowObject.indents); } } Index: modules/system/system-rtl.css =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system-rtl.css,v retrieving revision 1.10 diff -u -r1.10 system-rtl.css --- modules/system/system-rtl.css 4 Dec 2007 10:52:16 -0000 1.10 +++ modules/system/system-rtl.css 12 Dec 2007 04:15:26 -0000 @@ -102,3 +102,6 @@ padding: 0.42em 0.6em 0.42em 0; float: right; } +div.tree-child, div.tree-child-last { + background-position: -65px center; +} Index: modules/system/system.css =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.css,v retrieving revision 1.44 diff -u -r1.44 system.css --- modules/system/system.css 4 Dec 2007 10:52:16 -0000 1.44 +++ modules/system/system.css 12 Dec 2007 04:15:26 -0000 @@ -52,10 +52,10 @@ float: left; /* LTR */ } div.tree-child { - background: url(../../misc/tree.png) no-repeat 11px center; + background: url(../../misc/tree.png) no-repeat 11px center; /* LTR */ } div.tree-child-last { - background: url(../../misc/tree-bottom.png) no-repeat 11px center; + background: url(../../misc/tree-bottom.png) no-repeat 11px center; /* LTR */ } div.tree-child-horizontal { background: url(../../misc/tree.png) no-repeat -11px center; Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.733 diff -u -r1.733 common.inc --- includes/common.inc 8 Dec 2007 14:06:20 -0000 1.733 +++ includes/common.inc 12 Dec 2007 04:15:26 -0000 @@ -2145,6 +2145,8 @@ */ function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgroup = NULL, $source = NULL, $hidden = TRUE, $limit = 0) { static $js_added = FALSE; + global $language; + if (!$js_added) { drupal_add_js('misc/tabledrag.js', 'core'); $js_added = TRUE; @@ -2160,6 +2162,7 @@ 'action' => $action, 'hidden' => $hidden, 'limit' => $limit, + 'rtl' => $language->direction, ); drupal_add_js($settings, 'setting'); }