]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/MobileProfile/MobileProfilePlugin.php
Initial Facebook admin panel
[quix0rs-gnu-social.git] / plugins / MobileProfile / MobileProfilePlugin.php
index 8b5e5f31da6b1a08077c4cfcd160c4bc0a7854ad..f788639aed7383d7b7fe1ca2ec9042c2cc257f07 100644 (file)
@@ -240,6 +240,8 @@ class MobileProfilePlugin extends WAP20Plugin
             return true;
         }
 
+        $action->cssLink('css/display.css');
+
         if (file_exists(Theme::file('css/mp-screen.css'))) {
             $action->cssLink('css/mp-screen.css', null, 'screen');
         } else {
@@ -256,6 +258,14 @@ class MobileProfilePlugin extends WAP20Plugin
     }
 
 
+    function onStartShowUAStyles($action) {
+        if (!$this->serveMobile) {
+            return true;
+        }
+
+        return false;
+    }
+
     function onStartShowHeader($action)
     {
         if (!$this->serveMobile) {
@@ -302,8 +312,6 @@ class MobileProfilePlugin extends WAP20Plugin
             $connect = 'imsettings';
         } else if (common_config('sms', 'enabled')) {
             $connect = 'smssettings';
-        } else if (common_config('twitter', 'enabled')) {
-            $connect = 'twittersettings';
         }
 
         $action->elementStart('ul', array('id' => 'site_nav_global_primary'));
@@ -316,6 +324,10 @@ class MobileProfilePlugin extends WAP20Plugin
                 $action->menuItem(common_local_url($connect),
                                 _('Connect'));
             }
+            if ($user->hasRight(Right::CONFIGURESITE)) {
+                $action->menuItem(common_local_url('siteadminpanel'),
+                                _('Admin'), _('Change site configuration'), false, 'nav_admin');
+            }
             if (common_config('invite', 'enabled')) {
                 $action->menuItem(common_local_url('invite'),
                                 _('Invite'));
@@ -352,9 +364,6 @@ class MobileProfilePlugin extends WAP20Plugin
 
         $contentLimit = Notice::maxContent();
 
-        $form->out->element('script', array('type' => 'text/javascript'),
-                            'maxLength = ' . $contentLimit . ';');
-
         if ($contentLimit > 0) {
             $form->out->element('div', array('id' => 'notice_text-count'),
                                 $contentLimit);
@@ -413,7 +422,15 @@ class MobileProfilePlugin extends WAP20Plugin
 
         return $proto.'://'.$serverpart.'/'.$pathpart.$relative;
     }
-}
-
 
-?>
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'MobileProfile',
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Sarven Capadisli',
+                            'homepage' => 'http://status.net/wiki/Plugin:MobileProfile',
+                            'rawdescription' =>
+                            _m('XHTML MobileProfile output for supporting user agents.'));
+        return true;
+    }
+}