--- includes/templates/Userlogin.php_old 2006-05-27 19:30:51.000000000 +0200 +++ includes/templates/Userlogin.php 2006-05-28 13:56:57.000000000 +0200 @@ -34,14 +34,14 @@ - - @@ -54,7 +54,7 @@ ?> - - - '; + return ""; } /** @@ -212,7 +220,7 @@ * @param string $from list all pages from this name (default FALSE) */ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { - global $wgOut, $wgUser, $wgContLang; + global $wgOut, $wgUser, $wgLang, $wgContLang; $fname = 'indexShowChunk'; @@ -251,14 +259,23 @@ $out = '
+
+
msg( 'yourdomainname' ) ?>: + @@ -63,7 +63,7 @@
+ data['remember'] ) { ?>checked="checked" @@ -72,7 +72,7 @@
+  data['useemail'] ) { ?> @@ -109,14 +109,14 @@ - - @@ -129,7 +129,7 @@ ?> - - data['useemail'] ) { ?> - @@ -156,7 +156,7 @@ - @@ -164,7 +164,7 @@ - - \n"; @@ -998,7 +999,7 @@ if ( '' != $align ) { $a = " align='{$align}'"; } else { $a = ''; } - $mp = wfMsg( 'mainpage' ); + $mp = wfMsgForContent( 'mainpage' ); $titleObj = Title::newFromText( $mp ); if ( is_object( $titleObj ) ) { $url = $titleObj->escapeLocalURL(); @@ -1253,7 +1254,7 @@ } function otherLanguages() { - global $wgOut, $wgContLang, $wgHideInterlanguageLinks; + global $wgOut, $wgLang, $wgHideInterlanguageLinks; if ( $wgHideInterlanguageLinks ) { return ''; @@ -1266,20 +1267,20 @@ $s = wfMsg( 'otherlanguages' ) . ': '; $first = true; - if($wgContLang->isRTL()) $s .= ''; + if($wgLang->isRTL()) $s .= ''; foreach( $a as $l ) { if ( ! $first ) { $s .= ' | '; } $first = false; $nt = Title::newFromText( $l ); $url = $nt->escapeFullURL(); - $text = $wgContLang->getLanguageName( $nt->getInterwiki() ); + $text = $wgLang->getLanguageName( $nt->getInterwiki() ); if ( '' == $text ) { $text = $l; } $style = $this->getExternalLinkAttributes( $l, $text ); $s .= "{$text}"; } - if($wgContLang->isRTL()) $s .= ''; + if($wgLang->isRTL()) $s .= ''; return $s; } --- includes/SkinTemplate.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SkinTemplate.php 2006-05-27 19:38:33.000000000 +0200 @@ -134,7 +134,7 @@ */ function outputPage( &$out ) { global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut; - global $wgScript, $wgStylePath, $wgContLanguageCode; + global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode; global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks; global $wgMaxCredits, $wgShowCreditsIfMax; @@ -243,8 +243,20 @@ $tpl->setRef( 'stylepath', $wgStylePath ); $tpl->setRef( 'logopath', $wgLogo ); $tpl->setRef( "lang", $wgContLanguageCode ); - $tpl->set( 'dir', $wgContLang->isRTL() ? "rtl" : "ltr" ); - $tpl->set( 'rtl', $wgContLang->isRTL() ); + $tpl->setRef( 'uselang', $wgLanguageCode ); + $tpl->set( 'dir', $wgLang->isRTL() ? "rtl" : "ltr" ); + $tpl->set( 'rtl', $wgLang->isRTL() ); + /* display, if needed, dir=ltr or dir=rtl for the + firstHeading title. This is when the title is + content, eg a site-localized string; + that is the case for all the pages not in Special: + when action is view or history + */ + $tpl->set( 'titledir', + ($this->mTitle->getNamespace() != NS_SPECIAL && + ($action == 'view' || $action == 'history')) ? + contentdir() : "" + ); $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) ); $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) ); $tpl->setRef( 'username', $this->username ); @@ -388,7 +400,7 @@ $nt = Title::newFromText( $l ); $language_urls[] = array( 'href' => $nt->getFullURL(), - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), + 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?$wgLang->getLanguageName( $nt->getInterwiki()) : $l), 'class' => $class ); } @@ -883,7 +895,7 @@ $fname = 'SkinTemplate::setupUserCss'; wfProfileIn( $fname ); - global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; + global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgLang, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; $sitecss = ''; $usercss = ''; @@ -907,7 +919,8 @@ $siteargs .= '&ts=' . $wgUser->mTouched; } - if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n"; + if ($wgLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n"; + if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/content_rtl.css";' . "\n"; # If we use the site's dynamic CSS, throw that in, too if ( $wgUseSiteCss ) { --- includes/SpecialAllpages.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialAllpages.php 2006-05-28 14:32:35.000000000 +0200 @@ -50,7 +50,7 @@ * @param string $from Article name we are starting listing at. */ function namespaceForm ( $namespace = NS_MAIN, $from = '' ) { - global $wgScript; + global $wgScript, $wgLang; $t = Title::makeTitle( NS_SPECIAL, $this->name ); $namespaceselect = HTMLnamespaceselector($namespace, null); @@ -59,17 +59,19 @@ . htmlspecialchars ( $from ) . '"/>'; $submitbutton = ''; + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; $out = "
"; $out .= ''; $out .= "
+
+
msg( 'yourdomainname' ) ?>: + @@ -138,7 +138,7 @@
+ @@ -147,7 +147,7 @@
+
+
+ data['remember'] ) { ?>checked="checked" @@ -173,7 +173,7 @@
+ data['createemail'] ) { ?> --- includes/OutputPage.php_old 2006-05-25 13:34:53.000000000 +0200 +++ includes/OutputPage.php 2006-05-27 03:33:38.000000000 +0200 @@ -332,7 +332,9 @@ $text = $parserOutput->getText(); wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) ); $parserOutput->setText( $text ); + $this->addHTML( '
'); $this->addHTML( $parserOutput->getText() ); + $this->addHTML( '
'); } /** @@ -385,7 +387,9 @@ $this->mNewSectionLink = $parserOutput->getNewSection(); $text = $parserOutput->getText(); wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) ); + $this->addHTML( '
'); $this->addHTML( $text ); + $this->addHTML( '
'); $t = $parserOutput->getTitleText(); if( !empty( $t ) ) { $this->setPageTitle( $t ); @@ -948,6 +952,7 @@ function headElement() { global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle; + global $wgLang, $wgLanguageCode; if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) { $ret = "\n"; @@ -961,8 +966,8 @@ $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() )); } - $rtl = $wgContLang->isRTL() ? " dir='RTL'" : ''; - $ret .= "\n"; + $rtl = $wgLang->isRTL() ? " dir='RTL'" : ''; + $ret .= "\n"; $ret .= "\n" . htmlspecialchars( $this->getHTMLTitle() ) . "\n"; array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) ); --- includes/GlobalFunctions.php_old 2006-05-25 13:43:56.000000000 +0200 +++ includes/GlobalFunctions.php 2006-05-27 17:54:19.000000000 +0200 @@ -1631,8 +1631,12 @@ } function wfSpecialList( $page, $details ) { - global $wgContLang; - $details = $details ? ' ' . $wgContLang->getDirMark() . "($details)" : ""; + global $wgLang, $wgContLang; + + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $page = "$page"; + } + $details = $details ? ' ' . $wgLang->getDirMark() . "($details)" : ""; return $page . $details; } @@ -1833,6 +1837,36 @@ return $items; } +/** @todo document */ +/* returns a dir="rtl" or dir="ltr" for the layout (eg: uselang) */ +function layoutdir() { + global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode; + $lang = ""; + $dir = ""; + if ( $wgLanguageCode != $wgContLanguageCode ) { + $lang = " lang='$wgLanguageCode'"; + } + if ( $wgLang->isRTL() != $wgContLang->isRTL() ) { + $dir = $wgLang->isRTL() ? " dir='rtl'" : " dir='ltr'"; + } + return $lang . $dir; +} + +/** @todo document */ +/* returns a dir="rtl" or dir="ltr" for the content (wiki lang) */ +function contentdir() { + global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode; + $lang = ""; + $dir = ""; + if ( $wgLanguageCode != $wgContLanguageCode ) { + $lang = " lang='$wgContLanguageCode'"; + } + if ( $wgLang->isRTL() != $wgContLang->isRTL() ) { + $dir = $wgContLang->isRTL() ? " dir='rtl'" : " dir='ltr'"; + } + return $lang . $dir; +} + class ReplacerCallback { function ReplacerCallback( $from, $to ) { $this->from = $from; --- includes/Article.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/Article.php 2006-05-27 03:28:58.000000000 +0200 @@ -734,7 +734,7 @@ * the given title. */ function view() { - global $wgUser, $wgOut, $wgRequest, $wgContLang; + global $wgUser, $wgOut, $wgRequest, $wgLang; global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser; global $wgUseTrackbacks; $sk = $wgUser->getSkin(); @@ -891,7 +891,7 @@ $wgOut->addHTML( '
'.htmlspecialchars($this->mContent)."\n
" ); } else if ( $rt = Title::newFromRedirect( $text ) ) { # Display redirect - $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; + $imageDir = $wgLang->isRTL() ? 'rtl' : 'ltr'; $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png'; # Don't overwrite the subtitle if this was an old revision if( !$wasRedirected && $this->isCurrent() ) { --- includes/ChangesList.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/ChangesList.php 2006-05-28 23:10:03.000000000 +0200 @@ -168,10 +168,18 @@ $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW ) ? 'rcid='.$rc->mAttribs['rc_id'] : ''; - $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params ); + $articlelink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params ); if($watched) $articlelink = ''.$articlelink.''; + # if directionality differe; put a span around article link + # to force into wiki directionality, so articles starting with + # non alphabetic chars display properly + global $wgLang, $wgContLang; + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $articlelink = "" . + $articlelink . ""; + } - $s .= ' '.$articlelink; + $s .= ' ' . $articlelink; } function insertTimestamp(&$s, &$rc) { @@ -183,6 +191,11 @@ /** Insert links to user page, user talk page and eventually a blocking link */ function insertUserRelatedLinks(&$s, &$rc) { $s .= $this->skin->userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); + // this undoes any direction formating char that + // may be present in the previous string (user name), + // so avoinding vandalization of change lists by the + // creation of such user names + $s .= '‬'; $s .= $this->skin->userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); } @@ -215,7 +228,10 @@ * Format a line using the old system (aka without any javascript). */ function recentChangesLine( &$rc, $watched = false ) { - global $wgContLang; + global $wgLang, $wgContLang; + + // to keep text in correct direction + $dirmark = $wgLang->getDirMark(); $fname = 'ChangesList::recentChangesLineOld'; wfProfileIn( $fname ); @@ -230,7 +246,7 @@ $this->insertDateHeader($s,$rc_timestamp); - $s .= '
  • '; + $s .= '
  • ' . $dirmark; // moved pages if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { @@ -245,7 +261,9 @@ $this->insertDiffHist($s, $rc, $unpatrolled); # M, N and ! (minor, new and unpatrolled) + $s .= $dirmark; $s .= ' ' . $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '' ); + $s .= $dirmark; $this->insertArticleLink($s, $rc, $unpatrolled, $watched); wfProfileOut($fname.'-page'); @@ -253,14 +271,24 @@ wfProfileIn( $fname.'-rest' ); + // this undoes any direction formating char that + // may be present in the previous string (article title), + // so avoinding vandalization of change lists by the + // creation of such titled articles + $s .= '‬'; + $s .= $dirmark; $this->insertTimestamp($s,$rc); + $s .= $dirmark; $this->insertUserRelatedLinks($s,$rc); + $s .= $dirmark; $this->insertComment($s, $rc); if($rc->numberofWatchingusers > 0) { + $s .= $dirmark; $s .= ' ' . wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rc->numberofWatchingusers)); } + $s .= $dirmark; $s .= "
  • \n"; wfProfileOut( $fname.'-rest' ); @@ -535,8 +563,8 @@ * @access private */ function sideArrow() { - global $wgContLang; - $dir = $wgContLang->isRTL() ? 'l' : 'r'; + global $wgLang; + $dir = $wgLang->isRTL() ? 'l' : 'r'; return $this->arrow( $dir, '+' ); } --- includes/EditPage.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/EditPage.php 2006-05-26 20:55:32.000000000 +0200 @@ -1305,7 +1305,10 @@ $wgOut->addParserOutputNoText( $parserOutput ); wfProfileOut( $fname ); - return $previewhead . $previewHTML; + return $previewhead . + '
    ' . + $previewHTML . + '
    '; } } --- includes/ImagePage.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/ImagePage.php 2006-05-28 15:37:14.000000000 +0200 @@ -166,6 +166,7 @@ function openShowImage() { global $wgOut, $wgUser, $wgImageLimits, $wgRequest, $wgUseImageResize; + global $wgLang; $full_url = $this->img->getURL(); $anchoropen = ''; @@ -252,18 +253,19 @@ } + $dirmark = $wgLang->getDirMark(); if ($showLink) { $filename = wfEscapeWikiText( $this->img->getName() ); $info = wfMsg( 'fileinfo', ceil($this->img->getSize()/1024.0), - $this->img->getMimeType() ); + $dirmark . $this->img->getMimeType() ); if (!$this->img->isSafeFile()) { $warning = wfMsg( 'mediawarning' ); $wgOut->addWikiText( << [[Media:$filename|$filename]] - ($info) + {$dirmark}($info)
    $warning
    @@ -272,7 +274,8 @@ } else { $wgOut->addWikiText( << -[[Media:$filename|$filename]] ($info) +[[Media:$filename|$filename]] + {$dirmark}($info) END ); @@ -724,6 +727,7 @@ $del = wfMsg( 'deleteimg' ); $delall = wfMsg( 'deleteimgcompletely' ); $cur = wfMsg( 'cur' ); + $dirmark = $wgLang->getDirMark(); if ( $iscur ) { $url = Image::imageUrl( $img ); @@ -759,15 +763,15 @@ $userlink = $usertext; } else { $userlink = $this->skin->makeLinkObj( Title::makeTitle( NS_USER, $usertext ), $usertext ); - $usertalk = $this->skin->makeLinkObj( Title::makeTitle( NS_USER_TALK, $usertext), $wgContLang->getNsText( NS_TALK ) ); - $userdata = $userlink . ' (' . $usertalk . ')'; + $usertalk = $this->skin->makeLinkObj( Title::makeTitle( NS_USER_TALK, $usertext), $wgLang->getNsText( NS_TALK ) ); + $userdata = $userlink . " {$dirmark}(" . $usertalk . ')'; } $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $size ) ); $widthheight = wfMsg( 'widthheight', $width, $height ); $style = $this->skin->getInternalLinkAttributes( $url, $datetime ); - $s = "
  • ({$dlink}) ({$rlink}) {$datetime} . . {$userdata} . . {$widthheight} ({$nbytes})"; + $s = "
  • {$dirmark}({$dlink}) {$dirmark}({$rlink}) {$dirmark}{$datetime} . . {$dirmark}{$userdata} . . {$dirmark}{$widthheight} {$dirmark}({$nbytes}){$dirmark}"; $s .= $this->skin->commentBlock( $description, $wgTitle ); $s .= "
  • \n"; --- includes/Skin.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/Skin.php 2006-05-27 03:43:31.000000000 +0200 @@ -297,11 +297,12 @@ # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way) function getUserStylesheet() { - global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage; + global $wgStylePath, $wgRequest, $wgLang, $wgContLang, $wgSquidMaxage; $sheet = $this->getStylesheet(); $action = $wgRequest->getText('action'); $s = "@import \"$wgStylePath/$sheet\";\n"; - if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n"; + if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n"; + if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_content_rtl.css\";\n"; $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; $s .= '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" . @@ -436,7 +437,7 @@ } function doBeforeContent() { - global $wgContLang; + global $wgLang; $fname = 'Skin::doBeforeContent'; wfProfileIn( $fname ); @@ -457,7 +458,7 @@ $shove = ($qb != 0); $left = ($qb == 1 || $qb == 3); - if($wgContLang->isRTL()) $left = !$left; + if($wgLang->isRTL()) $left = !$left; if ( !$shove ) { $s .= "
    \n" . @@ -465,13 +466,13 @@ } elseif( $left ) { $s .= $this->getQuickbarCompensator( $rows ); } - $l = $wgContLang->isRTL() ? 'right' : 'left'; + $l = $wgLang->isRTL() ? 'right' : 'left'; $s .= "\n"; $s .= $this->topLinks() ; $s .= "

    " . $this->pageTitleLinks() . "

    \n"; - $r = $wgContLang->isRTL() ? "left" : "right"; + $r = $wgLang->isRTL() ? "left" : "right"; $s .= "
    "; $s .= $this->nameAndLogin(); $s .= "\n
    " . $this->searchForm() . "
    - - + + - - + @@ -171,9 +173,12 @@ } else { $morelinks = ''; if ( $morelinks != '' ) { + global $wgLang; + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; $out2 = '
    " . wfMsgHtml($this->nsfromMsg) . "" . wfMsgHtml($this->nsfromMsg) . "
    + $namespaceselect $submitbutton
    '; - $out2 .= '
    ' . $nsForm; - $out2 .= ''; + $out2 .= "
    " . $nsForm; + $out2 .= ""; $out2 .= $morelinks . '

    '; } else { $out2 = $nsForm . '
    '; @@ -189,7 +194,7 @@ * @param integer $namespace (Default NS_MAIN) */ function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { - global $wgUser; + global $wgUser, $wgLang; $sk = $wgUser->getSkin(); $dbr =& wfGetDB( DB_SLAVE ); @@ -199,12 +204,15 @@ $special = Title::makeTitle( NS_SPECIAL, $this->name . '/' . $inpoint ); $link = $special->escapeLocalUrl( $queryparams ); + $dir = contentdir(); + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; $out = wfMsgHtml( 'alphaindexline', - "$inpointf
    ", - "$outpointf" + "$inpointf", + "$outpointf" ); - return '
    '.$out.'
    $out
    '; $namespaces = $wgContLang->getFormattedNamespaces(); + + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $spandiropen = ""; + $spandirclose = ""; + } else { + $spandiropen = ''; + $spandirclose = ''; + } + while( ($n < $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { - $link = ($s->page_is_redirect ? '
    ' : '' ) . + $link = ($s->page_is_redirect ? '
    ' : '' ) . $spandiropen . $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . - ($s->page_is_redirect ? '
    ' : '' ); + ($s->page_is_redirect ? '
    ' : '' ) . $spandirclose; } else { - $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; + $link = $spandiropen . '[[' . htmlspecialchars( $s->page_title ) . ']]' . $spandirclose; } if( $n % 3 == 0 ) { $out .= '
    '; @@ -278,10 +295,13 @@ if ( $including ) { $out2 = ''; } else { + global $wgLang; $nsForm = $this->namespaceForm ( $namespace, $from ); + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; $out2 = '
    '; - $out2 .= '
    ' . $nsForm; - $out2 .= '' . + $out2 .= "
    " . $nsForm; + $out2 .= "" . $sk->makeKnownLink( $wgContLang->specialPage( "Allpages" ), wfMsgHtml ( 'allpages' ) ); if ( ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { --- includes/SpecialBlockip.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialBlockip.php 2006-05-27 19:01:21.000000000 +0200 @@ -49,10 +49,13 @@ } function showForm( $err ) { - global $wgOut, $wgUser, $wgSysopUserBans; + global $wgOut, $wgUser, $wgSysopUserBans, $wgLang; $wgOut->setPagetitle( wfMsg( 'blockip' ) ); $wgOut->addWikiText( wfMsg( 'blockiptext' ) ); + + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; if($wgSysopUserBans) { $mIpaddress = wfMsgHtml( 'ipadressorusername' ); @@ -100,16 +103,16 @@ - - + "); if ($showblockoptions) { $wgOut->addHTML(" - - + - - + - - + - --- includes/SpecialBrokenRedirects.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialBrokenRedirects.php 2006-05-28 16:34:26.000000000 +0200 @@ -51,6 +51,8 @@ } function formatResult( $skin, $result ) { + global $wgLang, $wgContLang; + $fromObj = Title::makeTitle( $result->namespace, $result->title ); if ( isset( $result->pl_title ) ) { $toObj = Title::makeTitle( $result->pl_namespace, $result->pl_title ); @@ -72,7 +74,22 @@ $edit = $skin->makeBrokenLinkObj( $fromObj , "(".wfMsg("qbedit").")" , 'redirect=no'); $to = $skin->makeBrokenLinkObj( $toObj ); - return "$from $edit → $to"; + $dirmark = $wgLang->getDirMark(); + // is using ascii arrow on purpose? + // if not, the unicode arrow below can be used + $arr = "=>"; + //# Check the language; RTL wikis need a ← + //$arr = $wgLang->isRTL() ? '←' : '→'; + # if directionality is different, put around + # the article names links + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $from = "" . + $from . ""; + $to = "" . + $to . ""; + } + + return "{$from} {$dirmark}{$edit} {$dirmark}{$arr} {$to}"; } } --- includes/SpecialDisambiguations.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialDisambiguations.php 2006-05-28 16:30:28.000000000 +0200 @@ -62,6 +62,8 @@ } function formatResult( $skin, $result ) { + global $wgLang, $wgContLang; + $title = Title::newFromId( $result->value ); $dp = Title::makeTitle( $result->namespace, $result->title ); @@ -69,7 +71,19 @@ $edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no'); $to = $skin->makeKnownLinkObj( $dp,''); - return "$from $edit => $to"; + $dirmark = $wgLang->getDirMark(); + # Check the language; RTL wikis need a ← + $arr = $wgLang->isRTL() ? '←' : '→'; + # if directionality is different, put around + # the article names links + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $from = "" . + $from . ""; + $to = "" . + $to . ""; + } + + return "{$from} {$dirmark}{$edit} {$dirmark}{$arr} {$to}"; } } --- includes/SpecialDoubleRedirects.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialDoubleRedirects.php 2006-05-28 16:10:17.000000000 +0200 @@ -67,7 +67,7 @@ } function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang, $wgContLang; $fname = 'DoubleRedirectsPage::formatResult'; $titleA = Title::makeTitle( $result->namespace, $result->title ); @@ -92,9 +92,19 @@ $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsg("qbedit").")" , 'redirect=no'); $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' ); $linkC = $skin->makeKnownLinkObj( $titleC ); - $arr = $wgContLang->isRTL() ? '←' : '→'; - return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); + $dirmark = $wgLang->getDirMark(); + # Check the language; RTL wikis need a ← + $arr = $wgLang->isRTL() ? '←' : '→'; + # if directionality is different, put around + # the article names links + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $linkA = "" . $linkA . ""; + $linkB = "" . $linkB . ""; + $linkC = "" . $linkC . ""; + } + + return( "{$linkA} {$dirmark}{$edit} {$dirmark}{$arr} {$linkB} {$dirmark}{$arr} {$linkC}" ); } } --- includes/SpecialImagelist.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialImagelist.php 2006-05-28 21:57:18.000000000 +0200 @@ -86,6 +86,9 @@ $wgOut->addHTML( '

    ' ); $res = $dbr->query( $sql, "wfSpecialImagelist" ); + $dirmark = $wgLang->getDirMark(); // to keep text in correct direction + $dir = contentdir(); + while ( $s = $dbr->fetchObject( $res ) ) { $name = $s->img_name; $ut = $s->img_user_text; @@ -95,7 +98,6 @@ $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut ); } - $dirmark = $wgContLang->getDirMark(); // to keep text in correct direction $ilink = "" . strtr(htmlspecialchars( $name ), '_', ' ') . ""; @@ -108,8 +110,8 @@ $date = $wgLang->timeanddate( $s->img_timestamp, true ); $comment = $sk->commentBlock( $s->img_description ); - - $l = "({$desc}) {$dirmark}{$ilink} . . {$dirmark}{$nb} . . {$dirmark}{$ul}". + + $l = "({$desc}) {$dirmark}{$ilink} . . {$dirmark}{$nb} . . {$dirmark}{$ul}". " . . {$dirmark}{$date} . . {$dirmark}{$comment}
    \n"; $wgOut->addHTML( $l ); } --- includes/SpecialListredirects.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialListredirects.php 2006-05-28 16:21:34.000000000 +0200 @@ -31,7 +31,7 @@ } function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang, $wgContLang; # Make a link to the redirect itself $rd_title = Title::makeTitle( $result->namespace, $result->title ); @@ -54,7 +54,15 @@ } # Check the language; RTL wikis need a ← - $arr = $wgContLang->isRTL() ? ' ← ' : ' → '; + $arr = $wgLang->isRTL() ? ' ‏← ' : ' ‎→ '; + # if directionality is different, put around + # the article names links + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $rd_link = "" . + $rd_link . ""; + $targetLink = "" . + $targetLink . ""; + } # Format the whole thing and return it return( $rd_link . $arr . $targetLink ); @@ -69,4 +77,4 @@ $lrp->doQuery( $offset, $limit ); } -?> \ Pas de fin de ligne à la fin du fichier. +?> --- includes/SpecialLog.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialLog.php 2006-05-27 18:40:48.000000000 +0200 @@ -333,7 +333,8 @@ } $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true ); - $out = "

  • $time $userLink $action $comment $revert
  • \n"; + $dirmark = $wgLang->getDirMark(); + $out = "
  • {$time} {$dirmark}{$userLink} {$dirmark}{$action} {$dirmark}{$comment} {$dirmark}{$revert}
  • \n"; return $out; } --- includes/SpecialNewpages.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialNewpages.php 2006-05-27 18:42:47.000000000 +0200 @@ -72,10 +72,10 @@ } function formatResult( $skin, $result ) { - global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol; + global $wgLang, $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol; $u = $result->user; $ut = $result->user_text; - $dirmark = $wgContLang->getDirMark(); // To keep text in correct order + $dirmark = $wgLang->getDirMark(); // To keep text in correct order $length = wfMsgExt( 'nbytes', array('parsemag', 'escape'), $wgLang->formatNum( $result->length ) ); @@ -92,6 +92,9 @@ $userLink = $skin->userLink( $u, $ut ); $userTools = $skin->userToolLinks( $u, $ut ); + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $link = "$link"; + } $s = "{$d} {$dirmark}{$link} {$dirmark}({$length}) . . " . "{$dirmark}{$userLink}{$dirmark}{$userTools}"; --- includes/SpecialPreferences.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialPreferences.php 2006-05-28 17:26:07.000000000 +0200 @@ -386,12 +386,14 @@ * @access private */ function namespacesCheckboxes() { - global $wgContLang; + global $wgLang, $wgContLang; # Determine namespace checkboxes $namespaces = $wgContLang->getNamespaces(); $r1 = null; + $dirmark = $wgLang->getDirMark(); + foreach ( $namespaces as $i => $name ) { if ($i < 0) continue; @@ -401,7 +403,7 @@ if ( empty($name) ) $name = wfMsg( 'blanknamespace' ); - $r1 .= "
    \n"; + $r1 .= " {$dirmark}
    \n"; } return $r1; } @@ -437,7 +439,12 @@ } function addRow($td1, $td2) { - return "
    "; + global $wgLang; + if ($wgLang->isRTL()) { + return ""; + } else { + return ""; + } } /** --- includes/SpecialPrefixindex.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialPrefixindex.php 2006-05-28 14:29:21.000000000 +0200 @@ -52,7 +52,7 @@ * @param string $from list all pages from this name (default FALSE) */ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { - global $wgOut, $wgUser, $wgContLang; + global $wgOut, $wgUser, $wgLang, $wgContLang; $fname = 'indexShowChunk'; @@ -87,14 +87,23 @@ $out = '
    {$mIpaddress}: + {$mIpaddress}:
    {$mIpbexpiry}: + {$mIpbexpiry}: @@ -119,20 +122,20 @@ $wgOut->addHTML("
    {$mIpbother}: + {$mIpbother}:
    {$mIpbreason}: + {$mIpbreason}:
      +
    $td1$td2
    $td1$td2
    $td1$td2
    '; $namespaces = $wgContLang->getFormattedNamespaces(); + + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $spandiropen = ""; + $spandirclose = ""; + } else { + $spandiropen = ''; + $spandirclose = ''; + } + while( ($n < $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { - $link = ($s->page_is_redirect ? '
    ' : '' ) . + $link = ($s->page_is_redirect ? '
    ' : '' ) . $spandiropen . $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . - ($s->page_is_redirect ? '
    ' : '' ); + ($s->page_is_redirect ? '
    ' : '' ) . $spandirclose; } else { - $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; + $link = $spandiropen . '[[' . htmlspecialchars( $s->page_title ) . ']]' . $spandirclose; } if( $n % 3 == 0 ) { $out .= '
    '; --- includes/SpecialShortpages.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialShortpages.php 2006-05-27 18:43:18.000000000 +0200 @@ -58,7 +58,10 @@ $title = Title::makeTitle( $result->namespace, $result->title ); $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); $histlink = $skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' ); - $dirmark = $wgContLang->getDirMark(); + $dirmark = $wgLang->getDirMark(); + if ($wgLang->isRTL() != $wgContLang->isRTL()) { + $link = "$link"; + } return "({$histlink}) {$dirmark}$link {$dirmark}({$nb})"; } --- includes/SpecialUnusedimages.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialUnusedimages.php 2006-05-27 18:49:08.000000000 +0200 @@ -48,14 +48,16 @@ $title = Title::makeTitle( NS_IMAGE, $result->title ); $imageUrl = htmlspecialchars( Image::imageUrl( $result->title ) ); - $dirmark = $wgContLang->getDirMark(); // To keep text in correct order + $dirmark = $wgLang->getDirMark(); // To keep text in correct order + $dir = ($wgLang->isRTL() != $wgContLang->isRTL()) ? + contentdir() : ""; $return = # The 'desc' linking to the image page '('.$skin->makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark . # Link to the image itself - '' . htmlspecialchars( $title->getText() ) . + '' . htmlspecialchars( $title->getText() ) . ' . . ' . $dirmark . # Last modified date --- includes/SpecialUpload.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialUpload.php 2006-05-27 18:15:52.000000000 +0200 @@ -514,6 +514,7 @@ function uploadWarning( $warning ) { global $wgOut; global $wgUseCopyrightUpload; + global $wgLang; $this->mSessionKey = $this->stashSession(); if( !$this->mSessionKey ) { @@ -531,6 +532,8 @@ $titleObj = Title::makeTitle( NS_SPECIAL, 'Upload' ); $action = $titleObj->escapeLocalURL( 'action=submit' ); + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; if ( $wgUseCopyrightUpload ) { $copyright = " @@ -553,16 +556,16 @@
    - - + - - +
    + $iw$iw
    + $reup$reup
    \n" ); @@ -578,6 +581,7 @@ function mainUploadForm( $msg='' ) { global $wgOut, $wgUser; global $wgUseCopyrightUpload; + global $wgLang; $cols = intval($wgUser->getOption( 'cols' )); $ew = $wgUser->getOption( 'editwidth' ); @@ -616,24 +620,26 @@ ? 'checked="checked"' : ''; + $left = ($wgLang->isRTL()) ? "right" : "left"; + $right = ($wgLang->isRTL()) ? "left" : "right"; $wgOut->addHTML( "
    - - + - - + - - + @@ -642,8 +648,8 @@ if ( $licenseshtml != '' ) { global $wgStylePath; $wgOut->addHTML( " - - + + - + @@ -689,12 +695,12 @@ - + -
    + mDestFile?"":"onchange='fillDestFilename()' ") . "size='40' />
    +
    +
    +
    + " ); $wgOut->addWikiText( wfMsgForContent( 'edittools' ) ); $wgOut->addHTML( " --- includes/SpecialWatchlist.php_old 2006-05-25 05:40:57.000000000 +0200 +++ includes/SpecialWatchlist.php 2006-05-28 22:01:52.000000000 +0200 @@ -195,6 +195,10 @@ while( $s = $dbr->fetchObject( $res ) ) { $list[$s->wl_namespace][$s->wl_title] = $s->page_is_redirect; } + + $dirmark = $wgLang->getDirMark(); + $dir = ($wgLang->isRTL() != $wgContLang->isRTL()) ? + contentdir() : ""; // TODO: Display a TOC foreach($list as $ns => $titles) { @@ -211,7 +215,6 @@ htmlspecialchars( $s->wl_title ) . '" in namespace ' . $s->wl_namespace . " -->\n" ); } else { - global $wgContLang; $toolLinks = array(); $titleText = $titleObj->getPrefixedText(); $pageLink = $sk->makeLinkObj( $titleObj ); @@ -219,15 +222,16 @@ if( $titleObj->exists() ) $toolLinks[] = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' ); $toolLinks = '(' . implode( ' | ', $toolLinks ) . ')'; - $checkbox = ' ' . ( $wgContLang->isRTL() ? '‏' : '‎' ); + $checkbox = ' '; if( $redir ) { - $spanopen = ''; + $spanopen = ''; $spanclosed = ''; } else { - $spanopen = $spanclosed = ''; + $spanopen = ($dir) ? '' : ''; + $spanclosed = ($dir) ? '' : ''; } - $wgOut->addHTML( "
  • {$checkbox}{$spanopen}{$pageLink}{$spanclosed} {$toolLinks}
  • \n" ); + $wgOut->addHTML( "
  • {$checkbox}{$dirmark}{$spanopen}{$pageLink}{$spanclosed} {$dirmark}{$toolLinks}
  • \n" ); } } $wgOut->addHTML( '' ); --- skins/monobook/rtl.css_old 2006-05-26 17:15:47.000000000 +0200 +++ skins/monobook/rtl.css 2006-05-27 16:23:30.000000000 +0200 @@ -52,19 +52,11 @@ } /* Fix alignment */ -.documentByLine, .portletDetails, .portletMore, #p-personal { text-align: left; } - -div div.thumbcaption { - text-align: right; -} - -div.magnify, -#div.townBox, #p-logo { left: auto; right: 0; @@ -73,7 +65,20 @@ left: auto; right: 0; } +#p-navigation .pBody { + padding-right: auto; +} +/* the icon in front of the user name, single quotes +in bg url to hide it from iemac */ +li#pt-userpage, +li#pt-anonuserpage, +li#pt-login { + background: url(user.gif) top right no-repeat; + padding-left: 0px; + padding-right: 20px; + text-transform: none; +} #p-cactions { left: auto; right: 11.5em; @@ -104,15 +109,15 @@ /* Fix margins for non-css2 browsers */ /* top right bottom left */ -ul { +.portlet ul { margin-left: 0; margin-right: 1.5em; } -ol { +.portlet ol { margin-left: 0; margin-right: 2.4em; } -dd { +.portlet dd { margin-left: 0; margin-right: 1.6em; } @@ -120,24 +125,6 @@ margin-right: 1em; margin-left: 0; } -.tocindent { - margin-left: 0; - margin-right: 2em; -} -div.tright, div.floatright, table.floatright { - clear: none; -} -div.tleft, div.floatleft, table.floatleft { - clear: left; -} -div.townBox { - margin-left: 0; - margin-right: 1em; -} -div.townBox dl dd { - margin-left: 0; - margin-right: 1.1em; -} #p-personal li { margin-left: 0; margin-right: 1em; @@ -152,11 +139,6 @@ #p-personal li { float: left; } -/* Fix link icons */ -.external { - padding: 0 !important; - background: none !important; -} #footer { clear: both; } @@ -191,16 +173,6 @@ padding-right: 2em; } -/* workaround for moz bug, displayed bullets on left side */ - -#toc ul { - text-align: right; -} - -#toc ul ul { - margin: 0 2em 0 0; -} - input#wpSave, input#wpDiff { margin-right: 0; margin-left: .33em; --- skins/monobook/content_rtl.css_old 2006-05-26 16:01:20.000000000 +0200 +++ skins/monobook/content_rtl.css 2006-05-26 19:52:06.000000000 +0200 @@ -0,0 +1,100 @@ +/* +Right-to-left fixes for MonoBook. +Places sidebar on right, tweaks various alignment issues. + +Works mostly ok nicely on Safari 1.2.1; fine in Mozilla. + +Safari bugs (1.2.1): +* Tabs are still appearing in left-to-right order. (Try after localizing) + +Opera bugs (7.23 linux): +* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other + +IE/mac bugs: +* The thing barfs on Hebrew and Arabic anyway, so no point testing. + +Missing features due to lack of support: +* external link icons + +To test: +* Opera6 +* IE 5.0 +* etc + +*/ +#realContent { + direction: rtl; +/* unicode-bidi: bidi-override;*/ + unicode-bidi: embed; +} + +/* Fix alignment */ +.documentByLine { + text-align: left; +} + +div div.thumbcaption { + text-align: right; +} + +div.magnify, +#div.townBox { + left: auto; + right: 0; +} + +/* Fix margins for non-css2 browsers */ +/* top right bottom left */ + +ul { + margin-left: 0; + margin-right: 1.5em; +} +ol { + margin-left: 0; + margin-right: 2.4em; +} +dd { + margin-left: 0; + margin-right: 1.6em; +} +/* ??? */ +li { + margin-left: 0; + margin-right: 2.4em; +} +.tocindent { + margin-left: 0; + margin-right: 2em; +} +div.tright, div.floatright, table.floatright { + clear: none; +} +div.tleft, div.floatleft, table.floatleft { + clear: left; +} +div.townBox { + margin-left: 0; + margin-right: 1em; +} +div.townBox dl dd { + margin-left: 0; + margin-right: 1.1em; +} +/* Fix link icons */ +.external { + padding: 0 !important; + background: none !important; +} + + + +/* workaround for moz bug, displayed bullets on left side */ + +#toc ul { + text-align: right; +} + +#toc ul ul { + margin: 0 2em 0 0; +} --- skins/monobook/main.css_old 2006-05-26 17:38:55.000000000 +0200 +++ skins/monobook/main.css 2006-05-28 21:47:03.000000000 +0200 @@ -569,7 +569,7 @@ ** keep the whitespace in front of the ^=, hides rule from konqueror ** this is css3, the validator doesn't like it when validating as css2 */ -#bodyContent a.external, +#bodyContent a.external[DIR="ltr"], #bodyContent a[href ^="gopher://"] { background: url(external.png) center right no-repeat; padding-right: 13px; @@ -676,6 +676,8 @@ list-style-type: square; list-style-image: url(bullet.gif); font-size: 95%; + margin: .3em 0 0 1.5em; + padding: 0; } .portlet li { padding: 0; @@ -718,7 +720,7 @@ } #p-navigation .pBody { - padding-right: 0; +/* padding-right: 0; */ } #p-navigation a { --- skins/common/common_content_rtl.css_old 2006-05-26 15:59:42.000000000 +0200 +++ skins/common/common_content_rtl.css 2006-05-26 18:42:41.000000000 +0200 @@ -0,0 +1 @@ +/* RTL specific styles for date content (not layout) go here */ --- skins/MonoBook.php_old 2006-05-25 13:58:46.000000000 +0200 +++ skins/MonoBook.php 2006-05-27 19:24:19.000000000 +0200 @@ -51,7 +51,7 @@ wfSuppressWarnings(); ?> - + html('headlinks') ?> @@ -93,7 +93,7 @@
    "; $s .= $this->bottomLinks(); --- skins/CologneBlue.php_old 2006-05-25 05:40:33.000000000 +0200 +++ skins/CologneBlue.php 2006-05-26 23:32:29.000000000 +0200 @@ -98,14 +98,15 @@ } function doGetUserStyles() { - global $wgOut; + global $wgOut, $wgLang, $wgUser; $s = parent::doGetUserStyles(); $qb = $this->qbSetting(); - if ( 2 == $qb ) { # Right + if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) || + ( 2 == $qb ) ) { # Right $s .= "#quickbar { position: absolute; right: 4px; }\n" . "#article { margin-left: 4px; margin-right: 148px; }\n"; - } else if ( 1 == $qb ) { + } else if ( (!$wgUser->isLoggedIn()) || ( 1 == $qb ) ) { $s .= "#quickbar { position: absolute; left: 4px; }\n" . "#article { margin-left: 148px; margin-right: 4px; }\n"; } else if ( 3 == $qb ) { # Floating left