X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FMobileProfile%2FMobileProfilePlugin.php;h=6076bbde0bf0cbc1134dbcb0031ce4b0d51c8c14;hb=09dee24cbeadfb1fef797d38265e2ece09266bb0;hp=a104eadd7be37e323f0988de676f73c149087a22;hpb=edea825c70c2adb550e4fb47a94c497e0e92f0ad;p=quix0rs-gnu-social.git diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index a104eadd7b..6076bbde0b 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -138,11 +138,23 @@ class MobileProfilePlugin extends WAP20Plugin 'vodafone', 'wap1', 'wap2', + 'webos', 'windows ce' ); + $blacklist = array( + 'ipad', // Larger screen handles the full theme fairly well. + ); + $httpuseragent = strtolower($_SERVER['HTTP_USER_AGENT']); + foreach ($blacklist as $md) { + if (strstr($httpuseragent, $md) !== false) { + $this->serveMobile = false; + return true; + } + } + foreach ($this->mobiledevices as $md) { if (strstr($httpuseragent, $md) !== false) { $this->setMobileFeatures($httpuseragent); @@ -223,24 +235,6 @@ class MobileProfilePlugin extends WAP20Plugin } - function onStartShowHeadElements($action) - { - // @fixme nothing appears to set a serveMobile on any action, - // so this is useless and spews errors. Is this supposed to be - // checking $this? - //if (!$action->serveMobile) { - // return true; - //} - - $action->showTitle(); - $action->showShortcutIcon(); - $action->showStylesheets(); - $action->showFeeds(); - $action->showDescription(); - $action->extraHead(); - } - - function onStartShowStatusNetStyles($action) { if (!$this->serveMobile) { @@ -261,6 +255,10 @@ class MobileProfilePlugin extends WAP20Plugin $action->cssLink('plugins/MobileProfile/mp-handheld.css',null,'handheld'); } + // Allow other plugins to load their styles. + Event::handle('EndShowStatusNetStyles', array($action)); + Event::handle('EndShowLaconicaStyles', array($action)); + return false; }