]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
gettext strings and pass the query string between tabs http://laconi.ca/PITS/00231
authorMike Cochrane <mikec@mikenz.geek.nz>
Sun, 20 Jul 2008 10:56:59 +0000 (06:56 -0400)
committerMike Cochrane <mikec@mikenz.geek.nz>
Sun, 20 Jul 2008 10:56:59 +0000 (06:56 -0400)
darcs-hash:20080720105659-533db-35a71fab668a7ea692f7b51557b4f84addb796bb.gz

lib/action.php
lib/searchaction.php

index 1d3614ae1d6f57b044472e8061eb6f3b6728edfa..8f72b542b05214c2e68429d2326727749c8b185f 100644 (file)
@@ -84,9 +84,9 @@ class Action { // lawsuit
         $action = $this->trimmed('action');
         common_element_start('ul', array('id' => 'nav_views'));
         foreach ($menu as $menuaction => $menudesc) {
-            common_menu_item(common_local_url($menuaction),
-                                                        _($menudesc[0]),
-                                                        _($menudesc[1]),
+            common_menu_item(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : NULL),
+                                                        $menudesc[0],
+                                                        $menudesc[1],
                                                         $action == $menuaction);
         }
         common_element_end('ul');
index 46779bf7acdc63e69484b77e6acda63bf5d5c103..c0eab7d2469044d1e97fb906b092b2090297dbbc 100644 (file)
@@ -92,14 +92,19 @@ class SearchAction extends Action {
        }
 
        function search_menu() {
-        # action => array('prompt', 'title')
-        static $menu =
-        array('peoplesearch' =>
-              array('People',
-                       'Find people on this site'),
-                         'noticesearch' =>
-                         array('Text',
-                                       'Find content of notices'));
+               # action => array('prompt', 'title', $args)
+               $action = $this->trimmed('action');
+               $menu =
+                       array('peoplesearch' =>
+                                 array(
+                                               _('People'),
+                                               _('Find people on this site'),
+                                               ($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL),
+                                 'noticesearch' =>
+                                 array( _('Text'),
+                                           _('Find content of notices'),
+                                               ($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL)
+                         );
                $this->nav_menu($menu);
        }
 }