summaryrefslogtreecommitdiff
path: root/www/wiki/skins/Vector/includes/Hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/skins/Vector/includes/Hooks.php')
-rw-r--r--www/wiki/skins/Vector/includes/Hooks.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/www/wiki/skins/Vector/includes/Hooks.php b/www/wiki/skins/Vector/includes/Hooks.php
new file mode 100644
index 00000000..cdebeae4
--- /dev/null
+++ b/www/wiki/skins/Vector/includes/Hooks.php
@@ -0,0 +1,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();
+ }
+ }
+}