mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
2fa3b7f69a
Cleans up the top-level directory a bit. Change-Id: I29d3b8b7098def77e643232a386d8ba834d35704
32 lines
724 B
PHP
32 lines
724 B
PHP
<?php
|
|
|
|
namespace Vector;
|
|
|
|
use OutputPage;
|
|
use SkinTemplate;
|
|
use SkinVector;
|
|
|
|
/**
|
|
* Hook handlers for Vector skin.
|
|
*
|
|
* Hook handler method names should be in the form of:
|
|
* on<HookName>()
|
|
*/
|
|
class Hooks {
|
|
/**
|
|
* 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();
|
|
}
|
|
}
|
|
}
|