svn: /pear2/sandbox/pear2.php.net/trunk/ src/PEAR2Web/Router.php www/templates/pear2/html/SearchForm.tpl.php

[email protected] (Michael Gauthier)
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
gauthierm                                Wed, 23 Jun 2010 21:02:39 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=300711

Log:
Show search keywords in the search for on search page and change URI of search page to be 'search'.

Changed paths:
    U   pear2/sandbox/pear2.php.net/trunk/src/PEAR2Web/Router.php
    U   pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/SearchForm.tpl.php

Modified: pear2/sandbox/pear2.php.net/trunk/src/PEAR2Web/Router.php
===================================================================
--- pear2/sandbox/pear2.php.net/trunk/src/PEAR2Web/Router.php	2010-06-23 20:53:09 UTC (rev 300710)
+++ pear2/sandbox/pear2.php.net/trunk/src/PEAR2Web/Router.php	2010-06-23 21:02:39 UTC (rev 300711)
@@ -37,6 +37,10 @@

         if ($requestURI === $base) {
             $options['view'] = 'news';
+        } elseif ($requestURI === $base . 'search/'
+            || $requestURI === $base . 'search'
+        ) {
+            $options['view'] = 'search';
         } elseif ($requestURI === $base . 'categories/') {
             $options['view'] = 'categories';
         } elseif ($requestURI === $base . 'packages/') {

Modified: pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/SearchForm.tpl.php
===================================================================
--- pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/SearchForm.tpl.php	2010-06-23 20:53:09 UTC (rev 300710)
+++ pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/SearchForm.tpl.php	2010-06-23 21:02:39 UTC (rev 300711)
@@ -1,6 +1,10 @@
-<form method="get" action="." id="find-packages">
+<?php
+
+$keywords = (isset($parent->context->query)) ? $parent->context->query : null;
+
+?>
+<form method="get" action="search" id="find-packages">
     <div>
-        <input type="search" placeholder="Package name or description …" size="30" name="q" /><input class="button" value="Search" type="submit" />
-        <input type="hidden" name="view" value="search" />
+        <input type="search" placeholder="Package name or description …" size="30" name="q" value="<?php echo $keywords; ?>" /><input class="button" value="Search" type="submit" />
     </div>
-</form>
\ No newline at end of file
+</form>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.