src/snac/client/webui/WebUIExecutor.php
/**
     * Display Search Page
     *
     * Loads the search page for a given query input into the display.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @param \snac\client\webui\display\Display $display The display object for page creation
     */
Display Search Page
Loads the search page for a given query input into the display.


Display Search Page Loads the search page for a given query input into the display .
public function displaySearchPage(&$input, &$display) {
        if (!isset($input["term"])) {
            $display->setTemplate("search_page");
            return;
        }
        if (!isset($input["entity_type"]))
            $input["entity_type"] = "";
        if (isset($input["q"])) {
            $input["term"] = $input["q"];
        }
        if (!isset($input["biog_hist"]))
            $input["biog_hist"] = null;
        $input["facets"] = array();
        if (isset($input["subject"])) {
            $input["facets"]["subject"] = $input["subject"];
        }
        if (isset($input["occupation"])) {
            $input["facets"]["occupation"] = $input["occupation"];
        }
        if (isset($input["activity"])) {
            $input["facets"]["activity"] = $input["activity"];
        }
        $results = $this->performNameSearch($input);
        if (isset($results["results"])) {
            $results["query"] = $input["term"];
            $results["entityType"] = $input["entity_type"];
            $results["searchType"] = $results["search_type"];
            $results["facets"] = $input["facets"];
            $results["aggregations"] = $results["aggregations"];
            $results["biog_hist"] = $input["biog_hist"];
            $display->setTemplate("search_page");
            $this->logger->addDebug("Set the following results into the search page", $results);
            $display->setData($results);
        } else {
            $this->logger->addDebug("Error page being drawn");
            $this->drawErrorPage($results, $display);
        }
    }
public function displaySearchPage ( & $ input , & $ display ) { if ( ! isset ( $ input [ " term " ] ) ) { $ display -> setTemplate ( " search_page " ) ; return ; } if ( ! isset ( $ input [ " entity_type " ] ) ) $ input [ " entity_type " ] = " " ; if ( isset ( $ input [ " q " ] ) ) { $ input [ " term " ] = $ input [ " q " ] ; } if ( ! isset ( $ input [ " biog_hist " ] ) ) $ input [ " biog_hist " ] = null ; $ input [ " facets " ] = array ( ) ; if ( isset ( $ input [ " subject " ] ) ) { $ input [ " facets " ] [ " subject " ] = $ input [ " subject " ] ; } if ( isset ( $ input [ " occupation " ] ) ) { $ input [ " facets " ] [ " occupation " ] = $ input [ " occupation " ] ; } if ( isset ( $ input [ " activity " ] ) ) { $ input [ " facets " ] [ " activity " ] = $ input [ " activity " ] ; } $ results = $ this -> performNameSearch ( $ input ) ; if ( isset ( $ results [ " results " ] ) ) { $ results [ " query " ] = $ input [ " term " ] ; $ results [ " entityType " ] = $ input [ " entity_type " ] ; $ results [ " searchType " ] = $ results [ " search_type " ] ; $ results [ " facets " ] = $ input [ " facets " ] ; $ results [ " aggregations " ] = $ results [ " aggregations " ] ; $ results [ " biog_hist " ] = $ input [ " biog_hist " ] ; $ display -> setTemplate ( " search_page " ) ; $ this -> logger -> addDebug ( " Set the following results into the search page " , $ results ) ; $ display -> setData ( $ results ) ; } else { $ this -> logger -> addDebug ( " Error page being drawn " ) ; $ this -> drawErrorPage ( $ results , $ display ) ; } }
Display Search Page
 Loads the search page for a given query input into the display.
Display Search Page Loads the search page for a given query input into the display .
// if the user didn't set a term, then show an empty search page.