2017-06-30 19:21:16 +00:00
|
|
|
<?php
|
2018-03-12 23:52:48 +00:00
|
|
|
|
|
|
|
namespace Vector;
|
|
|
|
|
|
|
|
use OutputPage;
|
|
|
|
use SkinTemplate;
|
|
|
|
use SkinVector;
|
2017-06-30 19:21:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Hook handlers for Vector skin.
|
|
|
|
*
|
|
|
|
* Hook handler method names should be in the form of:
|
|
|
|
* on<HookName>()
|
|
|
|
*/
|
2018-03-12 23:52:48 +00:00
|
|
|
class Hooks {
|
2017-06-30 19:21:16 +00:00
|
|
|
/**
|
|
|
|
* BeforePageDisplayMobile hook handler
|
|
|
|
*
|
|
|
|
* Make Vector responsive when operating in mobile mode (useformat=mobile)
|
|
|
|
*
|
|
|
|
* @see https://www.mediawiki.org/wiki/Extension:MobileFrontend/BeforePageDisplayMobile
|
|
|
|
* @param OutputPage $out
|
|
|
|
* @param SkinTemplate $sk
|
|
|
|
*/
|
|
|
|
public static function onBeforePageDisplayMobile( OutputPage $out, $sk ) {
|
|
|
|
// This makes Vector behave in responsive mode when MobileFrontend is installed
|
|
|
|
if ( $sk instanceof SkinVector ) {
|
|
|
|
$sk->enableResponsiveMode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|