quick search string session var

This commit is contained in:
naomiaro 2011-01-06 01:26:48 -05:00
parent 7aac80ed58
commit daf37fa548
2 changed files with 13 additions and 12 deletions

View File

@ -38,9 +38,9 @@ class LibraryController extends Zend_Controller_Action
unset($this->search_sess->page);
unset($this->search_sess->md);
if ($this->getRequest()->isGet()) {
unset($this->search_sess->quick);
}
//if ($this->getRequest()->isGet()) {
// unset($this->search_sess->quick);
//}
$this->_helper->actionStack('contents', 'library');
$this->_helper->actionStack('quick-search', 'library');
@ -155,9 +155,6 @@ class LibraryController extends Zend_Controller_Action
$last_page = null;
}
$currpage = isset($page) ? $page : $last_page;
$this->search_sess->page = $currpage;
if(isset($this->search_sess->md)){
$md = $this->search_sess->md;
$quick = false;
@ -171,6 +168,9 @@ class LibraryController extends Zend_Controller_Action
$quick = false;
}
$currpage = isset($page) ? $page : $last_page;
$this->search_sess->page = $currpage;
$count = StoredFile::searchFiles($md, $order, true, null, null, $quick);
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Null($count));
@ -208,15 +208,16 @@ class LibraryController extends Zend_Controller_Action
$this->_helper->viewRenderer->setResponseSegment('quick_search');
//$this->view->urlparams = array("route" => array("controller"=> "Library", "action"=> "index", "module"=> "default"));
$this->route = 'quick_search';
$this->view->qs_value = $this->search_sess->quick_string;
$search = $this->_getParam('search', null);
$format = $this->_getParam('format', 'layout');
if($format !== 'json')
return;
$search = $this->_getParam('search', null);
$this->search_sess->quick_string = $search;
$categories = array("dc:title", "dc:creator", "dc:source");
$keywords = explode(" ", $search);

View File

@ -1,2 +1,2 @@
<label for="quick_search">Search:</label>
<input id="quick_search" name="quick_search" type="text"></input>
<input id="quick_search" name="quick_search" type="text" value = "<?php echo $this->qs_value ?>"></input>