src/snac/client/webui/WebUIExecutor.php
/**
     * Display Sources Page
     *
     * Loads the sources page for a given constellation 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 Sources Page
Loads the sources page for a given constellation input into the display.


Display Sources Page Loads the sources page for a given constellation input into the display .
public function displaySourcesPage(&$input, &$display) {
        $serverResponse = $this->getConstellation($input, $display, false);
        if (isset($serverResponse["constellation"])) {
            $display->setTemplate("source_page");
            $constellation = new \snac\data\Constellation($serverResponse["constellation"]);
            $sources = $constellation->collateAllSCMCitationsBySource();
            uasort($sources, function($a, $b) {
                if ($a->getID() == null)
                    return 1;
                if ($b->getID() == null)
                    return -1;
                return $a->getDisplayName() <=> $b->getDisplayName();
            });
            $constellation->setAllSources($sources);
            $this->logger->addDebug("Setting constellation data into the page template");
            $display->setData(array_merge(
                $constellation->toArray()
            ));
        } else {
            $this->logger->addDebug("Error page being drawn");
            $this->drawErrorPage($serverResponse, $display);
        }
    }
public function displaySourcesPage ( & $ input , & $ display ) { $ serverResponse = $ this -> getConstellation ( $ input , $ display , false ) ; if ( isset ( $ serverResponse [ " constellation " ] ) ) { $ display -> setTemplate ( " source_page " ) ; $ constellation = new \ snac \ data \ Constellation ( $ serverResponse [ " constellation " ] ) ; $ sources = $ constellation -> collateAllSCMCitationsBySource ( ) ; uasort ( $ sources , function ( $ a , $ b ) { if ( $ a -> getID ( ) == null ) return 1 ; if ( $ b -> getID ( ) == null ) return - 1 ; return $ a -> getDisplayName ( ) <=> $ b -> getDisplayName ( ) ; } ) ; $ constellation -> setAllSources ( $ sources ) ; $ this -> logger -> addDebug ( " Setting constellation data into the page template " ) ; $ display -> setData ( array_merge ( $ constellation -> toArray ( ) ) ) ; } else { $ this -> logger -> addDebug ( " Error page being drawn " ) ; $ this -> drawErrorPage ( $ serverResponse , $ display ) ; } }
Display Sources Page
 Loads the sources page for a given constellation input into the display.
Display Sources Page Loads the sources page for a given constellation input into the display .
//$serverResponse = $this->getConstellation($input, $display, false);