コード例 #1
0
 /** Setup index page
  */
 public function indexAction()
 {
     $content = new Content();
     $this->view->contents = $content->getFrontContent('database');
     $thumbs = new Slides();
     $this->view->thumbs = $thumbs->getLast10Thumbnails(4);
     $finds = new Finds();
     $this->view->counts = $finds->getCountAllFinds();
     $recent = new Logins();
     $this->view->logins = $recent->todayVisitors();
     $form = new SolrForm();
     $form->setMethod('post');
     $this->view->form = $form;
     $values = $form->getValues();
     if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
         if ($form->isValid($form->getValues())) {
             $params = array_filter($form->getValues());
             $params = $this->array_cleanup($params);
             $this->_flashMessenger->addMessage('Your search is complete');
             $this->_helper->Redirector->gotoSimple('results', 'search', 'database', $params);
         } else {
             $form->populate($data);
         }
     }
 }
コード例 #2
0
 /** Setup index page
  * @access public
  * @return void
  */
 public function indexAction()
 {
     $content = new Content();
     $this->view->contents = $content->getFrontContent('database');
     $recent = new Logins();
     $this->view->logins = $recent->todayVisitors();
     $form = new SolrForm();
     $form->q->setLabel('Search our database: ');
     $form->setMethod('post');
     $this->view->form = $form;
     if ($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())) {
         $functions = new Pas_ArrayFunctions();
         $params = $functions->array_cleanup($form->getValues());
         $params = $this->process($params);
         $this->getFlash()->addMessage('Your search is complete');
         $this->_helper->Redirector->gotoSimple('results', 'search', 'database', $params);
     } else {
         $form->populate($this->_request->getPost());
     }
 }
コード例 #3
0
 /** Display a list of hoards recorded with pagination
  * This redirects to just the search results as there is nothing else here.
  * @access public
  * @return void
  */
 public function indexAction()
 {
     if ($this->_user) {
         $role = $this->_user->role;
     } else {
         $role = NULL;
     }
     if (!in_array($role, array('admin', 'fa', 'hoard'))) {
         $this->getFlash()->addMessage('No access to that resource');
         $this->getResponse()->setHttpResponseCode(301)->setRawHeader('HTTP/1.1 301 Moved Permanently');
         $this->redirect('database/search/results/');
     } else {
         $form = new SolrForm();
         $form->q->setLabel('Search our database: ');
         $form->setMethod('post');
         $this->view->form = $form;
         if ($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())) {
             $functions = new Pas_ArrayFunctions();
             $params = $functions->array_cleanup($form->getValues());
             $params['objectType'] = 'HOARD';
             $this->getFlash()->addMessage('Your search is complete');
             $this->_helper->Redirector->gotoSimple('results', 'search', 'database', $params);
         } else {
             $form->populate($this->_request->getPost());
         }
     }
 }