code/forms/KnowledgeBaseSearchForm.php
public function doSearchKnowledgeBase($data, $form)
    {
        if (!$this->kbPageId) {
            return $this->controller->redirectBack();
        }

        $page = KnowledgebasePage::get()->byID($this->kbPageId);

        // just in case the page doesn't actually exist anymore
        if (!$page) {
            return $this->controller->redirectBack();
        }

        // should either go to the results page or the landing page depending on if there is a query
        $link = (!empty($data['Query']))
            ? sprintf('%s?q=%s', $page->AbsoluteLink(), strip_tags($data['Query']))
            : $page->AbsoluteLink();

        $this->extend('UpdateLink', $link, $data);

        return $this->controller->redirect($link);
    }
public function doSearchKnowledgeBase($data, $form)
    {
        if (!$this->kbPageId) {
            return $this->controller->redirectBack();
        }

        $page = KnowledgebasePage::get()->byID($this->kbPageId);

        // just in case the page doesn't actually exist anymore
        if (!$page) {
            return $this->controller->redirectBack();
        }

        // should either go to the results page or the landing page depending on if there is a query
        $link = (!empty($data['Query']))
            ? sprintf('%s?q=%s', $page->AbsoluteLink(), strip_tags($data['Query']))
            : $page->AbsoluteLink();

        $this->extend('UpdateLink', $link, $data);

        return $this->controller->redirect($link);
    }
public function doSearchKnowledgeBase ( $ data , $ form ) { if ( ! $ this -> kbPageId ) { return $ this -> controller -> redirectBack ( ) ; } $ page = KnowledgebasePage :: get ( ) -> byID ( $ this -> kbPageId ) ; // just in case the page doesn't actually exist anymore if ( ! $ page ) { return $ this -> controller -> redirectBack ( ) ; } // should either go to the results page or the landing page depending on if there is a query $ link = ( ! empty ( $ data [ 'Query' ] ) ) ? sprintf ( '%s?q=%s' , $ page -> AbsoluteLink ( ) , strip_tags ( $ data [ 'Query' ] ) ) : $ page -> AbsoluteLink ( ) ; $ this -> extend ( 'UpdateLink' , $ link , $ data ) ; return $ this -> controller -> redirect ( $ link ) ; }
Handler for the form submission.

@param array $data
@param Form $form

@return SS_HTTPResponse
Handler for the form submission .