]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Fix ticket #2208: regression in XMPP sending when server != host
[quix0rs-gnu-social.git] / lib / action.php
index 813d089fefb3a3efc371df2ea2dc69bd1e18d960..816086d202f00889f686d31a228ac1e5049b5d49 100644 (file)
@@ -199,10 +199,6 @@ class Action extends HTMLOutputter // lawsuit
             if (Event::handle('StartShowStatusNetStyles', array($this)) &&
                 Event::handle('StartShowLaconicaStyles', array($this))) {
                 $this->cssLink('css/display.css',null,'screen, projection, tv');
-                if (common_config('site', 'mobile')) {
-                    // TODO: "handheld" CSS for other mobile devices
-                    $this->cssLink('css/mobile.css','base','only screen and (max-device-width: 480px)'); // Mobile WebKit
-                }
                 $this->cssLink('css/print.css','base','print');
                 Event::handle('EndShowStatusNetStyles', array($this));
                 Event::handle('EndShowLaconicaStyles', array($this));
@@ -250,21 +246,20 @@ class Action extends HTMLOutputter // lawsuit
     {
         if (Event::handle('StartShowScripts', array($this))) {
             if (Event::handle('StartShowJQueryScripts', array($this))) {
-                $this->script('js/jquery.min.js');
-                $this->script('js/jquery.form.js');
-                $this->script('js/jquery.cookie.js');
-                $this->script('js/json2.js');
-                $this->script('js/jquery.joverlay.min.js');
+                $this->script('jquery.min.js');
+                $this->script('jquery.form.js');
+                $this->script('jquery.cookie.js');
+                $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.js').'"); }');
+                $this->script('jquery.joverlay.min.js');
                 Event::handle('EndShowJQueryScripts', array($this));
             }
             if (Event::handle('StartShowStatusNetScripts', array($this)) &&
                 Event::handle('StartShowLaconicaScripts', array($this))) {
-                $this->script('js/xbImportNode.js');
-                $this->script('js/util.js');
-                $this->script('js/geometa.js');
+                $this->script('xbImportNode.js');
+                $this->script('util.js');
+                $this->script('geometa.js');
                 // Frame-busting code to avoid clickjacking attacks.
-                $this->element('script', array('type' => 'text/javascript'),
-                               'if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
+                $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
                 Event::handle('EndShowStatusNetScripts', array($this));
                 Event::handle('EndShowLaconicaScripts', array($this));
             }
@@ -373,7 +368,11 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('div', array('id' => 'header'));
         $this->showLogo();
         $this->showPrimaryNav();
-        $this->showSiteNotice();
+        if (Event::handle('StartShowSiteNotice', array($this))) {
+            $this->showSiteNotice();
+
+            Event::handle('EndShowSiteNotice', array($this));
+        }
         if (common_logged_in()) {
             $this->showNoticeForm();
         } else {
@@ -392,13 +391,20 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('address', array('id' => 'site_contact',
                                              'class' => 'vcard'));
         if (Event::handle('StartAddressData', array($this))) {
+            if (common_config('singleuser', 'enabled')) {
+                $url = common_local_url('showstream',
+                                        array('nickname' => common_config('singleuser', 'nickname')));
+            } else {
+                $url = common_local_url('public');
+            }
             $this->elementStart('a', array('class' => 'url home bookmark',
-                                           'href' => common_local_url('public')));
+                                           'href' => $url));
             if (common_config('site', 'logo') || file_exists(Theme::file('logo.png'))) {
                 $this->element('img', array('class' => 'logo photo',
                                             'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : Theme::path('logo.png'),
                                             'alt' => common_config('site', 'name')));
             }
+            $this->text(' ');
             $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
             $this->elementEnd('a');
             Event::handle('EndAddressData', array($this));
@@ -414,15 +420,6 @@ class Action extends HTMLOutputter // lawsuit
     function showPrimaryNav()
     {
         $user = common_current_user();
-        $connect = '';
-        if (common_config('xmpp', 'enabled')) {
-            $connect = 'imsettings';
-        } else if (common_config('sms', 'enabled')) {
-            $connect = 'smssettings';
-        } else if (common_config('twitter', 'enabled')) {
-            $connect = 'twittersettings';
-        }
-
         $this->elementStart('dl', array('id' => 'site_nav_global_primary'));
         $this->element('dt', null, _('Primary site navigation'));
         $this->elementStart('dd');
@@ -433,10 +430,8 @@ class Action extends HTMLOutputter // lawsuit
                                 _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
                 $this->menuItem(common_local_url('profilesettings'),
                                 _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
-                if ($connect) {
-                    $this->menuItem(common_local_url($connect),
-                                    _('Connect'), _('Connect to services'), false, 'nav_connect');
-                }
+                $this->menuItem(common_local_url('oauthconnectionssettings'),
+                                _('Connect'), _('Connect to services'), false, 'nav_connect');
                 if ($user->hasRight(Right::CONFIGURESITE)) {
                     $this->menuItem(common_local_url('siteadminpanel'),
                                     _('Admin'), _('Change site configuration'), false, 'nav_admin');
@@ -794,20 +789,41 @@ class Action extends HTMLOutputter // lawsuit
         if (Event::handle('StartShowContentLicense', array($this))) {
             $this->element('dt', array('id' => 'site_content_license'), _('Site content license'));
             $this->elementStart('dd', array('id' => 'site_content_license_cc'));
-            $this->elementStart('p');
-            $this->element('img', array('id' => 'license_cc',
-                                        'src' => common_config('license', 'image'),
-                                        'alt' => common_config('license', 'title'),
-                                        'width' => '80',
-                                        'height' => '15'));
-            //TODO: This is dirty: i18n
-            $this->text(_('All '.common_config('site', 'name').' content and data are available under the '));
-            $this->element('a', array('class' => 'license',
-                                      'rel' => 'external license',
-                                      'href' => common_config('license', 'url')),
-                           common_config('license', 'title'));
-            $this->text(_('license.'));
-            $this->elementEnd('p');
+
+            switch (common_config('license', 'type')) {
+            case 'private':
+                $this->element('p', null, sprintf(_('Content and data of %1$s are private and confidential.'),
+                                                  common_config('site', 'name')));
+                // fall through
+            case 'allrightsreserved':
+                if (common_config('license', 'owner')) {
+                    $this->element('p', null, sprintf(_('Content and data copyright by %1$s. All rights reserved.'),
+                                                      common_config('license', 'owner')));
+                } else {
+                    $this->element('p', null, _('Content and data copyright by contributors. All rights reserved.'));
+                }
+                break;
+            case 'cc': // fall through
+            default:
+                $this->elementStart('p');
+                $this->element('img', array('id' => 'license_cc',
+                                            'src' => common_config('license', 'image'),
+                                            'alt' => common_config('license', 'title'),
+                                            'width' => '80',
+                                            'height' => '15'));
+                $this->text(' ');
+                //TODO: This is dirty: i18n
+                $this->text(_('All '.common_config('site', 'name').' content and data are available under the '));
+                $this->element('a', array('class' => 'license',
+                                          'rel' => 'external license',
+                                          'href' => common_config('license', 'url')),
+                               common_config('license', 'title'));
+                $this->text(' ');
+                $this->text(_('license.'));
+                $this->elementEnd('p');
+                break;
+            }
+
             $this->elementEnd('dd');
             Event::handle('EndShowContentLicense', array($this));
         }
@@ -949,7 +965,7 @@ class Action extends HTMLOutputter // lawsuit
 
         if (is_null($arg)) {
             return $def;
-        } else if (in_array($arg, array('true', 'yes', '1'))) {
+        } else if (in_array($arg, array('true', 'yes', '1', 'on'))) {
             return true;
         } else if (in_array($arg, array('false', 'no', '0'))) {
             return false;