Don't use public-audience-only function
[lhc/web/wiklou.git] / includes / OutputPage.php
index f90febb..74feac9 100644 (file)
@@ -794,7 +794,8 @@ class OutputPage {
                global $wgUser, $wgOutputEncoding, $wgRequest;
                global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType;
                global $wgJsMimeType, $wgUseAjax, $wgAjaxWatch;
-               global $wgEnableMWSuggest;
+               global $wgEnableMWSuggest, $wgUniversalEditButton;
+               global $wgArticle, $wgTitle;
 
                if( $this->mDoNothing ){
                        return;
@@ -901,6 +902,25 @@ class OutputPage {
                        $this->addScriptFile( 'rightclickedit.js' );
                }
 
+               if( $wgUniversalEditButton ) {
+                       if( isset( $wgArticle ) && isset( $wgTitle ) && $wgTitle->quickUserCan( 'edit' )
+                               && ( $wgTitle->exists() || $wgTitle->quickUserCan( 'create' ) ) ) {
+                               // Original UniversalEditButton
+                               $this->addLink( array(
+                                       'rel' => 'alternate',
+                                       'type' => 'application/x-wiki',
+                                       'title' => wfMsg( 'edit' ),
+                                       'href' => $wgTitle->getFullURL( 'action=edit' )
+                               ) );
+                               // Alternate edit link
+                               $this->addLink( array(
+                                       'rel' => 'edit',
+                                       'title' => wfMsg( 'edit' ),
+                                       'href' => $wgTitle->getFullURL( 'action=edit' )
+                               ) );
+                       }
+               }
+               
                # Buffer output; final headers may depend on later processing
                ob_start();
 
@@ -1185,8 +1205,7 @@ class OutputPage {
                        $text = wfMsgNoTrans( 'permissionserrorstext', count($errors)). "\n\n";
                } else {
                        global $wgLang;
-                       $action_desc = wfMsg( "right-$action" );
-                       $action_desc = $wgLang->lcfirst( $action_desc ); // FIXME: TERRIBLE HACK
+                       $action_desc = wfMsg( "action-$action" );
                        $text = wfMsgNoTrans( 'permissionserrorstext-withaction', count($errors), $action_desc ) . "\n\n";
                }
 
@@ -1252,7 +1271,7 @@ class OutputPage {
                        // Wiki is read only
                        $this->setPageTitle( wfMsg( 'readonly' ) );
                        $reason = wfReadOnlyReason();
-                       $this->addWikiMsg( 'readonlytext', $reason );
+                       $this->wrapWikiMsg( '<div class="mw-readonly-error">$1</div>', array( 'readonlytext', $reason ) );
                }
 
                // Show source, if supplied
@@ -1533,7 +1552,7 @@ class OutputPage {
                        # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
                        # If so, use it instead.
                        
-                       global $wgOverrideSiteFeed, $wgSitename;
+                       global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses;
                        $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
                        
                        if ( $wgOverrideSiteFeed ) {
@@ -1545,14 +1564,12 @@ class OutputPage {
                                }
                        }
                        else if ( $wgTitle->getPrefixedText() != $rctitle->getPrefixedText() ) {
-                               $tags[] = $this->feedLink(
-                                       'rss',
-                                       $rctitle->getFullURL( 'feed=rss' ),
-                                       wfMsg( 'site-rss-feed', $wgSitename ) );
-                               $tags[] = $this->feedLink(
-                                       'atom',
-                                       $rctitle->getFullURL( 'feed=atom' ),
-                                       wfMsg( 'site-atom-feed', $wgSitename ) );
+                               foreach( $wgFeedClasses as $format => $class ) {
+                                       $tags[] = $this->feedLink(
+                                               $format,
+                                               $rctitle->getFullURL( "feed={$format}" ),
+                                               wfMsg( "site-{$format}-feed", $wgSitename ) ); # For grep: 'site-rss-feed', 'site-atom-feed'.
+                               }
                        }
                }