Fixed <doclink> broken by r83023
authorMax Semenik <maxsem@users.mediawiki.org>
Sun, 20 Mar 2011 17:54:43 +0000 (17:54 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sun, 20 Mar 2011 17:54:43 +0000 (17:54 +0000)
includes/installer/Installer.php
includes/installer/WebInstaller.php

index 1ddc237..f8ab896 100644 (file)
@@ -317,9 +317,6 @@ abstract class Installer {
                // Having a user with id = 0 safeguards us from DB access via User::loadOptions().
                $wgUser = User::newFromId( 0 );
 
-               // Set our custom <doclink> hook.
-               $wgHooks['ParserFirstCallInit'][] = array( $this, 'registerDocLink' );
-
                $this->settings = $this->internalDefaults;
 
                foreach ( $this->defaultVarNames as $var ) {
@@ -1141,18 +1138,6 @@ abstract class Installer {
                return false;
        }
 
-       /**
-        * Register tag hook below.
-        *
-        * @todo Move this to WebInstaller with the two things below?
-        *
-        * @param $parser Parser
-        */
-       public function registerDocLink( Parser &$parser ) {
-               $parser->setHook( 'doclink', array( $this, 'docLink' ) );
-               return true;
-       }
-
        /**
         * ParserOptions are constructed before we determined the language, so fix it
         */
@@ -1161,16 +1146,6 @@ abstract class Installer {
                $this->parserOptions->setUserLang( $lang->getCode() );
        }
 
-       /**
-        * Extension tag hook for a documentation link.
-        */
-       public function docLink( $linkText, $attribs, $parser ) {
-               $url = $this->getDocUrl( $attribs['href'] );
-               return '<a href="' . htmlspecialchars( $url ) . '">' .
-                       htmlspecialchars( $linkText ) .
-                       '</a>';
-       }
-
        /**
         * Overridden by WebInstaller to provide lastPage parameters.
         */
index 8405a62..add4e89 100644 (file)
@@ -115,9 +115,10 @@ class WebInstaller extends Installer {
                $this->output = new WebInstallerOutput( $this );
                $this->request = $request;
 
-               // Add parser hook for WebInstaller_Complete
+               // Add parser hooks
                global $wgParser;
                $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) );
+               $wgParser->setHook( 'doclink', array( $this, 'docLink' ) );
        }
 
        /**
@@ -993,6 +994,16 @@ class WebInstaller extends Installer {
                return $url;
        }
 
+       /**
+        * Extension tag hook for a documentation link.
+        */
+       public function docLink( $linkText, $attribs, $parser ) {
+               $url = $this->getDocUrl( $attribs['href'] );
+               return '<a href="' . htmlspecialchars( $url ) . '">' .
+                       htmlspecialchars( $linkText ) .
+                       '</a>';
+       }
+       
        /**
         * Helper for "Download LocalSettings" link on WebInstall_Complete
         * @return String Html for download link