Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -115,9 +115,10 @@ |
116 | 116 | $this->output = new WebInstallerOutput( $this ); |
117 | 117 | $this->request = $request; |
118 | 118 | |
119 | | - // Add parser hook for WebInstaller_Complete |
| 119 | + // Add parser hooks |
120 | 120 | global $wgParser; |
121 | 121 | $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) ); |
| 122 | + $wgParser->setHook( 'doclink', array( $this, 'docLink' ) ); |
122 | 123 | } |
123 | 124 | |
124 | 125 | /** |
— | — | @@ -994,6 +995,16 @@ |
995 | 996 | } |
996 | 997 | |
997 | 998 | /** |
| 999 | + * Extension tag hook for a documentation link. |
| 1000 | + */ |
| 1001 | + public function docLink( $linkText, $attribs, $parser ) { |
| 1002 | + $url = $this->getDocUrl( $attribs['href'] ); |
| 1003 | + return '<a href="' . htmlspecialchars( $url ) . '">' . |
| 1004 | + htmlspecialchars( $linkText ) . |
| 1005 | + '</a>'; |
| 1006 | + } |
| 1007 | + |
| 1008 | + /** |
998 | 1009 | * Helper for "Download LocalSettings" link on WebInstall_Complete |
999 | 1010 | * @return String Html for download link |
1000 | 1011 | */ |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -317,9 +317,6 @@ |
318 | 318 | // Having a user with id = 0 safeguards us from DB access via User::loadOptions(). |
319 | 319 | $wgUser = User::newFromId( 0 ); |
320 | 320 | |
321 | | - // Set our custom <doclink> hook. |
322 | | - $wgHooks['ParserFirstCallInit'][] = array( $this, 'registerDocLink' ); |
323 | | - |
324 | 321 | $this->settings = $this->internalDefaults; |
325 | 322 | |
326 | 323 | foreach ( $this->defaultVarNames as $var ) { |
— | — | @@ -1142,18 +1139,6 @@ |
1143 | 1140 | } |
1144 | 1141 | |
1145 | 1142 | /** |
1146 | | - * Register tag hook below. |
1147 | | - * |
1148 | | - * @todo Move this to WebInstaller with the two things below? |
1149 | | - * |
1150 | | - * @param $parser Parser |
1151 | | - */ |
1152 | | - public function registerDocLink( Parser &$parser ) { |
1153 | | - $parser->setHook( 'doclink', array( $this, 'docLink' ) ); |
1154 | | - return true; |
1155 | | - } |
1156 | | - |
1157 | | - /** |
1158 | 1143 | * ParserOptions are constructed before we determined the language, so fix it |
1159 | 1144 | */ |
1160 | 1145 | public function setParserLanguage( $lang ) { |
— | — | @@ -1162,16 +1147,6 @@ |
1163 | 1148 | } |
1164 | 1149 | |
1165 | 1150 | /** |
1166 | | - * Extension tag hook for a documentation link. |
1167 | | - */ |
1168 | | - public function docLink( $linkText, $attribs, $parser ) { |
1169 | | - $url = $this->getDocUrl( $attribs['href'] ); |
1170 | | - return '<a href="' . htmlspecialchars( $url ) . '">' . |
1171 | | - htmlspecialchars( $linkText ) . |
1172 | | - '</a>'; |
1173 | | - } |
1174 | | - |
1175 | | - /** |
1176 | 1151 | * Overridden by WebInstaller to provide lastPage parameters. |
1177 | 1152 | */ |
1178 | 1153 | protected function getDocUrl( $page ) { |