mediawiki-extensions-Tabber.../includes/Hooks.php

33 lines
832 B
PHP
Raw Permalink Normal View History

<?php
declare( strict_types=1 );
namespace MediaWiki\Extension\TabberNeue;
2022-04-20 18:00:28 +00:00
use MediaWiki\Hook\ParserFirstCallInitHook;
use OutputPage;
use Parser;
use Skin;
class Hooks implements ParserFirstCallInitHook {
/**
* @see https://www.mediawiki.org/wiki/Extension:MobileFrontend/BeforePageDisplayMobile
*
* @param OutputPage $out
* @param Skin $sk
*/
public static function onBeforePageDisplayMobile( OutputPage $out, Skin $sk ) {
$out->addModuleStyles( [ 'ext.tabberNeue.mobile.styles' ] );
}
/**
2022-04-20 18:00:28 +00:00
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ParserFirstCallInit
*
2022-04-20 18:00:28 +00:00
* @param Parser $parser
*/
public function onParserFirstCallInit( $parser ): void {
$parser->setHook( 'tabber', Tabber::class . '::parserHook' );
$parser->setHook( 'tabbertransclude', TabberTransclude::class . '::parserHook' );
}
}