Index: trunk/phase3/skins/monobook/content_rtl.css |
— | — | @@ -0,0 +1,100 @@ |
| 2 | +/* |
| 3 | +Right-to-left fixes for MonoBook. |
| 4 | +Places sidebar on right, tweaks various alignment issues. |
| 5 | + |
| 6 | +Works mostly ok nicely on Safari 1.2.1; fine in Mozilla. |
| 7 | + |
| 8 | +Safari bugs (1.2.1): |
| 9 | +* Tabs are still appearing in left-to-right order. (Try after localizing) |
| 10 | + |
| 11 | +Opera bugs (7.23 linux): |
| 12 | +* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other |
| 13 | + |
| 14 | +IE/mac bugs: |
| 15 | +* The thing barfs on Hebrew and Arabic anyway, so no point testing. |
| 16 | + |
| 17 | +Missing features due to lack of support: |
| 18 | +* external link icons |
| 19 | + |
| 20 | +To test: |
| 21 | +* Opera6 |
| 22 | +* IE 5.0 |
| 23 | +* etc |
| 24 | + |
| 25 | +*/ |
| 26 | +#realContent { |
| 27 | + direction: rtl; |
| 28 | +/* unicode-bidi: bidi-override;*/ |
| 29 | + unicode-bidi: embed; |
| 30 | +} |
| 31 | + |
| 32 | +/* Fix alignment */ |
| 33 | +.documentByLine { |
| 34 | + text-align: left; |
| 35 | +} |
| 36 | + |
| 37 | +div div.thumbcaption { |
| 38 | + text-align: right; |
| 39 | +} |
| 40 | + |
| 41 | +div.magnify, |
| 42 | +#div.townBox { |
| 43 | + left: auto; |
| 44 | + right: 0; |
| 45 | +} |
| 46 | + |
| 47 | +/* Fix margins for non-css2 browsers */ |
| 48 | +/* top right bottom left */ |
| 49 | + |
| 50 | +ul { |
| 51 | + margin-left: 0; |
| 52 | + margin-right: 1.5em; |
| 53 | +} |
| 54 | +ol { |
| 55 | + margin-left: 0; |
| 56 | + margin-right: 2.4em; |
| 57 | +} |
| 58 | +dd { |
| 59 | + margin-left: 0; |
| 60 | + margin-right: 1.6em; |
| 61 | +} |
| 62 | +/* ??? */ |
| 63 | +li { |
| 64 | + margin-left: 0; |
| 65 | + margin-right: 2.4em; |
| 66 | +} |
| 67 | +.tocindent { |
| 68 | + margin-left: 0; |
| 69 | + margin-right: 2em; |
| 70 | +} |
| 71 | +div.tright, div.floatright, table.floatright { |
| 72 | + clear: none; |
| 73 | +} |
| 74 | +div.tleft, div.floatleft, table.floatleft { |
| 75 | + clear: left; |
| 76 | +} |
| 77 | +div.townBox { |
| 78 | + margin-left: 0; |
| 79 | + margin-right: 1em; |
| 80 | +} |
| 81 | +div.townBox dl dd { |
| 82 | + margin-left: 0; |
| 83 | + margin-right: 1.1em; |
| 84 | +} |
| 85 | +/* Fix link icons */ |
| 86 | +.external { |
| 87 | + padding: 0 !important; |
| 88 | + background: none !important; |
| 89 | +} |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +/* workaround for moz bug, displayed bullets on left side */ |
| 94 | + |
| 95 | +#toc ul { |
| 96 | + text-align: right; |
| 97 | +} |
| 98 | + |
| 99 | +#toc ul ul { |
| 100 | + margin: 0 2em 0 0; |
| 101 | +} |
Property changes on: trunk/phase3/skins/monobook/content_rtl.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 102 | + native |
Index: trunk/phase3/skins/monobook/rtl.css |
— | — | @@ -52,19 +52,11 @@ |
53 | 53 | } |
54 | 54 | |
55 | 55 | /* Fix alignment */ |
56 | | -.documentByLine, |
57 | 56 | .portletDetails, |
58 | 57 | .portletMore, |
59 | 58 | #p-personal { |
60 | 59 | text-align: left; |
61 | 60 | } |
62 | | - |
63 | | -div div.thumbcaption { |
64 | | - text-align: right; |
65 | | -} |
66 | | - |
67 | | -div.magnify, |
68 | | -#div.townBox, |
69 | 61 | #p-logo { |
70 | 62 | left: auto; |
71 | 63 | right: 0; |
— | — | @@ -73,7 +65,20 @@ |
74 | 66 | left: auto; |
75 | 67 | right: 0; |
76 | 68 | } |
| 69 | +#p-navigation .pBody { |
| 70 | + padding-right: auto; |
| 71 | +} |
77 | 72 | |
| 73 | +/* the icon in front of the user name, single quotes |
| 74 | +in bg url to hide it from iemac */ |
| 75 | +li#pt-userpage, |
| 76 | +li#pt-anonuserpage, |
| 77 | +li#pt-login { |
| 78 | + background: url(user.gif) top right no-repeat; |
| 79 | + padding-left: 0px; |
| 80 | + padding-right: 20px; |
| 81 | + text-transform: none; |
| 82 | +} |
78 | 83 | #p-cactions { |
79 | 84 | left: auto; |
80 | 85 | right: 11.5em; |
— | — | @@ -104,15 +109,15 @@ |
105 | 110 | /* Fix margins for non-css2 browsers */ |
106 | 111 | /* top right bottom left */ |
107 | 112 | |
108 | | -ul { |
| 113 | +.portlet ul { |
109 | 114 | margin-left: 0; |
110 | 115 | margin-right: 1.5em; |
111 | 116 | } |
112 | | -ol { |
| 117 | +.portlet ol { |
113 | 118 | margin-left: 0; |
114 | 119 | margin-right: 2.4em; |
115 | 120 | } |
116 | | -dd { |
| 121 | +.portlet dd { |
117 | 122 | margin-left: 0; |
118 | 123 | margin-right: 1.6em; |
119 | 124 | } |
— | — | @@ -120,24 +125,6 @@ |
121 | 126 | margin-right: 1em; |
122 | 127 | margin-left: 0; |
123 | 128 | } |
124 | | -.tocindent { |
125 | | - margin-left: 0; |
126 | | - margin-right: 2em; |
127 | | -} |
128 | | -div.tright, div.floatright, table.floatright { |
129 | | - clear: none; |
130 | | -} |
131 | | -div.tleft, div.floatleft, table.floatleft { |
132 | | - clear: left; |
133 | | -} |
134 | | -div.townBox { |
135 | | - margin-left: 0; |
136 | | - margin-right: 1em; |
137 | | -} |
138 | | -div.townBox dl dd { |
139 | | - margin-left: 0; |
140 | | - margin-right: 1.1em; |
141 | | -} |
142 | 129 | #p-personal li { |
143 | 130 | margin-left: 0; |
144 | 131 | margin-right: 1em; |
— | — | @@ -152,11 +139,6 @@ |
153 | 140 | #p-personal li { |
154 | 141 | float: left; |
155 | 142 | } |
156 | | -/* Fix link icons */ |
157 | | -.external { |
158 | | - padding: 0 !important; |
159 | | - background: none !important; |
160 | | -} |
161 | 143 | #footer { |
162 | 144 | clear: both; |
163 | 145 | } |
— | — | @@ -191,16 +173,6 @@ |
192 | 174 | padding-right: 2em; |
193 | 175 | } |
194 | 176 | |
195 | | -/* workaround for moz bug, displayed bullets on left side */ |
196 | | - |
197 | | -#toc ul { |
198 | | - text-align: right; |
199 | | -} |
200 | | - |
201 | | -#toc ul ul { |
202 | | - margin: 0 2em 0 0; |
203 | | -} |
204 | | - |
205 | 177 | input#wpSave, input#wpDiff { |
206 | 178 | margin-right: 0; |
207 | 179 | margin-left: .33em; |
Index: trunk/phase3/skins/monobook/main.css |
— | — | @@ -569,7 +569,7 @@ |
570 | 570 | ** keep the whitespace in front of the ^=, hides rule from konqueror |
571 | 571 | ** this is css3, the validator doesn't like it when validating as css2 |
572 | 572 | */ |
573 | | -#bodyContent a.external, |
| 573 | +#bodyContent a.external[DIR="ltr"], |
574 | 574 | #bodyContent a[href ^="gopher://"] { |
575 | 575 | background: url(external.png) center right no-repeat; |
576 | 576 | padding-right: 13px; |
— | — | @@ -676,6 +676,8 @@ |
677 | 677 | list-style-type: square; |
678 | 678 | list-style-image: url(bullet.gif); |
679 | 679 | font-size: 95%; |
| 680 | + margin: .3em 0 0 1.5em; |
| 681 | + padding: 0; |
680 | 682 | } |
681 | 683 | .portlet li { |
682 | 684 | padding: 0; |
— | — | @@ -718,7 +720,7 @@ |
719 | 721 | } |
720 | 722 | |
721 | 723 | #p-navigation .pBody { |
722 | | - padding-right: 0; |
| 724 | +/* padding-right: 0; */ |
723 | 725 | } |
724 | 726 | |
725 | 727 | #p-navigation a { |
Index: trunk/phase3/skins/CologneBlue.php |
— | — | @@ -98,14 +98,15 @@ |
99 | 99 | } |
100 | 100 | |
101 | 101 | function doGetUserStyles() { |
102 | | - global $wgOut; |
| 102 | + global $wgOut, $wgLang, $wgUser; |
103 | 103 | $s = parent::doGetUserStyles(); |
104 | 104 | $qb = $this->qbSetting(); |
105 | 105 | |
106 | | - if ( 2 == $qb ) { # Right |
| 106 | + if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) || |
| 107 | + ( 2 == $qb ) ) { # Right |
107 | 108 | $s .= "#quickbar { position: absolute; right: 4px; }\n" . |
108 | 109 | "#article { margin-left: 4px; margin-right: 148px; }\n"; |
109 | | - } else if ( 1 == $qb ) { |
| 110 | + } else if ( (!$wgUser->isLoggedIn()) || ( 1 == $qb ) ) { |
110 | 111 | $s .= "#quickbar { position: absolute; left: 4px; }\n" . |
111 | 112 | "#article { margin-left: 148px; margin-right: 4px; }\n"; |
112 | 113 | } else if ( 3 == $qb ) { # Floating left |
Index: trunk/phase3/skins/Standard.php |
— | — | @@ -52,16 +52,18 @@ |
53 | 53 | * |
54 | 54 | */ |
55 | 55 | function doGetUserStyles() { |
56 | | - global $wgStylePath; |
| 56 | + global $wgStylePath, $wgLang, $wgUser; |
57 | 57 | |
58 | 58 | $s = parent::doGetUserStyles(); |
59 | 59 | $qb = $this->qbSetting(); |
60 | 60 | |
61 | | - if ( 2 == $qb ) { # Right |
| 61 | + if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) || |
| 62 | + ( 2 == $qb ) ) { # Right |
62 | 63 | $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " . |
63 | 64 | "border-left: 2px solid #000000; }\n" . |
64 | 65 | "#article { margin-left: 4px; margin-right: 152px; }\n"; |
65 | | - } else if ( 1 == $qb || 3 == $qb ) { |
| 66 | + } else if ( (!$wgUser->isLoggedIn()) || |
| 67 | + ( 1 == $qb || 3 == $qb ) ) { |
66 | 68 | $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " . |
67 | 69 | "border-right: 1px solid gray; }\n" . |
68 | 70 | "#article { margin-left: 152px; margin-right: 4px; }\n"; |
— | — | @@ -90,7 +92,7 @@ |
91 | 93 | } |
92 | 94 | |
93 | 95 | function doAfterContent() { |
94 | | - global $wgContLang; |
| 96 | + global $wgLang; |
95 | 97 | $fname = 'SkinStandard::doAfterContent'; |
96 | 98 | wfProfileIn( $fname ); |
97 | 99 | wfProfileIn( $fname.'-1' ); |
— | — | @@ -105,14 +107,14 @@ |
106 | 108 | $qb = $this->qbSetting(); |
107 | 109 | $shove = ($qb != 0); |
108 | 110 | $left = ($qb == 1 || $qb == 3); |
109 | | - if($wgContLang->isRTL()) $left = !$left; |
| 111 | + if($wgLang->isRTL()) $left = !$left; |
110 | 112 | |
111 | 113 | if ( $shove && $left ) { # Left |
112 | 114 | $s .= $this->getQuickbarCompensator(); |
113 | 115 | } |
114 | 116 | wfProfileOut( $fname.'-2' ); |
115 | 117 | wfProfileIn( $fname.'-3' ); |
116 | | - $l = $wgContLang->isRTL() ? 'right' : 'left'; |
| 118 | + $l = $wgLang->isRTL() ? 'right' : 'left'; |
117 | 119 | $s .= "<td class='bottom' align='$l' valign='top'>"; |
118 | 120 | |
119 | 121 | $s .= $this->bottomLinks(); |
Index: trunk/phase3/skins/common/common_content_rtl.css |
— | — | @@ -0,0 +1 @@ |
| 2 | +/* RTL specific styles for date content (not layout) go here */ |
Property changes on: trunk/phase3/skins/common/common_content_rtl.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 3 | + native |
Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | wfSuppressWarnings(); |
53 | 53 | |
54 | 54 | ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
55 | | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>"> |
| 55 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('uselang') ?>" lang="<?php $this->text('uselang') ?>" dir="<?php $this->text('dir') ?>"> |
56 | 56 | <head> |
57 | 57 | <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" /> |
58 | 58 | <?php $this->html('headlinks') ?> |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | <div id="content"> |
95 | 95 | <a name="top" id="top"></a> |
96 | 96 | <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> |
97 | | - <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1> |
| 97 | + <h1 class="firstHeading"<?php $this->text('titledir') ?>><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1> |
98 | 98 | <div id="bodyContent"> |
99 | 99 | <h3 id="siteSub"><?php $this->msg('tagline') ?></h3> |
100 | 100 | <div id="contentSub"><?php $this->html('subtitle') ?></div> |
— | — | @@ -124,6 +124,9 @@ |
125 | 125 | <h5><?php $this->msg('personaltools') ?></h5> |
126 | 126 | <div class="pBody"> |
127 | 127 | <ul> |
| 128 | +<?php if ($this->data['rtl'] == "1") |
| 129 | + $this->data['personal_urls'] = |
| 130 | + array_reverse($this->data['personal_urls'], true); ?> |
128 | 131 | <?php foreach($this->data['personal_urls'] as $key => $item) { ?> |
129 | 132 | <li id="pt-<?php echo htmlspecialchars($key) ?>"<?php |
130 | 133 | if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -734,7 +734,7 @@ |
735 | 735 | * the given title. |
736 | 736 | */ |
737 | 737 | function view() { |
738 | | - global $wgUser, $wgOut, $wgRequest, $wgContLang; |
| 738 | + global $wgUser, $wgOut, $wgRequest, $wgLang; |
739 | 739 | global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser; |
740 | 740 | global $wgUseTrackbacks; |
741 | 741 | $sk = $wgUser->getSkin(); |
— | — | @@ -891,7 +891,7 @@ |
892 | 892 | $wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" ); |
893 | 893 | } else if ( $rt = Title::newFromRedirect( $text ) ) { |
894 | 894 | # Display redirect |
895 | | - $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; |
| 895 | + $imageDir = $wgLang->isRTL() ? 'rtl' : 'ltr'; |
896 | 896 | $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png'; |
897 | 897 | # Don't overwrite the subtitle if this was an old revision |
898 | 898 | if( !$wasRedirected && $this->isCurrent() ) { |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1850,6 +1850,36 @@ |
1851 | 1851 | return $items; |
1852 | 1852 | } |
1853 | 1853 | |
| 1854 | +/** @todo document */ |
| 1855 | +/* returns a dir="rtl" or dir="ltr" for the layout (eg: uselang) */ |
| 1856 | +function layoutdir() { |
| 1857 | + global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode; |
| 1858 | + $lang = ""; |
| 1859 | + $dir = ""; |
| 1860 | + if ( $wgLanguageCode != $wgContLanguageCode ) { |
| 1861 | + $lang = " lang='$wgLanguageCode'"; |
| 1862 | + } |
| 1863 | + if ( $wgLang->isRTL() != $wgContLang->isRTL() ) { |
| 1864 | + $dir = $wgLang->isRTL() ? " dir='rtl'" : " dir='ltr'"; |
| 1865 | + } |
| 1866 | + return $lang . $dir; |
| 1867 | +} |
| 1868 | + |
| 1869 | +/** @todo document */ |
| 1870 | +/* returns a dir="rtl" or dir="ltr" for the content (wiki lang) */ |
| 1871 | +function contentdir() { |
| 1872 | + global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode; |
| 1873 | + $lang = ""; |
| 1874 | + $dir = ""; |
| 1875 | + if ( $wgLanguageCode != $wgContLanguageCode ) { |
| 1876 | + $lang = " lang='$wgContLanguageCode'"; |
| 1877 | + } |
| 1878 | + if ( $wgLang->isRTL() != $wgContLang->isRTL() ) { |
| 1879 | + $dir = $wgContLang->isRTL() ? " dir='rtl'" : " dir='ltr'"; |
| 1880 | + } |
| 1881 | + return $lang . $dir; |
| 1882 | +} |
| 1883 | + |
1854 | 1884 | class ReplacerCallback { |
1855 | 1885 | function ReplacerCallback( $from, $to ) { |
1856 | 1886 | $this->from = $from; |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1313,7 +1313,10 @@ |
1314 | 1314 | $wgOut->addParserOutputNoText( $parserOutput ); |
1315 | 1315 | |
1316 | 1316 | wfProfileOut( $fname ); |
1317 | | - return $previewhead . $previewHTML; |
| 1317 | + return $previewhead . |
| 1318 | + '<div id="realContent"' . contentdir() . '>' . |
| 1319 | + $previewHTML . |
| 1320 | + '</div><!-- realContent -->'; |
1318 | 1321 | } |
1319 | 1322 | } |
1320 | 1323 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -332,7 +332,9 @@ |
333 | 333 | $text = $parserOutput->getText(); |
334 | 334 | wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) ); |
335 | 335 | $parserOutput->setText( $text ); |
| 336 | + $this->addHTML( '<div id="realContent"' . contentdir() . '>'); |
336 | 337 | $this->addHTML( $parserOutput->getText() ); |
| 338 | + $this->addHTML( '</div><!-- realContent -->'); |
337 | 339 | } |
338 | 340 | |
339 | 341 | /** |
— | — | @@ -385,7 +387,9 @@ |
386 | 388 | $this->mNewSectionLink = $parserOutput->getNewSection(); |
387 | 389 | $text = $parserOutput->getText(); |
388 | 390 | wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) ); |
| 391 | + $this->addHTML( '<div id="realContent"' . contentdir() . '>'); |
389 | 392 | $this->addHTML( $text ); |
| 393 | + $this->addHTML( '</div><!-- realContent -->'); |
390 | 394 | $t = $parserOutput->getTitleText(); |
391 | 395 | if( !empty( $t ) ) { |
392 | 396 | $this->setPageTitle( $t ); |
— | — | @@ -948,6 +952,7 @@ |
949 | 953 | function headElement() { |
950 | 954 | global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; |
951 | 955 | global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle; |
| 956 | + global $wgLang, $wgLanguageCode; |
952 | 957 | |
953 | 958 | if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) { |
954 | 959 | $ret = "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?>\n"; |
— | — | @@ -961,8 +966,8 @@ |
962 | 967 | $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() )); |
963 | 968 | } |
964 | 969 | |
965 | | - $rtl = $wgContLang->isRTL() ? " dir='RTL'" : ''; |
966 | | - $ret .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" $rtl>\n"; |
| 970 | + $rtl = $wgLang->isRTL() ? " dir='RTL'" : ''; |
| 971 | + $ret .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgLanguageCode\" lang=\"$wgLanguageCode\" $rtl>\n"; |
967 | 972 | $ret .= "<head>\n<title>" . htmlspecialchars( $this->getHTMLTitle() ) . "</title>\n"; |
968 | 973 | array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) ); |
969 | 974 | |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | */ |
136 | 136 | function outputPage( &$out ) { |
137 | 137 | global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut; |
138 | | - global $wgScript, $wgStylePath, $wgContLanguageCode; |
| 138 | + global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode; |
139 | 139 | global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; |
140 | 140 | global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks; |
141 | 141 | global $wgMaxCredits, $wgShowCreditsIfMax; |
— | — | @@ -247,8 +247,20 @@ |
248 | 248 | $tpl->setRef( 'stylepath', $wgStylePath ); |
249 | 249 | $tpl->setRef( 'logopath', $wgLogo ); |
250 | 250 | $tpl->setRef( "lang", $wgContLanguageCode ); |
251 | | - $tpl->set( 'dir', $wgContLang->isRTL() ? "rtl" : "ltr" ); |
252 | | - $tpl->set( 'rtl', $wgContLang->isRTL() ); |
| 251 | + $tpl->setRef( 'uselang', $wgLanguageCode ); |
| 252 | + $tpl->set( 'dir', $wgLang->isRTL() ? "rtl" : "ltr" ); |
| 253 | + $tpl->set( 'rtl', $wgLang->isRTL() ); |
| 254 | + /* display, if needed, dir=ltr or dir=rtl for the |
| 255 | + firstHeading title. This is when the title is |
| 256 | + content, eg a site-localized string; |
| 257 | + that is the case for all the pages not in Special: |
| 258 | + when action is view or history |
| 259 | + */ |
| 260 | + $tpl->set( 'titledir', |
| 261 | + ($this->mTitle->getNamespace() != NS_SPECIAL && |
| 262 | + ($action == 'view' || $action == 'history')) ? |
| 263 | + contentdir() : "" |
| 264 | + ); |
253 | 265 | $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) ); |
254 | 266 | $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) ); |
255 | 267 | $tpl->setRef( 'username', $this->username ); |
— | — | @@ -392,7 +404,7 @@ |
393 | 405 | $nt = Title::newFromText( $l ); |
394 | 406 | $language_urls[] = array( |
395 | 407 | 'href' => $nt->getFullURL(), |
396 | | - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), |
| 408 | + 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?$wgLang->getLanguageName( $nt->getInterwiki()) : $l), |
397 | 409 | 'class' => $class |
398 | 410 | ); |
399 | 411 | } |
— | — | @@ -887,7 +899,7 @@ |
888 | 900 | $fname = 'SkinTemplate::setupUserCss'; |
889 | 901 | wfProfileIn( $fname ); |
890 | 902 | |
891 | | - global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; |
| 903 | + global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgLang, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; |
892 | 904 | |
893 | 905 | $sitecss = ''; |
894 | 906 | $usercss = ''; |
— | — | @@ -911,7 +923,8 @@ |
912 | 924 | $siteargs .= '&ts=' . $wgUser->mTouched; |
913 | 925 | } |
914 | 926 | |
915 | | - if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n"; |
| 927 | + if ($wgLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n"; |
| 928 | + if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/content_rtl.css";' . "\n"; |
916 | 929 | |
917 | 930 | # If we use the site's dynamic CSS, throw that in, too |
918 | 931 | if ( $wgUseSiteCss ) { |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -297,11 +297,12 @@ |
298 | 298 | |
299 | 299 | # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way) |
300 | 300 | function getUserStylesheet() { |
301 | | - global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage; |
| 301 | + global $wgStylePath, $wgRequest, $wgLang, $wgContLang, $wgSquidMaxage; |
302 | 302 | $sheet = $this->getStylesheet(); |
303 | 303 | $action = $wgRequest->getText('action'); |
304 | 304 | $s = "@import \"$wgStylePath/$sheet\";\n"; |
305 | | - if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n"; |
| 305 | + if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n"; |
| 306 | + if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_content_rtl.css\";\n"; |
306 | 307 | |
307 | 308 | $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; |
308 | 309 | $s .= '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" . |
— | — | @@ -434,7 +435,7 @@ |
435 | 436 | } |
436 | 437 | |
437 | 438 | function doBeforeContent() { |
438 | | - global $wgContLang; |
| 439 | + global $wgLang; |
439 | 440 | $fname = 'Skin::doBeforeContent'; |
440 | 441 | wfProfileIn( $fname ); |
441 | 442 | |
— | — | @@ -455,7 +456,7 @@ |
456 | 457 | |
457 | 458 | $shove = ($qb != 0); |
458 | 459 | $left = ($qb == 1 || $qb == 3); |
459 | | - if($wgContLang->isRTL()) $left = !$left; |
| 460 | + if($wgLang->isRTL()) $left = !$left; |
460 | 461 | |
461 | 462 | if ( !$shove ) { |
462 | 463 | $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" . |
— | — | @@ -463,13 +464,13 @@ |
464 | 465 | } elseif( $left ) { |
465 | 466 | $s .= $this->getQuickbarCompensator( $rows ); |
466 | 467 | } |
467 | | - $l = $wgContLang->isRTL() ? 'right' : 'left'; |
| 468 | + $l = $wgLang->isRTL() ? 'right' : 'left'; |
468 | 469 | $s .= "<td {$borderhack} align='$l' valign='top'>\n"; |
469 | 470 | |
470 | 471 | $s .= $this->topLinks() ; |
471 | 472 | $s .= "<p class='subtitle'>" . $this->pageTitleLinks() . "</p>\n"; |
472 | 473 | |
473 | | - $r = $wgContLang->isRTL() ? "left" : "right"; |
| 474 | + $r = $wgLang->isRTL() ? "left" : "right"; |
474 | 475 | $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>"; |
475 | 476 | $s .= $this->nameAndLogin(); |
476 | 477 | $s .= "\n<br />" . $this->searchForm() . "</td>"; |
— | — | @@ -996,7 +997,7 @@ |
997 | 998 | if ( '' != $align ) { $a = " align='{$align}'"; } |
998 | 999 | else { $a = ''; } |
999 | 1000 | |
1000 | | - $mp = wfMsg( 'mainpage' ); |
| 1001 | + $mp = wfMsgForContent( 'mainpage' ); |
1001 | 1002 | $titleObj = Title::newFromText( $mp ); |
1002 | 1003 | if ( is_object( $titleObj ) ) { |
1003 | 1004 | $url = $titleObj->escapeLocalURL(); |
— | — | @@ -1251,7 +1252,7 @@ |
1252 | 1253 | } |
1253 | 1254 | |
1254 | 1255 | function otherLanguages() { |
1255 | | - global $wgOut, $wgContLang, $wgHideInterlanguageLinks; |
| 1256 | + global $wgOut, $wgLang, $wgHideInterlanguageLinks; |
1256 | 1257 | |
1257 | 1258 | if ( $wgHideInterlanguageLinks ) { |
1258 | 1259 | return ''; |
— | — | @@ -1264,20 +1265,20 @@ |
1265 | 1266 | |
1266 | 1267 | $s = wfMsg( 'otherlanguages' ) . ': '; |
1267 | 1268 | $first = true; |
1268 | | - if($wgContLang->isRTL()) $s .= '<span dir="LTR">'; |
| 1269 | + if($wgLang->isRTL()) $s .= '<span dir="LTR">'; |
1269 | 1270 | foreach( $a as $l ) { |
1270 | 1271 | if ( ! $first ) { $s .= ' | '; } |
1271 | 1272 | $first = false; |
1272 | 1273 | |
1273 | 1274 | $nt = Title::newFromText( $l ); |
1274 | 1275 | $url = $nt->escapeFullURL(); |
1275 | | - $text = $wgContLang->getLanguageName( $nt->getInterwiki() ); |
| 1276 | + $text = $wgLang->getLanguageName( $nt->getInterwiki() ); |
1276 | 1277 | |
1277 | 1278 | if ( '' == $text ) { $text = $l; } |
1278 | 1279 | $style = $this->getExternalLinkAttributes( $l, $text ); |
1279 | 1280 | $s .= "<a href=\"{$url}\"{$style}>{$text}</a>"; |
1280 | 1281 | } |
1281 | | - if($wgContLang->isRTL()) $s .= '</span>'; |
| 1282 | + if($wgLang->isRTL()) $s .= '</span>'; |
1282 | 1283 | return $s; |
1283 | 1284 | } |
1284 | 1285 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -391,8 +391,8 @@ |
392 | 392 | * (bug 6126) Allow fallback to customized primary language when user language |
393 | 393 | message contains '-'; fixes licenses selector on Commons configuration after |
394 | 394 | recent addition of the message to Messages.php |
| 395 | +* (bug 6100) BiDi: different directionality for user interface and wiki content |
395 | 396 | |
396 | | - |
397 | 397 | == Compatibility == |
398 | 398 | |
399 | 399 | MediaWiki 1.7 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. |