src/snac/client/webui/WebUIExecutor.php
/**
     * Display Dashboard Page
     *
     * Fills the display object with the dashboard for the given user.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @param \snac\client\webui\display\Display $display The display object for page creation
     */
Display Dashboard Page
Fills the display object with the dashboard for the given user.


Display Dashboard Page Fills the display object with the dashboard for the given user .
public function displayDashboardPage(&$input, &$display) {
        $template = "editor";
        if (isset($input["subcommand"])) {
            switch ($input["subcommand"]) {
                case "reviewer":
                    $template = "review";
                    break;
                case "explore":
                    $template = "explore";
                    break;
            }
        }
        $display->setTemplate("dashboard/$template");
        $ask = array("command"=>"user_information"
        );
        $this->logger->addDebug("Sending query to the server", $ask);
        $serverResponse = $this->connect->query($ask);
        $this->logger->addDebug("Received server response", array($serverResponse));
        $this->logger->addDebug("Setting dashboard data into the page template");
        $needsReview = $this->connect->query(array(
            "command"=>"list_constellations",
            "status"=>"needs review"
        ));
        if (isset($needsReview["results"]))
            $serverResponse["needs_review"] = $needsReview["results"];
        $recentQuery = $this->connect->query(array(
                "command"=>"recently_published"
            ));
        if (isset($recentQuery["constellation"]) && $recentQuery["constellation"] != null) {
            $recentConstellations = $recentQuery["constellation"];
            $recents = array();
            foreach ($recentConstellations as $constellationArray) {
                $constellation = new \snac\data\Constellation($constellationArray);
                array_push($recents, array(
                        "id"=>$constellation->getID(),
                        "nameEntry"=>$constellation->getPreferredNameEntry()->getOriginal()));
            }
            $serverResponse["allrecents"] = $recents;
        }
        $display->setData($serverResponse);
    }
public function displayDashboardPage ( & $ input , & $ display ) { $ template = " editor " ; if ( isset ( $ input [ " subcommand " ] ) ) { switch ( $ input [ " subcommand " ] ) { case " reviewer " : $ template = " review " ; break ; case " explore " : $ template = " explore " ; break ; } } $ display -> setTemplate ( " dashboard/ $ template " ) ; $ ask = array ( " command " => " user_information " ) ; $ this -> logger -> addDebug ( " Sending query to the server " , $ ask ) ; $ serverResponse = $ this -> connect -> query ( $ ask ) ; $ this -> logger -> addDebug ( " Received server response " , array ( $ serverResponse ) ) ; $ this -> logger -> addDebug ( " Setting dashboard data into the page template " ) ; $ needsReview = $ this -> connect -> query ( array ( " command " => " list_constellations " , " status " => " needs review " ) ) ; if ( isset ( $ needsReview [ " results " ] ) ) $ serverResponse [ " needs_review " ] = $ needsReview [ " results " ] ; $ recentQuery = $ this -> connect -> query ( array ( " command " => " recently_published " ) ) ; if ( isset ( $ recentQuery [ " constellation " ] ) && $ recentQuery [ " constellation " ] != null ) { $ recentConstellations = $ recentQuery [ " constellation " ] ; $ recents = array ( ) ; foreach ( $ recentConstellations as $ constellationArray ) { $ constellation = new \ snac \ data \ Constellation ( $ constellationArray ) ; array_push ( $ recents , array ( " id " => $ constellation -> getID ( ) , " nameEntry " => $ constellation -> getPreferredNameEntry ( ) -> getOriginal ( ) ) ) ; } $ serverResponse [ " allrecents " ] = $ recents ; } $ display -> setData ( $ serverResponse ) ; }
Display Dashboard Page
 Fills the display object with the dashboard for the given user.
Display Dashboard Page Fills the display object with the dashboard for the given user .
// Ask the server for a list of records to edit