]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Merge commit 'refs/merge-requests/165' of git://gitorious.org/statusnet/mainline...
[quix0rs-gnu-social.git] / lib / action.php
index 21e5f78db13567c0e406c922ca77382c2e62d54b..9612a82b716342efc3c69050ada5f563baa0fe55 100644 (file)
@@ -277,6 +277,13 @@ class Action extends HTMLOutputter // lawsuit
             $this->cssLink('css/display.css', $baseTheme, $media);
         }
         $this->cssLink('css/display.css', $mainTheme, $media);
+
+        // Additional styles for RTL languages
+        if (is_rtl(common_language())) {
+            if (file_exists(Theme::file('css/rtl.css'))) {
+                $this->cssLink('css/rtl.css', $mainTheme, $media);
+            }
+        }
     }
 
     /**
@@ -317,8 +324,12 @@ class Action extends HTMLOutputter // lawsuit
                     $this->script('xbImportNode.js');
                     $this->script('geometa.js');
                 }
-                $this->inlineScript('var _peopletagAC = "' .
-                    common_local_url('peopletagautocomplete') . '";');
+                // This route isn't available in single-user mode.
+                // Not sure why, but it causes errors here.
+                if (!common_config('singleuser', 'enabled')) {
+                    $this->inlineScript('var _peopletagAC = "' .
+                                        common_local_url('peopletagautocomplete') . '";');
+                }
                 $this->showScriptMessages();
                 // Anti-framing code to avoid clickjacking attacks in older browsers.
                 // This will show a blank page if the page is being framed, which is
@@ -573,6 +584,14 @@ class Action extends HTMLOutputter // lawsuit
     function showPrimaryNav()
     {
         $this->elementStart('div', array('id' => 'site_nav_global_primary'));
+
+        $user = common_current_user();
+
+        if (!empty($user) || !common_config('site', 'private')) {
+            $form = new SearchForm($this);
+            $form->show();
+        }
+
         $pn = new PrimaryNav($this);
         $pn->show();
         $this->elementEnd('div');
@@ -1360,9 +1379,13 @@ class Action extends HTMLOutputter // lawsuit
             $classes[] = 'current';
         }
 
-        $lattrs['class'] = implode(' ', $classes);
+        if (!empty($classes)) {
+            $lattrs['class'] = implode(' ', $classes);
+        }
 
-        (is_null($id)) ? $lattrs : $lattrs['id'] = $id;
+        if (!is_null($id)) {
+            $lattrs['id'] = $id;
+        }
 
         $this->elementStart('li', $lattrs);
         $attrs['href'] = $url;