Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -859,6 +859,12 @@ |
860 | 860 | $out: OutputPage instance (object) |
861 | 861 | $parserOutput: parserOutput instance being added in $out |
862 | 862 | |
| 863 | +'OutputPageMakeCategoryLinks': links are about to be generated for the page's categories. |
| 864 | + Implementations should return false if they generate the category links, so the default link generation is skipped. |
| 865 | +$out: OutputPage instance (object) |
| 866 | +$categories: associative array, keys are category names, values are category types ("normal" or "hidden") |
| 867 | +$links: array, intended to hold the result. Must be an associative array with category types as keys and arrays of HTML links as values. |
| 868 | + |
863 | 869 | 'PageHistoryBeforeList': When a history page list is about to be constructed. |
864 | 870 | $article: the article that the history is loading for |
865 | 871 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -320,11 +320,13 @@ |
321 | 321 | } |
322 | 322 | |
323 | 323 | # Add the remaining categories to the skin |
324 | | - $sk = $wgUser->getSkin(); |
325 | | - foreach ( $categories as $category => $type ) { |
326 | | - $title = Title::makeTitleSafe( NS_CATEGORY, $category ); |
327 | | - $text = $wgContLang->convertHtml( $title->getText() ); |
328 | | - $this->mCategoryLinks[$type][] = $sk->makeLinkObj( $title, $text ); |
| 324 | + if ( wfRunHooks( 'OutputPageMakeCategoryLinks', array( &$this, $categories, &$this->mCategoryLinks ) ) ) { |
| 325 | + $sk = $wgUser->getSkin(); |
| 326 | + foreach ( $categories as $category => $type ) { |
| 327 | + $title = Title::makeTitleSafe( NS_CATEGORY, $category ); |
| 328 | + $text = $wgContLang->convertHtml( $title->getText() ); |
| 329 | + $this->mCategoryLinks[$type][] = $sk->makeLinkObj( $title, $text ); |
| 330 | + } |
329 | 331 | } |
330 | 332 | } |
331 | 333 | |