* Make sure Backlink cache does not retrieve interwiki redirects when looking for
redirects to a local page.
* (bug 6100) Allow different directionality (LTR/RTL) for user interface
- and wiki content, when $wgBetterDirectionality is enabled, along with
- many RTL improvements (such as bugs 28030, 12406, 28349)
+ and wiki content, along with many other RTL and directionality improvements
+ (such as bugs 28030, 12406, 28349)
* (bug 29712) Removed broken defaultUserOptionOverrides in MessagesXx files and
unneeded CSS flipping of quickbar. Instead, introduce option 5 which sets
left/right according to the directionality of your interface language.
* @return string containing HMTL with redirect link
*/
public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
- global $wgOut, $wgStylePath;
+ global $wgOut, $wgLang, $wgStylePath;
if ( !is_array( $target ) ) {
$target = array( $target );
}
- $imageDir = wfUILang()->getDir();
+ $imageDir = $wgLang->getDir();
if ( $appendSubtitle ) {
$wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
}
$nextRedirect = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png';
- $alt = wfUILang()->isRTL() ? '←' : '→';
+ $alt = $wgLang->isRTL() ? '←' : '→';
// Automatically append redirect=no to each link, since most of them are redirect pages themselves.
foreach ( $target as $rt ) {
$link .= Html::element( 'img', array( 'src' => $nextRedirect, 'alt' => $alt ) );
* @return string HTML output
*/
public function getHTML() {
- global $wgOut, $wgCategoryMagicGallery, $wgContLang, $wgBetterDirectionality;
+ global $wgOut, $wgCategoryMagicGallery, $wgContLang;
wfProfileIn( __METHOD__ );
$this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
$r = wfMsgExt( 'category-empty', array( 'parse' ) );
}
- if( $wgBetterDirectionality ) {
- $pageLang = $this->title->getPageLanguage();
- $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
- # close the previous div, show the headings in user language,
- # then open a new div with the page content language again
- $r = '</div>' . $r . Html::openElement( 'div', $langAttribs );
- }
+ $pageLang = $this->title->getPageLanguage();
+ $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
+ # close the previous div, show the headings in user language,
+ # then open a new div with the page content language again
+ $r = '</div>' . $r . Html::openElement( 'div', $langAttribs );
wfProfileOut( __METHOD__ );
return $wgContLang->convert( $r );
* @private
*/
function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
- global $wgBetterDirectionality;
-
$list = '';
if ( count ( $articles ) > $cutoff ) {
$list = self::columnList( $articles, $articles_start_char );
$list = self::shortList( $articles, $articles_start_char );
}
- if( $wgBetterDirectionality ) {
- $pageLang = $this->title->getPageLanguage();
- $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
- 'class' => 'mw-content-'.$pageLang->getDir() );
- $list = Html::rawElement( 'div', $attribs, $list );
- }
+ $pageLang = $this->title->getPageLanguage();
+ $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+ 'class' => 'mw-content-'.$pageLang->getDir() );
+ $list = Html::rawElement( 'div', $attribs, $list );
return $list;
}
* @return void
*/
public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
+ global $wgLang;
# If it's a new article, there is no diff link, but if it hasn't been
# patrolled yet, we need to give users a way to do so
$params = array();
$articlelink = "<strong class=\"mw-watched\">{$articlelink}</strong>";
}
# RTL/LTR marker
- $articlelink .= wfUILang()->getDirMark();
+ $articlelink .= $wgLang->getDirMark();
wfRunHooks( 'ChangesListInsertArticleLink',
array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched) );
# User tool links
$this->insertUserRelatedLinks( $s, $rc );
# LTR/RTL direction mark
- $s .= wfUILang()->getDirMark();
+ $s .= $wgLang->getDirMark();
# Log action text (if any)
$this->insertAction( $s, $rc );
# Edit or log comment
$users = array();
foreach( $userlinks as $userlink => $count) {
$text = $userlink;
- $text .= wfUILang()->getDirMark();
+ $text .= $wgLang->getDirMark();
if( $count > 1 ) {
$text .= ' (' . $wgLang->formatNum( $count ) . '×)';
}
$this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched );
}
- $r .= wfUILang()->getDirMark();
+ $r .= $wgLang->getDirMark();
$queryParams['curid'] = $curId;
# Changes message
$wgEdititis = false;
/**
- * Experimental better directionality support.
+ * Better directionality support (bug 6100 and related).
+ * Removed in 1.19, still kept here for LiquidThreads backwards compatibility.
+ *
+ * @deprecated since 1.19
*/
-$wgBetterDirectionality = false;
+$wgBetterDirectionality = true;
/** @} */ # End of output format settings }
'style' => '' // avoid php notices when appending preferences (appending allows customAttribs['style'] to still work
);
- global $wgBetterDirectionality;
- if( $wgBetterDirectionality ) {
- $pageLang = $this->mTitle->getPageLanguage();
- $attribs['lang'] = $pageLang->getCode();
- $attribs['dir'] = $pageLang->getDir();
- }
+ $pageLang = $this->mTitle->getPageLanguage();
+ $attribs['lang'] = $pageLang->getCode();
+ $attribs['dir'] = $pageLang->getDir();
$wgOut->addHTML( Html::textarea( $name, $wikitext, $attribs ) );
}
'<h2 id="mw-previewheader">' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>" .
$wgOut->parse( $note ) . $conflict . "</div>\n";
- global $wgBetterDirectionality;
- if( $wgBetterDirectionality ) {
- $pageLang = $this->mTitle->getPageLanguage();
- $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
- 'class' => 'mw-content-'.$pageLang->getDir() );
- $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
- }
+ $pageLang = $this->mTitle->getPageLanguage();
+ $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+ 'class' => 'mw-content-'.$pageLang->getDir() );
+ $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
+
wfProfileOut( __METHOD__ );
return $previewhead . $previewHTML . $this->previewTextAfterContent;
}
}
/**
- * Use this instead of $wgContLang, when working with user interface.
- * User interface is currently hard coded according to wiki content language
- * in many ways, especially regarding to text direction. There is lots stuff
- * to fix, hence this function to keep the old behaviour unless the global
- * $wgBetterDirectionality is enabled (or removed when everything works).
+ * Old function when $wgBetterDirectionality existed
+ * Removed in core, kept in extensions for backwards compat.
*
+ * @deprecated since 1.19
* @return Language
*/
function wfUILang() {
- global $wgBetterDirectionality;
- return wfGetLangObj( !$wgBetterDirectionality );
+ global $wgLang;
+ return $wgLang;
}
/**
return $func( $str, $needle ) !== false;
}
-function wfSpecialList( $page, $details ) {
- $details = $details ? ' ' . wfUILang()->getDirMark() . "($details)" : '';
+/**
+ * Make a list item, used by various special pages
+ *
+ * @param $page String Page link
+ * @param $details String Text between brackets
+ * @param $oppositedm Boolean Add the direction mark opposite to your
+ * language, to display text properly
+ * @return String
+ */
+function wfSpecialList( $page, $details, $oppositedm = true ) {
+ global $wgLang;
+ $dirmark = ( $oppositedm ? $wgLang->getDirMark( true ) : '' ) .
+ $wgLang->getDirMark();
+ $details = $details ? $dirmark . "($details)" : '';
return $page . $details;
}
private function getRevisionButton( $name, $msg ) {
$this->preventClickjacking();
- $float = wfUILang()->alignEnd();
# Note bug #20966, <button> is non-standard in IE<8
$element = Html::element( 'button',
array(
'type' => 'submit',
'name' => $name,
'value' => '1',
- 'style' => "float: $float;",
- 'class' => "mw-history-$name-button",
+ 'class' => "mw-history-$name-button mw-float-end",
),
wfMsg( $msg )
) . "\n";
$s .= " $del ";
}
- $dirmark = wfUILang()->getDirMark();
+ $dirmark = $wgLang->getDirMark();
$s .= " $link";
$s .= $dirmark;
# No need to display noarticletext, we use our own message, output in openShowImage()
if ( $this->mPage->getID() ) {
- # When $wgBetterDirectionality is enabled, NS_FILE is in the user language,
- # but this section (the actual wikitext) should be in page content language
+ # NS_FILE is in the user language, but this section (the actual wikitext)
+ # should be in page content language
$pageLang = $this->getTitle()->getPageLanguage();
$wgOut->addHTML( Xml::openElement( 'div', array( 'id' => 'mw-imagepage-content',
'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
$maxWidth = $max[0];
$maxHeight = $max[1];
$sk = $wgUser->getSkin();
- $dirmark = wfUILang()->getDirMark();
+ $dirmark = $wgLang->getDirMark();
if ( $this->displayImg->exists() ) {
# image
$comment = '<span class="history-deleted">' .
wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
} else {
- $comment = wfUILang()->getDirMark() .
+ global $wgLang;
+ $comment = $wgLang->getDirMark() .
$this->skin->commentBlock( $row->log_comment );
}
return $comment;
} elseif ( $type == 'protect' && count($params) == 3 ) {
// Restrictions and expiries
if( $skin ) {
- $details .= htmlspecialchars( " {$params[1]}" );
+ $details .= $wgLang->getDirMark() . htmlspecialchars( " {$params[1]}" );
} else {
$details .= " {$params[1]}";
}
* @return String: The doctype, opening <html>, and head element.
*/
public function headElement( Skin $sk, $includeStyle = true ) {
- global $wgUseTrackbacks;
+ global $wgUseTrackbacks, $wgLang;
if ( $sk->commonPrintStylesheet() ) {
$this->addModuleStyles( 'mediawiki.legacy.wikiprintable' );
}
$sk->setupUserCss( $this );
- $lang = wfUILang();
- $ret = Html::htmlHeader( array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() ) );
+ $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ) );
if ( $this->getHTMLTitle() == '' ) {
$this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
Xml::escapeJsString( $editUrl ) . "'";
}
- # Class bloat
- $dir = wfUILang()->getDir();
- $bodyAttrs['class'] = "mediawiki $dir";
+ # Classes for LTR/RTL directionality support
+ global $wgLang, $wgContLang;
+ $userdir = $wgLang->getDir();
+ $sitedir = $wgContLang->getDir();
+ $bodyAttrs['class'] = "mediawiki $userdir sitedir-$sitedir";
if ( $this->getContext()->getLang()->capitalizeAllNouns() ) {
# A <body> class is probably not the best way to do this . . .
*/
protected function styleLink( $style, $options ) {
if( isset( $options['dir'] ) ) {
- $siteDir = wfUILang()->getDir();
- if( $siteDir != $options['dir'] ) {
+ global $wgLang;
+ if( $wgLang->getDir() != $options['dir'] ) {
return '';
}
}
* A navigation bar with images
*/
function getNavigationBar() {
- global $wgStylePath;
+ global $wgStylePath, $wgLang;
if ( !$this->isNavigationBarShown() ) {
return '';
'next' => 'arrow_disabled_right_25.png',
'last' => 'arrow_disabled_last_25.png',
);
- if( wfUILang()->isRTL() ) {
+ if( $wgLang->isRTL() ) {
$keys = array_keys( $labels );
$images = array_combine( $keys, array_reverse( $images ) );
$disabledImages = array_combine( $keys, array_reverse( $disabledImages ) );
$tpl->setRef( 'serverurl', $wgServer );
$tpl->setRef( 'logopath', $wgLogo );
- $lang = wfUILang();
- $tpl->set( 'lang', $lang->getCode() );
- $tpl->set( 'dir', $lang->getDir() );
- $tpl->set( 'rtl', $lang->isRTL() );
+ $contentlang = $wgContLang->getCode();
+ $contentdir = $wgContLang->getDir();
+ $userlang = $wgLang->getCode();
+ $userdir = $wgLang->getDir();
+
+ $tpl->set( 'lang', $userlang );
+ $tpl->set( 'dir', $userdir );
+ $tpl->set( 'rtl', $wgLang->isRTL() );
$tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
$tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
$tpl->set( 'username', $wgUser->isAnon() ? null : $this->username );
$tpl->setRef( 'userpage', $this->userpage );
$tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
- $tpl->set( 'userlang', $wgLang->getCode() );
+ $tpl->set( 'userlang', $userlang );
// Users can have their language set differently than the
// content of the wiki. For these users, tell the web browser
// that interface elements are in a different language.
$tpl->set( 'userlangattributes', '' );
- $tpl->set( 'specialpageattributes', '' );
-
- $lang = $wgLang->getCode();
- $dir = $wgLang->getDir();
- if ( $lang !== $wgContLang->getCode() || $dir !== $wgContLang->getDir() ) {
- $attrs = " lang='$lang' dir='$dir'";
+ $tpl->set( 'specialpageattributes', '' ); # obsolete
+ if ( $userlang !== $contentlang || $userdir !== $contentdir ) {
+ $attrs = " lang='$userlang' dir='$userdir'";
$tpl->set( 'userlangattributes', $attrs );
-
- // The content of SpecialPages should be presented in the
- // user's language. Content of regular pages should not be touched.
- if( $this->getTitle()->isSpecialPage() ) {
- $tpl->set( 'specialpageattributes', $attrs );
- }
}
$newtalks = $this->getNewtalks( $out );
$tpl->set( 'bottomscripts', $this->bottomScripts( $out ) );
$tpl->set( 'printfooter', $this->printSource() );
- global $wgBetterDirectionality;
- if ( $wgBetterDirectionality ) {
- // not for special pages or file pages AND only when viewing AND if the page exists
- // (or is in MW namespace, because that has default content)
- if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
- in_array( $action, array( 'view', 'render', 'print' ) ) &&
- ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) {
- $pageLang = $this->getTitle()->getPageLanguage();
- $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
- 'class' => 'mw-content-'.$pageLang->getDir() );
- $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
- }
+ # Add a <div class="mw-content-ltr/rtl"> around the body text
+ # not for special pages or file pages AND only when viewing AND if the page exists
+ # (or is in MW namespace, because that has default content)
+ if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
+ in_array( $action, array( 'view', 'render', 'print' ) ) &&
+ ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) {
+ $pageLang = $this->getTitle()->getPageLanguage();
+ $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+ 'class' => 'mw-content-'.$pageLang->getDir() );
+ $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
}
+
$tpl->setRef( 'bodytext', $out->mBodytext );
# Language links
* @return string
*/
function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {
- global $wgBetterDirectionality;
- $tableClass = 'diff';
- if( $wgBetterDirectionality ) {
- // shared.css sets diff in interface language/dir,
- // but the actual content should be in the page language/dir
- $pageLang = $this->mTitle->getPageLanguage();
- $tableClass .= ' diff-contentalign-' . htmlspecialchars( $pageLang->alignStart() );
- }
+ // shared.css sets diff in interface language/dir,
+ // but the actual content should be in the page language/dir
+ $pageLang = $this->mTitle->getPageLanguage();
+ $tableClass = 'diff diff-contentalign-' . htmlspecialchars( $pageLang->alignStart() );
$header = "<table class='$tableClass'>";
if ( $diff ) { // Safari/Chrome show broken output if cols not used
$header .= "
if ( $this->direction === null ) {
$this->direction = $this->request->getVal( 'dir' );
if ( !$this->direction ) {
- global $wgBetterDirectionality, $wgContLang;
- // if $wgBetterDirectionality is true, set
- // directionality based on user language (see bug 6100)
- $this->direction = ( $wgBetterDirectionality ?
- Language::factory( $this->language )->getDir() : $wgContLang->getDir() );
+ # directionality based on user language (see bug 6100)
+ $this->direction = Language::factory( $this->language )->getDir();
}
}
return $this->direction;
}
function getCellAttrs( $field, $value ){
- global $wgBetterDirectionality;
- if( $field != 'am_title' && $wgBetterDirectionality ) {
+ if( $field != 'am_title' ) {
return array( 'lang' => $this->langcode, 'dir' => $this->lang->getDir() );
} elseif( $this->mCurrentRow->am_customised && $field == 'am_title' ) {
return array( 'rowspan' => '2', 'class' => $field );
array(),
array( 'broken' )
);
- $arr = wfUILang()->getArrow();
+ $arr = $wgLang->getArrow();
$out = $from . wfMsg( 'word-separator' );
array( 'action' => 'history' )
);
- $comment = wfUILang()->getDirMark() . $sk->revComment( $rev, false, true );
+ $comment = $wgLang->getDirMark() . $sk->revComment( $rev, false, true );
$date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
if( $rev->userCan( Revision::DELETED_TEXT ) ) {
$d = $sk->linkKnown(
$diffHistLinks = '(' . $difftext . $this->messages['pipe-separator'] . $histlink . ')';
- $diffOut = ' . . ' . wfUILang()->getDirMark() . ( $this->showSizeDiff ?
+ $diffOut = ' . . ' . $wgLang->getDirMark() . ( $this->showSizeDiff ?
ChangesList::showCharacterDifference( $row->rc_old_len, $row->rc_new_len ) : Linker::formatRevisionSize( $row->rev_len ) );
$ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$diffOut}{$userlink} {$comment} {$topmarktext}";
}
function formatResult( $skin, $result ) {
+ global $wgLang;
+
$title = Title::newFromID( $result->value );
$dp = Title::makeTitle( $result->namespace, $result->title );
$from = $skin->link( $title );
$edit = $skin->link( $title, wfMsgExt( 'parentheses', array( 'escape' ), wfMsg( 'editlink' ) ) ,
array(), array( 'redirect' => 'no', 'action' => 'edit' ) );
- $arr = wfUILang()->getArrow();
+ $arr = $wgLang->getArrow();
$to = $skin->link( $dp );
return "$from $edit $arr $to";
}
function formatResult( $skin, $result ) {
+ global $wgLang;
+
$titleA = Title::makeTitle( $result->namespace, $result->title );
if ( $result && !isset( $result->nsb ) ) {
array( 'redirect' => 'no' )
);
$linkC = $skin->linkKnown( $titleC );
- $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
+ $arr = $wgLang->getArrow() . $wgLang->getDirMark();
return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
}
}
if( $this->hash != '' ) {
- $align = wfUILang()->alignEnd();
-
# Show a thumbnail of the file
$img = $this->file;
if ( $img ) {
$thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
if( $thumb ) {
- $wgOut->addHTML( '<div style="float:' . $align . '" id="mw-fileduplicatesearch-icon">' .
+ $wgOut->addHTML( '<div class="mw-float-end" id="mw-fileduplicatesearch-icon">' .
$thumb->toHtml( array( 'desc-link' => false ) ) . '<br />' .
wfMsgExt( 'fileduplicatesearch-info', array( 'parse' ),
$wgLang->formatNum( $img->getWidth() ),
# Find out where the redirect leads
$target = $this->getRedirectTarget( $result );
if( $target ) {
+ global $wgLang;
# Make a link to the destination page
- $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
+ $arr = $wgLang->getArrow() . $wgLang->getDirMark();
$targetLink = $skin->link( $target );
return "$rd_link $arr $targetLink";
} else {
$classes = array();
- $dm = wfUILang()->getDirMark();
+ $dm = $wgLang->getDirMark();
$title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
$time = Html::element( 'span', array( 'class' => 'mw-newpages-time' ),
}
if(!is_null($size = $row->page_len)) {
- $stxt = wfUILang()->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
+ $stxt = $wgLang->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
}
# Show a link to the change protection form for allowed users otherwise a link to the protection log
return Html::rawElement(
'li',
array(),
- wfSpecialList( $link . $stxt, $wgLang->commaList( $description_items ) ) . $changeProtection ) . "\n";
+ wfSpecialList( $link . $stxt, $wgLang->commaList( $description_items ), false ) . $changeProtection ) . "\n";
}
/**
function formatResult( $skin, $result ) {
global $wgLang;
- $dm = wfUILang()->getDirMark();
+ $dm = $wgLang->getDirMark();
$title = Title::makeTitle( $result->namespace, $result->title );
if ( !$title ) {
}
protected function listItem( $row, $nt, $notClose = false ) {
+ global $wgLang;
+ $dirmark = $wgLang->getDirMark();
+
# local message cache
static $msgcache = null;
if ( $msgcache === null ) {
$wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
$wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' );
- $dirmark = wfUILang()->getDirMark();
return $notClose ?
Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" :
Xml::tags( 'li', null, "$link $propsText $dirmark $wlh" ) . "\n";
/**
* A hidden direction mark (LRM or RLM), depending on the language direction
*
+ * @param $opposite Boolean Get the direction mark opposite to your language
* @return string
*/
- function getDirMark() {
- return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E";
+ function getDirMark( $opposite = false ) {
+ $rtl = "\xE2\x80\x8F";
+ $ltr = "\xE2\x80\x8E";
+ if( $opposite ) { return $this->isRTL() ? $ltr : $rtl; }
+ return $this->isRTL() ? $rtl : $ltr;
}
/**
<!-- contentholder does nothing by default, but it allows users to style the text inside
the content area without affecting the meaning of 'em' in #mw_content, which is used
for the margins -->
- <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
+ <div id="mw_contentholder">
<div class='mw-topboxes'>
<div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
<div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
$this->html( 'headelement' );
?><div id="globalWrapper">
-<div id="column-content"><div id="content"<?php $this->html("specialpageattributes") ?>>
+<div id="column-content"><div id="content">
<a id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<!-- content -->
- <div id="content"<?php $this->html( 'specialpageattributes' ) ?>>
+ <div id="content">
<a id="top"></a>
<div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div>
<?php if ( $this->data['sitenotice'] ): ?>
* @param $elements array
*/
private function renderNavigation( $elements ) {
- global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
+ global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang;
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
if ( !is_array( $elements ) ) {
$elements = array( $elements );
// If there's a series of elements, reverse them when in RTL mode
- } elseif ( wfUILang()->isRTL() ) {
+ } elseif ( $wgLang->isRTL() ) {
$elements = array_reverse( $elements );
}
// Render elements
* another, but don't ignore the poor pre-Monobook users either.
*/
+/* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */
+/* These classes should be used for text depending on the content direction.
+Content stuff like editsection, ul/ol and TOC depend on this. */
+ /* @noflip */.mw-content-ltr { direction: ltr; }
+/* @noflip */.mw-content-rtl { direction: rtl; }
+/* Most input fields should be in site direction */
+/* @noflip */.sitedir-ltr textarea, .sitedir-ltr input { direction: ltr; }
+/* @noflip */.sitedir-rtl textarea, .sitedir-rtl input { direction: rtl; }
+/* Input types that should follow user direction, like buttons */
+input[type="submit"], input[type="button"], input[type="reset"], input[type="file"] { direction: ltr; }
+/* Override default values */
+/* @noflip */textarea[dir="ltr"], input[dir="ltr"] { direction: ltr; }
+/* @noflip */textarea[dir="rtl"], input[dir="rtl"] { direction: rtl; }
+
+.mw-float-start { float: left; }
+.mw-float-end { float: right; }
+
/* The scripts of these languages are very hard to read with underlines */
[lang="ar"] a, [lang="ckb"] a, [lang="fa"] a, [lang="kk-arab"] a,
[lang="mzn"] a, [lang="ps"] a, [lang="ur"] a {
margin-left: 5px;
}
/* Correct directionality when page dir is different from site/user dir */
-/* @noflip */div#content [dir="ltr"] .editsection, div#content [dir="rtl"] [dir="ltr"] .editsection { float: right; }
-/* @noflip */div#content [dir="rtl"] .editsection, div#content [dir="ltr"] [dir="rtl"] .editsection { float: left; }
+/* @noflip */.mw-content-ltr .editsection, .mw-content-rtl .mw-content-ltr .editsection { float: right; }
+/* @noflip */.mw-content-rtl .editsection, .mw-content-ltr .mw-content-rtl .editsection { float: left; }
/**
* File histories
*/
}
/* Correct directionality when page dir is different from site/user dir */
-/* @noflip */div#content [dir="ltr"] ul, div#content [dir="ltr"] ol,
-div#content [dir="rtl"] [dir="ltr"] ul, div#content [dir="rtl"] [dir="ltr"] ol {
+/* @noflip */.mw-content-ltr ul, .mw-content-ltr ol,
+.mw-content-rtl .mw-content-ltr ul, .mw-content-rtl .mw-content-ltr ol {
margin: .3em 0 0 1.5em;
}
-/* @noflip */div#content [dir="rtl"] ul, div#content [dir="rtl"] ol,
-div#content [dir="ltr"] [dir="rtl"] ul, div#content [dir="ltr"] [dir="rtl"] ol {
+/* @noflip */.mw-content-rtl ul, .mw-content-rtl ol,
+.mw-content-ltr .mw-content-rtl ul, .mw-content-ltr .mw-content-rtl ol {
margin: .3em 1.5em 0 0;
}
/* Localised ordered list numbering for some languages */
}
/* Correct directionality when page dir is different from site/user dir */
-/* @noflip */div#content [dir="ltr"] .toc ul, div#content [dir="ltr"] #toc ul,
-div#content [dir="rtl"] [dir="ltr"] .toc ul, div#content [dir="rtl"] [dir="ltr"] #toc ul {
+/* @noflip */.mw-content-ltr .toc ul, .mw-content-ltr #toc ul,
+.mw-content-rtl .mw-content-ltr .toc ul, .mw-content-rtl .mw-content-ltr #toc ul {
text-align: left;
margin-left: 0;
}
-/* @noflip */div#content [dir="rtl"] .toc ul, div#content [dir="rtl"] #toc ul,
-div#content [dir="ltr"] [dir="rtl"] .toc ul, div#content [dir="ltr"] [dir="rtl"] #toc ul {
+/* @noflip */.mw-content-rtl .toc ul, .mw-content-rtl #toc ul,
+.mw-content-ltr .mw-content-rtl .toc ul, .mw-content-ltr .mw-content-rtl #toc ul {
text-align: right;
margin-right: 0;
}
-/* @noflip */div#content [dir="ltr"] .toc ul ul, div#content [dir="ltr"] #toc ul ul,
-div#content [dir="rtl"] [dir="ltr"] .toc ul ul, div#content [dir="rtl"] [dir="ltr"] #toc ul ul {
+/* @noflip */.mw-content-ltr .toc ul ul, .mw-content-ltr #toc ul ul,
+.mw-content-rtl .mw-content-ltr .toc ul ul, .mw-content-rtl .mw-content-ltr #toc ul ul {
margin: 0 0 0 2em;
}
-/* @noflip */div#content [dir="rtl"] .toc ul ul, div#content [dir="rtl"] #toc ul ul,
-div#content [dir="ltr"] [dir="rtl"] .toc ul ul, div#content [dir="ltr"] [dir="rtl"] #toc ul ul {
+/* @noflip */.mw-content-rtl .toc ul ul, .mw-content-rtl #toc ul ul,
+.mw-content-ltr .mw-content-rtl .toc ul ul, .mw-content-ltr .mw-content-rtl #toc ul ul {
margin: 0 2em 0 0;
}