Mass convert NULL -> null. Left strings and comments alone, obviously.
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 4042514..0a7085f 100644 (file)
@@ -129,12 +129,12 @@ class SkinTemplate extends Skin {
                global $wgArticle, $wgUser, $wgLang, $wgContLang;
                global $wgScript, $wgStylePath, $wgContLanguageCode;
                global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
-               global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces;
+               global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version;
                global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks;
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
                global $wgUseTrackbacks, $wgUseSiteJs, $wgDebugComments;
-               global $wgArticlePath, $wgScriptPath, $wgServer, $wgCanonicalNamespaceNames;
+               global $wgArticlePath, $wgScriptPath, $wgServer;
 
                wfProfileIn( __METHOD__ );
 
@@ -208,6 +208,7 @@ class SkinTemplate extends Skin {
 
                        $tpl->setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace );
                        $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces );
+                       $tpl->set( 'html5version', $wgHtml5Version );
                        $tpl->set( 'headlinks', $out->getHeadLinks() );
                        $tpl->set( 'csslinks', $out->buildCssLinks() );
 
@@ -226,8 +227,8 @@ class SkinTemplate extends Skin {
                $tpl->set( 'pageclass', $this->getPageClasses( $this->mTitle ) );
                $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
 
-               $nsname = isset( $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] ) ?
-                                       $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] :
+               $nsname = MWNamespace::exists( $this->mTitle->getNamespace() ) ?
+                                       MWNamespace::getCanonicalName( $this->mTitle->getNamespace() ) :
                                        $this->mTitle->getNsText();
 
                $tpl->set( 'nscanonical', $nsname );
@@ -299,7 +300,7 @@ class SkinTemplate extends Skin {
                $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->set( 'username', $wgUser->isAnon() ? null : $this->username );
                $tpl->setRef( 'userpage', $this->userpage );
                $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
                $tpl->set( 'userlang', $wgLang->getCode() );
@@ -740,10 +741,19 @@ class SkinTemplate extends Skin {
                                // adds new section link if page is a current revision of a talk page or
                                if ( ( $wgArticle && $wgArticle->isCurrent() && $istalk ) || $wgOut->showNewSectionLink() ) {
                                        if ( !$wgOut->forceHideNewSectionLink() ) {
+                                               $urlArgs = 'action=edit&section=new';
+                                               $preloadMsg = wfMsg( 'talk-addsection-preload' );
+                                               $editintroMsg = wfMsg( 'talk-addsection-editintro' );
+                                               if( '' != $preloadMsg  ) {
+                                                       $urlArgs .= '&preload=' . urlencode( $preloadMsg );
+                                               }
+                                               if( '' != $editintroMsg ) {
+                                                       $urlArgs .= '&editintro=' . urlencode( $editintroMsg );
+                                               }
                                                $content_actions['addsection'] = array(
                                                        'class' => $section == 'new' ? 'selected' : false,
                                                        'text' => wfMsg( 'addsection' ),
-                                                       'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
+                                                       'href' => $this->mTitle->getLocalUrl( $urlArgs )
                                                );
                                        }
                                }
@@ -800,7 +810,7 @@ class SkinTemplate extends Skin {
                                }
                        } else {
                                //article doesn't exist or is deleted
-                               if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'undelete' ) ) {
+                               if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'deletedtext' ) ) {
                                        if( $n = $this->mTitle->isDeleted() ) {
                                                $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
                                                $content_actions['undelete'] = array(
@@ -849,7 +859,7 @@ class SkinTemplate extends Skin {
                        }
 
 
-                       wfRunHooks( 'SkinTemplateTabs', array( &$this, &$content_actions ) );
+                       wfRunHooks( 'SkinTemplateTabs', array( $this, &$content_actions ) );
                } else {
                        /* show special page tab */