X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSkinTemplate.php;h=8425333158456e7c6403a5e7142778572dcd4b4a;hb=3f38197f262e4d715b51c881f379299b0d07dcd3;hp=e049f57f23925ad43f496c49b0829db668e74344;hpb=6d993be4c5d4be9e6dfa73cfd11da27a48710a07;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index e049f57f23..8425333158 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1,22 +1,28 @@ addStyle( 'common/shared.css', 'screen' ); - $out->addStyle( 'common/commonPrint.css', 'print' ); + $out->addModuleStyles( array( 'mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint' ) ); } /** @@ -110,7 +115,7 @@ class SkinTemplate extends Skin { * and eventually it spits out some HTML. Should have interface * roughly equivalent to PHPTAL 0.7. * - * @param $callback string (or file) + * @param $classname string (or file) * @param $repository string: subdirectory where we keep template files * @param $cache_dir string * @return object @@ -127,7 +132,7 @@ class SkinTemplate extends Skin { */ function outputPage( OutputPage $out ) { global $wgArticle, $wgUser, $wgLang, $wgContLang; - global $wgScript, $wgStylePath, $wgContLanguageCode; + global $wgScript, $wgStylePath, $wgLanguageCode; global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks; @@ -212,7 +217,7 @@ class SkinTemplate extends Skin { $tpl->setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace ); $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces ); $tpl->set( 'html5version', $wgHtml5Version ); - $tpl->set( 'headlinks', $out->getHeadLinks() ); + $tpl->set( 'headlinks', $out->getHeadLinks( $this->getSkinName() ) ); $tpl->set( 'csslinks', $out->buildCssLinks() ); if( $wgUseTrackbacks && $out->isArticleRelated() ) { @@ -297,11 +302,13 @@ class SkinTemplate extends Skin { $tpl->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 ); @@ -413,9 +420,14 @@ class SkinTemplate extends Skin { $tpl->set( 'reporttime', wfReportTime() ); $tpl->set( 'sitenotice', wfGetSiteNotice() ); - $tpl->set( 'bottomscripts', $this->bottomScripts() ); + $tpl->set( 'bottomscripts', $this->bottomScripts( $out ) ); $printfooter = "
\n" . $this->printSource() . "
\n"; + global $wgBetterDirectionality; + if ( $wgBetterDirectionality ) { + $realBodyAttribs = array( 'lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir() ); + $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); + } $out->mBodytext .= $printfooter . $this->generateDebugHTML(); $tpl->setRef( 'bodytext', $out->mBodytext ); @@ -433,6 +445,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 +499,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 ) { @@ -646,7 +659,7 @@ class SkinTemplate extends Skin { self::checkTitle( $title, $name ); return array( 'href' => $title->getLocalURL( $urlaction ), - 'exists' => $title->getArticleID() != 0 ? true : false + 'exists' => $title->getArticleID() != 0, ); } @@ -656,7 +669,7 @@ class SkinTemplate extends Skin { self::checkTitle( $title, $name ); return array( 'href' => $title->getLocalURL( $urlaction ), - 'exists' => $title->getArticleID() != 0 ? true : false + 'exists' => $title->getArticleID() != 0, ); } @@ -703,7 +716,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() || ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) ) + 'text' => ( $this->mTitle->exists() || ( $this->mTitle->getNamespace() == NS_MEDIAWIKI && !wfEmptyMsg( $this->mTitle->getText() ) ) ) ? wfMsg( 'edit' ) : wfMsg( 'create' ), 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() ) @@ -867,7 +880,7 @@ class SkinTemplate extends Skin { */ function buildNavUrls() { global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest; - global $wgEnableUploads, $wgUploadNavigationUrl; + global $wgUploadNavigationUrl; wfProfileIn( __METHOD__ );