mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-29 05:16:27 +00:00
53fae97723
Change-Id: Iafa24ed41c06d4bd8b9a7a684b986fdb37aa87c7
31 lines
753 B
PHP
31 lines
753 B
PHP
<?php
|
|
/**
|
|
* DiscussionTools extension hooks
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @license MIT
|
|
*/
|
|
class DiscussionToolsHooks {
|
|
/**
|
|
* Adds DiscussionTools JS to the output.
|
|
*
|
|
* This is attached to the MediaWiki 'BeforePageDisplay' hook.
|
|
*
|
|
* @param OutputPage $output The page view.
|
|
* @param Skin $skin The skin that's going to build the UI.
|
|
*/
|
|
public static function onBeforePageDisplay( OutputPage $output, Skin $skin ) {
|
|
$title = $output->getTitle();
|
|
if (
|
|
// Only wikitext pages (e.g. not Flow boards)
|
|
$title->getContentModel() === CONTENT_MODEL_WIKITEXT &&
|
|
$title->isTalkPage()
|
|
// TODO: Allow non talk pages to be treated as talk pages
|
|
// using a magic word.
|
|
) {
|
|
// TODO: Load talk page enhancements
|
|
}
|
|
}
|
|
}
|