X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSkinTemplate.php;h=50dfefe24e123ffb150bc7a2b19e4e9580924aee;hb=fd9ba658d121fe8c93c89fd90b4f4ec694c74963;hp=7d4588155d4ff5f494de1f7f0af46eeeb1a6d1f2;hpb=f624235d70144e8ba0a79ee6a798c84723cf8175;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 7d4588155d..50dfefe24e 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1,22 +1,28 @@ setRef( 'scriptpath', $wgScriptPath ); $tpl->setRef( 'serverurl', $wgServer ); $tpl->setRef( 'logopath', $wgLogo ); - $tpl->setRef( 'lang', $wgContLanguageCode ); - $tpl->set( 'dir', $wgContLang->getDir() ); - $tpl->set( 'rtl', $wgContLang->isRTL() ); + + $lang = wfUILang(); + $tpl->set( 'lang', $lang->getCode() ); + $tpl->set( 'dir', $lang->getDir() ); + $tpl->set( 'rtl', $lang->isRTL() ); + $tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' ); - $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) ); $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) ); $tpl->set( 'username', $wgUser->isAnon() ? null : $this->username ); $tpl->setRef( 'userpage', $this->userpage ); @@ -416,6 +424,11 @@ class SkinTemplate extends Skin { $tpl->set( 'bottomscripts', $this->bottomScripts() ); $printfooter = "
\n" . $this->printSource() . "
\n"; + global $wgBetterDirectionality; + if ( $wgBetterDirectionality ) { + $realBodyAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $wgContLang->getDir() ); + $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); + } $out->mBodytext .= $printfooter . $this->generateDebugHTML(); $tpl->setRef( 'bodytext', $out->mBodytext ); @@ -433,6 +446,7 @@ class SkinTemplate extends Skin { 'href' => $nt->getFullURL(), 'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ? $wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ), + 'title' => $nt->getText(), 'class' => $class ); } @@ -486,7 +500,7 @@ class SkinTemplate extends Skin { * an error object of the appropriate type. * For the base class, assume strings all around. * - * @param mixed $str + * @param $str Mixed * @private */ function printOrError( $str ) { @@ -703,7 +717,7 @@ class SkinTemplate extends Skin { $istalkclass = $istalk?' istalk':''; $content_actions['edit'] = array( 'class' => ( ( ( $action == 'edit' or $action == 'submit' ) and $section != 'new' ) ? 'selected' : '' ) . $istalkclass, - 'text' => $this->mTitle->exists() + 'text' => ( $this->mTitle->exists() || ( $this->mTitle->getNamespace() == NS_MEDIAWIKI && !wfEmptyMsg( $this->mTitle->getText() ) ) ) ? wfMsg( 'edit' ) : wfMsg( 'create' ), 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() ) @@ -719,7 +733,7 @@ class SkinTemplate extends Skin { ); } } - } elseif ( $this->mTitle->isKnown() ) { + } elseif ( $this->mTitle->hasSourceText() ) { $content_actions['viewsource'] = array( 'class' => ($action == 'edit') ? 'selected' : false, 'text' => wfMsg( 'viewsource' ), @@ -867,7 +881,7 @@ class SkinTemplate extends Skin { */ function buildNavUrls() { global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest; - global $wgEnableUploads, $wgUploadNavigationUrl; + global $wgUploadNavigationUrl; wfProfileIn( __METHOD__ ); @@ -877,7 +891,7 @@ class SkinTemplate extends Skin { $nav_urls['mainpage'] = array( 'href' => self::makeMainPageUrl() ); if( $wgUploadNavigationUrl ) { $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl ); - } elseif( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) { + } elseif( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { $nav_urls['upload'] = array( 'href' => self::makeSpecialUrl( 'Upload' ) ); } else { $nav_urls['upload'] = false; @@ -930,8 +944,10 @@ class SkinTemplate extends Skin { } if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) { - $id = User::idFromName( $this->mTitle->getText() ); - $ip = User::isIP( $this->mTitle->getText() ); + $parts = explode( '/', $this->mTitle->getText() ); + $rootUser = $parts[0]; + $id = User::idFromName( $rootUser ); + $ip = User::isIP( $rootUser ); } else { $id = 0; $ip = false; @@ -939,7 +955,7 @@ class SkinTemplate extends Skin { if( $id || $ip ) { # both anons and non-anons have contribs list $nav_urls['contributions'] = array( - 'href' => self::makeSpecialUrlSubpage( 'Contributions', $this->mTitle->getText() ) + 'href' => self::makeSpecialUrlSubpage( 'Contributions', $rootUser ) ); if( $id ) { @@ -947,7 +963,7 @@ class SkinTemplate extends Skin { $nav_urls['log'] = array( 'href' => $logPage->getLocalUrl( array( - 'user' => $this->mTitle->getText() + 'user' => $rootUser ) ) ); @@ -957,7 +973,7 @@ class SkinTemplate extends Skin { if ( $wgUser->isAllowed( 'block' ) ) { $nav_urls['blockip'] = array( - 'href' => self::makeSpecialUrlSubpage( 'Blockip', $this->mTitle->getText() ) + 'href' => self::makeSpecialUrlSubpage( 'Blockip', $rootUser ) ); } else { $nav_urls['blockip'] = false; @@ -970,7 +986,7 @@ class SkinTemplate extends Skin { $nav_urls['emailuser'] = false; if( $this->showEmailUser( $id ) ) { $nav_urls['emailuser'] = array( - 'href' => self::makeSpecialUrlSubpage( 'Emailuser', $this->mTitle->getText() ) + 'href' => self::makeSpecialUrlSubpage( 'Emailuser', $rootUser ) ); } wfProfileOut( __METHOD__ );