]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/MobileProfile/MobileProfilePlugin.php
Add two i18n related FIXMEs.
[quix0rs-gnu-social.git] / plugins / MobileProfile / MobileProfilePlugin.php
index a104eadd7be37e323f0988de676f73c149087a22..6076bbde0bf0cbc1134dbcb0031ce4b0d51c8c14 100644 (file)
@@ -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;
     }