/** * Enable mobile frontend * * @return bool */ private static function enable() { global $wgResourceModules; self::$enabled = true; // Do some initialization MobileFrontend2_Options::detect(); return true; }
/** * Detects options based on user preferences */ public static function detect() { $request = RequestContext::getMain()->getRequest(); self::$hideSearch = $request->getBool('hidesearch'); self::$hideLogo = $request->getBool('hidelogo'); // TODO: Previously this was lumped into hidelogo. Notify mobile team self::$hideFooter = $request->getBool('hidefooter'); // TODO: Hook for Wikimedia }
/** * Main function, used by classes that subclass QuickTemplate * to show the actual HTML output */ public function execute() { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="<?php $this->text('lang'); ?> " dir="<?php $this->text('dir'); ?> " xml:lang="<?php $this->text('lang'); ?> " xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php $this->text('pagetitle'); ?> </title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php $this->html('csslinks'); ?> <?php $this->html('headscripts'); ?> </head> <body> <?php if (!MobileFrontend2_Options::getHideSearch()) { ?> <!-- search/header --> <div id="results"></div> <div id="header"> <div id="searchbox"> <?php if (!MobileFrontend2_Options::getHideLogo()) { ?> <img src="<?php $this->text('mobilelogopath'); ?> " alt="Logo" id="logo" width="35" height="22" /> <?php } ?> <form action="<?php $this->text('wgScript'); ?> " class="search_bar" method="get"> <input type="hidden" name="title" value="Special:Search" /> <div id="sq" class="divclearable"> <input type="text" name="search" id="search" size="22" value="" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024" /> <div class="clearlink" id="clearsearch"></div> </div> <button id="goButton" type="submit"></button> </form> </div> </div> <?php } ?> <!-- content --> <div class="show" id="content_wrapper"> <!-- firstHeading --> <h1 id="firstHeading" class="firstHeading"> <span dir="auto"><?php $this->html('title'); ?> </span> </h1> <!-- /firstHeading --> <!-- bodyContent --> <div id="bodyContent"> <?php $this->html('bodycontent'); ?> <!-- debughtml --> <?php $this->html('debughtml'); ?> <!-- /debughtml --> </div> <!-- /bodyContent --> </div> <?php if (!MobileFrontend2_Options::getHideFooter()) { ?> <!-- footer --> <div id="footer"> <div class="nav" id="footmenu"> <div class="mwm-notice"> <a href="#"><?php $this->msg('mobile-frontend2-regular-site'); ?> </a> | <a href="#"><?php $this->msg('mobile-frontend2-disable-images'); ?> </a> <div id="perm"> <a href="#"><?php $this->msg('mobile-frontend2-perm-stop-redirect'); ?> </a> </div> </div> <div id="copyright"> <?php $this->msg('mobile-frontend2-copyright'); ?> </div> </div> </div> <?php } ?> <?php $this->html('bottomscripts'); ?> </body> </html> <?php }