\t^*$ between the comment and params for consistant formatting
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 4efb48a..c9f0233 100644 (file)
@@ -146,7 +146,7 @@ class SkinTemplate extends Skin {
                global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
                global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode, $wgUseNewInterlanguage;
                global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
-               global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
+               global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses;
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
 
@@ -344,8 +344,7 @@ class SkinTemplate extends Skin {
 
                $tpl->setRef( 'debug', $out->mDebugtext );
                $tpl->set( 'reporttime', $out->reportTime() );
-               $tpl->set( 'sitenotice', $wgSiteNotice );
-               $tpl->set( 'tagline', wfMsg('tagline') );
+               $tpl->set( 'sitenotice', wfGetSiteNotice() );
 
                $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
                $out->mBodytext .= $printfooter ;
@@ -378,6 +377,11 @@ class SkinTemplate extends Skin {
                } else {
                        $tpl->set('body_ondblclick', false);
                }
+               if( $this->iseditable && $wgUser->getOption( 'editsectiononrightclick' ) ) {
+                       $tpl->set( 'body_onload', 'setupRightClickEdit()' );
+               } else {
+                       $tpl->set( 'body_onload', false );
+               }
                $tpl->set( 'navigation_urls', $this->buildNavigationUrls() );
                $tpl->set( 'nav_urls', $this->buildNavUrls() );
 
@@ -615,7 +619,7 @@ class SkinTemplate extends Skin {
                                }
 
                                # Validate tab. TODO: add validation to logged-in user rights 
-                               if($wgUseValidation && $action=='view'){ # && $wgUser->isAllowed('validate')){
+                               if($wgUseValidation && ( $action == "" || $action=='view' ) ){ # && $wgUser->isAllowed('validate')){
                                        if ( $oldid ) $oid = IntVal( $oldid ) ; # Use the oldid
                                        else
                                                {# Trying to get the current article revision through this weird stunt
@@ -673,6 +677,11 @@ class SkinTemplate extends Skin {
                wfProfileOut( $fname );
                return $content_actions;
        }
+       
+       function getNavigationLinks() {
+               global $wgNavigationLinks;
+               return $wgNavigationLinks;
+       }
 
        /**
         * build array of global navigation links
@@ -683,9 +692,10 @@ class SkinTemplate extends Skin {
                $fname = 'SkinTemplate::buildNavigationUrls';
                wfProfileIn( $fname );
                
-               global $wgNavigationLinks;
+               $links = $this->getNavigationLinks();
+               
                $result = array();
-               foreach ( $wgNavigationLinks as $link ) {
+               foreach ( $links as $link ) {
                        $text = wfMsg( $link['text'] );
                        wfProfileIn( "$fname-{$link['text']}" );
                        if ($text != '-') {
@@ -714,7 +724,7 @@ class SkinTemplate extends Skin {
                wfProfileIn( $fname );
                
                global $wgUser, $wgRequest;
-               global $wgSiteSupportPage, $wgDisableUploads;
+               global $wgSiteSupportPage, $wgEnableUploads;
 
                $action = $wgRequest->getText( 'action' );
                $oldid = $wgRequest->getVal( 'oldid' );
@@ -730,7 +740,7 @@ class SkinTemplate extends Skin {
                // $nav_urls['sitesupport'] = array('href' => $this->makeI18nUrl('sitesupportpage'));
                $nav_urls['sitesupport'] = array('href' => $wgSiteSupportPage);
                $nav_urls['help'] = array('href' => $this->makeI18nUrl('helppage'));
-               if( $this->loggedin && !$wgDisableUploads ) {
+               if( $this->loggedin && $wgEnableUploads ) {
                        $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload'));
                } else {
                        $nav_urls['upload'] = false;
@@ -879,26 +889,14 @@ class SkinTemplate extends Skin {
         * returns css with user-specific options
         * @access public
         */
+
        function getUserStylesheet() {
                $fname = 'SkinTemplate::getUserStylesheet';
                wfProfileIn( $fname );
                
                global $wgUser;
                $s = "/* generated user stylesheet */\n";
-
-               if( $wgUser->isLoggedIn() ) {
-                       if ( $wgUser->getOption( "underline" ) ) {
-                               $s .= "a { text-decoration: underline; }\n";
-                       } else {
-                               $s .= "a { text-decoration: none; }\n";
-                       }
-               }
-               if ( !$wgUser->getOption( "highlightbroken" ) ) {
-                       $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
-               }
-               if ( $wgUser->getOption( "justify" ) ) {
-                       $s .= "#bodyContent { text-align: justify; }\n";
-               }
+               $s .= $this->reallyDoGetUserStyles();
                wfProfileOut( $fname );
                return $s;
        }