Followup cf5f641: pass $params by reference again
[lhc/web/wiklou.git] / includes / OutputPage.php
index fb2d6f4..24b9e46 100644 (file)
@@ -786,7 +786,7 @@ class OutputPage extends ContextSource {
                        // bug 44570: the core page itself may not change, but resources might
                        $modifiedTimes['sepoch'] = wfTimestamp( TS_MW, time() - $config->get( 'SquidMaxage' ) );
                }
-               wfRunHooks( 'OutputPageCheckLastModified', array( &$modifiedTimes ) );
+               Hooks::run( 'OutputPageCheckLastModified', array( &$modifiedTimes ) );
 
                $maxModified = max( $modifiedTimes );
                $this->mLastModified = wfTimestamp( TS_RFC2822, $maxModified );
@@ -1033,17 +1033,29 @@ class OutputPage extends ContextSource {
        }
 
        /**
-        * Add a subtitle containing a backlink to a page
+        * Build message object for a subtitle containing a backlink to a page
         *
         * @param Title $title Title to link to
         * @param array $query Array of additional parameters to include in the link
+        * @return Message
+        * @since 1.25
         */
-       public function addBacklinkSubtitle( Title $title, $query = array() ) {
+       public static function buildBacklinkSubtitle( Title $title, $query = array() ) {
                if ( $title->isRedirect() ) {
                        $query['redirect'] = 'no';
                }
-               $this->addSubtitle( $this->msg( 'backlinksubtitle' )
-                       ->rawParams( Linker::link( $title, null, array(), $query ) ) );
+               return wfMessage( 'backlinksubtitle' )
+                       ->rawParams( Linker::link( $title, null, array(), $query ) );
+       }
+
+       /**
+        * Add a subtitle containing a backlink to a page
+        *
+        * @param Title $title Title to link to
+        * @param array $query Array of additional parameters to include in the link
+        */
+       public function addBacklinkSubtitle( Title $title, $query = array() ) {
+               $this->addSubtitle( self::buildBacklinkSubtitle( $title, $query ) );
        }
 
        /**
@@ -1313,7 +1325,7 @@ class OutputPage extends ContextSource {
                }
 
                # Add the remaining categories to the skin
-               if ( wfRunHooks(
+               if ( Hooks::run(
                        'OutputPageMakeCategoryLinks',
                        array( &$this, $categories, &$this->mCategoryLinks ) )
                ) {
@@ -1753,8 +1765,8 @@ class OutputPage extends ContextSource {
                // Link flags are ignored for now, but may in the future be
                // used to mark individual language links.
                $linkFlags = array();
-               wfRunHooks( 'LanguageLinks', array( $this->getTitle(), &$this->mLanguageLinks, &$linkFlags ) );
-               wfRunHooks( 'OutputPageParserOutput', array( &$this, $parserOutput ) );
+               Hooks::run( 'LanguageLinks', array( $this->getTitle(), &$this->mLanguageLinks, &$linkFlags ) );
+               Hooks::run( 'OutputPageParserOutput', array( &$this, $parserOutput ) );
        }
 
        /**
@@ -1783,7 +1795,7 @@ class OutputPage extends ContextSource {
         */
        public function addParserOutputText( $parserOutput ) {
                $text = $parserOutput->getText();
-               wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
+               Hooks::run( 'OutputPageBeforeHTML', array( &$this, &$text ) );
                $this->addHTML( $text );
        }
 
@@ -1908,7 +1920,7 @@ class OutputPage extends ContextSource {
                                ),
                                $config->get( 'CacheVaryCookies' )
                        );
-                       wfRunHooks( 'GetCacheVaryCookies', array( $this, &$cookies ) );
+                       Hooks::run( 'GetCacheVaryCookies', array( $this, &$cookies ) );
                }
                return $cookies;
        }
@@ -2171,7 +2183,7 @@ class OutputPage extends ContextSource {
                        $redirect = $this->mRedirect;
                        $code = $this->mRedirectCode;
 
-                       if ( wfRunHooks( "BeforePageRedirect", array( $this, &$redirect, &$code ) ) ) {
+                       if ( Hooks::run( "BeforePageRedirect", array( $this, &$redirect, &$code ) ) ) {
                                if ( $code == '301' || $code == '303' ) {
                                        if ( !$config->get( 'DebugRedirects' ) ) {
                                                $message = HttpStatus::getMessage( $code );
@@ -2248,7 +2260,7 @@ class OutputPage extends ContextSource {
 
                        // Hook that allows last minute changes to the output page, e.g.
                        // adding of CSS or Javascript by extensions.
-                       wfRunHooks( 'BeforePageDisplay', array( &$this, &$sk ) );
+                       Hooks::run( 'BeforePageDisplay', array( &$this, &$sk ) );
 
                        wfProfileIn( 'Output-skin' );
                        $sk->outputPage();
@@ -2256,7 +2268,7 @@ class OutputPage extends ContextSource {
                }
 
                // This hook allows last minute changes to final overall output by modifying output buffer
-               wfRunHooks( 'AfterFinalPageOutput', array( $this ) );
+               Hooks::run( 'AfterFinalPageOutput', array( $this ) );
 
                $this->sendCacheControl();
 
@@ -2685,7 +2697,7 @@ class OutputPage extends ContextSource {
 
                // Allow skins and extensions to add body attributes they need
                $sk->addToBodyAttributes( $this, $bodyAttrs );
-               wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );
+               Hooks::run( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );
 
                $ret .= Html::openElement( 'body', $bodyAttrs ) . "\n";
 
@@ -3235,7 +3247,7 @@ class OutputPage extends ContextSource {
                // Use the 'ResourceLoaderGetConfigVars' hook if the variable is not
                // page-dependant but site-wide (without state).
                // Alternatively, you may want to use OutputPage->addJsConfigVars() instead.
-               wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars, $this ) );
+               Hooks::run( 'MakeGlobalVariablesScript', array( &$vars, $this ) );
 
                // Merge in variables from addJsConfigVars last
                return array_merge( $vars, $this->getJsConfigVars() );