summaryrefslogtreecommitdiff
path: root/www/wiki/skins/Vector/includes/Hooks.php
blob: cdebeae46d372fb2b35e14449eb02f99f691083a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?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();
		}
	}
}