src/snac/client/webui/WebUIExecutor.php
/**
     * Display Edit Page
     *
     * Fills the display object with the edit page for a 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 Edit Page
Fills the display object with the edit page for a given user.


Display Edit Page Fills the display object with the edit page for a given user .
public function displayEditPage(&$input, &$display) {
        $query = $input;
        $constellation = null;
        if ($input["command"] == "edit_part" && isset($input["part"]) && (!isset($input["constellationid"]) || $input["constellationid"] == '') ) {
            $c = new \snac\data\Constellation();
            $constellation = $c->toArray();
        } else {
            $this->logger->addDebug("Sending query to the server", $query);
            $serverResponse = $this->connect->query($query);
            $this->logger->addDebug("Received server response", array($serverResponse));
            if (isset($serverResponse["constellation"]))
                $constellation = $serverResponse["constellation"];
        }
        if ($constellation != null) {
            if ($input["command"] == "edit_part" && isset($input["part"]))
                $display->setTemplate("edit_tabs/".$input["part"]);
            else
                $display->setTemplate("edit_page");
            if (\snac\Config::$DEBUG_MODE == true) {
                $display->addDebugData("constellationSource", json_encode($constellation, JSON_PRETTY_PRINT));
                if (isset($serverResponse))
                    $display->addDebugData("serverResponse", json_encode($serverResponse, JSON_PRETTY_PRINT));
            }
            $this->logger->addDebug("Setting constellation data into the page template");
            $display->setData(array_merge(
                $constellation,
                array("reviewNote" => isset($serverResponse["review_note"]) ? $serverResponse["review_note"] : null)
            ));
        } else {
                $this->logger->addDebug("Error page being drawn");
                $this->drawErrorPage($serverResponse, $display);
        }
    }
public function displayEditPage ( & $ input , & $ display ) { $ query = $ input ; $ constellation = null ; if ( $ input [ " command " ] == " edit_part " && isset ( $ input [ " part " ] ) && ( ! isset ( $ input [ " constellationid " ] ) || $ input [ " constellationid " ] == '' ) ) { $ c = new \ snac \ data \ Constellation ( ) ; $ constellation = $ c -> toArray ( ) ; } else { $ this -> logger -> addDebug ( " Sending query to the server " , $ query ) ; $ serverResponse = $ this -> connect -> query ( $ query ) ; $ this -> logger -> addDebug ( " Received server response " , array ( $ serverResponse ) ) ; if ( isset ( $ serverResponse [ " constellation " ] ) ) $ constellation = $ serverResponse [ " constellation " ] ; } if ( $ constellation != null ) { if ( $ input [ " command " ] == " edit_part " && isset ( $ input [ " part " ] ) ) $ display -> setTemplate ( " edit_tabs/ " . $ input [ " part " ] ) ; else $ display -> setTemplate ( " edit_page " ) ; if ( \ snac \ Config :: $ DEBUG_MODE == true ) { $ display -> addDebugData ( " constellationSource " , json_encode ( $ constellation , JSON_PRETTY_PRINT ) ) ; if ( isset ( $ serverResponse ) ) $ display -> addDebugData ( " serverResponse " , json_encode ( $ serverResponse , JSON_PRETTY_PRINT ) ) ; } $ this -> logger -> addDebug ( " Setting constellation data into the page template " ) ; $ display -> setData ( array_merge ( $ constellation , array ( " reviewNote " => isset ( $ serverResponse [ " review_note " ] ) ? $ serverResponse [ " review_note " ] : null ) ) ) ; } else { $ this -> logger -> addDebug ( " Error page being drawn " ) ; $ this -> drawErrorPage ( $ serverResponse , $ display ) ; } }
Display Edit Page
 Fills the display object with the edit page for a given user.
Display Edit Page Fills the display object with the edit page for a given user .
// If they are asking for a part and they haven't been given a constellation ID (new page), then let them through anyway