Skip to content

Commit

Permalink
Fix searching from topbar if search URL contains parameters.
Browse files Browse the repository at this point in the history
When stopped working to combine form fields and form action URL parameters?
  • Loading branch information
yunosh committed Mar 4, 2013
1 parent a13fe71 commit 36ed5cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions horde/docs/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
v5.0.5-git
----------

[jan] Fix searching from topbar if search URL contains parameters.


------
Expand Down
5 changes: 5 additions & 0 deletions horde/lib/View/Topbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public function render($name = 'topbar', $locals = array())
if ($this->search) {
$GLOBALS['injector']->getInstance('Horde_PageOutput')
->addScriptFile('form_ghost.js', 'horde');
if (!isset($this->searchParameters)) {
$action = new Horde_Url($this->searchAction);
$this->searchAction = $action->url;
$this->searchParameters = $action->parameters;
}
}
$this->sidebar = $GLOBALS['page_output']->sidebar;
return parent::render($name, $locals);
Expand Down
4 changes: 2 additions & 2 deletions horde/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl">LGPL-2</license>
<notes>
*
* [jan] Fix searching from topbar if search URL contains parameters.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -3604,7 +3604,7 @@
<date>2013-02-20</date>
<license uri="http://www.horde.org/licenses/lgpl">LGPL-2</license>
<notes>
*
* [jan] Fix searching from topbar if search URL contains parameters.
</notes>
</release>
</changelog>
Expand Down
3 changes: 3 additions & 0 deletions horde/templates/topbar/_menubar.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<?php if ($this->search): ?>
<div id="horde-search">
<form action="<?php echo $this->searchAction ?>" method="get">
<?php foreach ($this->searchParameters as $name => $value): ?>
<input type="hidden" name="<?php echo $this->h($name) ?>" value="<?php echo $this->h($value) ?>" />
<?php endforeach ?>
<?php if ($this->searchMenu): ?>
<div class="horde-fake-input">
<span id="horde-search-dropdown">
Expand Down

0 comments on commit 36ed5cb

Please sign in to comment.