mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 11:40:43 +00:00
21 lines
505 B
PHP
21 lines
505 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* RevisionSlider extension hooks
|
||
|
*
|
||
|
* @file
|
||
|
* @ingroup Extensions
|
||
|
* @license GPL-2.0+
|
||
|
*/
|
||
|
class RevisionSliderHooks {
|
||
|
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
|
||
|
if ( self::isRevisionPage( $skin->getContext()->getRequest() ) ) {
|
||
|
$out->addModules( 'ext.RevisionSlider.init' );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private static function isRevisionPage( WebRequest $request ) {
|
||
|
return $request->getVal( 'action' ) === 'history' || $request->getVal( 'type' ) === 'revision';
|
||
|
}
|
||
|
}
|