src/snac/client/webui/WebUIExecutor.php
/**
     * Save Vocabulary Term
     *
     * Asks the server to update the controlled vocabulary term.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @param \snac\data\User $user The current user object
     * @return string[] The web ui's response to the client (array ready for json_encode)
     */
Save Vocabulary Term
Asks the server to update the controlled vocabulary term.

@param string[] $input Post/Get inputs from the webui
@param \snac\data\User $user The current user object
@return string[] The web ui's response to the client (array ready for json_encode)
Save Vocabulary Term Asks the server to update the controlled vocabulary term . @param string [] $input Post / Get inputs from the webui @param \ snac \ data \ User $user The current user object @return string [] The web ui ' s response to the client ( array ready for json_encode )
public function saveVocabularyTerm(&$input, &$user) {
        $request = array("command"=>"update_vocabulary");
        $term = null;
        if ($input["type"] === "geo_term") {
            $term = new \snac\data\GeoTerm();
            $term->setID($input["id"]);
            $term->setURI($input["uri"]);
            $term->setName($input["name"]);
            $term->setAdministrationCode($input["administrationCode"]);
            $term->setCountryCode($input["countryCode"]);
            $term->setLatitude($input["latitude"]);
            $term->setLongitude($input["longitude"]);
            $request["type"] = "geo_term";
        } else {
            $term = new \snac\data\Term();
            $term->setType($input["type"]);
            $term->setID($input["id"]);
            $term->setURI($input["uri"]);
            $term->setDescription($input["description"]);
            $term->setTerm($input["term"]);
            $request["type"] = "term";
        }
        $request["term"] = $term->toArray();
        $serverResponse = $this->connect->query($request);
        $response = array();
        $response["server_debug"] = $serverResponse;
        if (!is_array($serverResponse)) {
            $this->logger->addDebug("server's response: $serverResponse");
        } else {
            if (isset($serverResponse["result"]))
                $response["result"] = $serverResponse["result"];
            if (isset($serverResponse["error"])) {
                $response["error"] = $serverResponse["error"];
            }
        }
        return $response;
    }
public function saveVocabularyTerm ( & $ input , & $ user ) { $ request = array ( " command " => " update_vocabulary " ) ; $ term = null ; if ( $ input [ " type " ] === " geo_term " ) { $ term = new \ snac \ data \ GeoTerm ( ) ; $ term -> setID ( $ input [ " id " ] ) ; $ term -> setURI ( $ input [ " uri " ] ) ; $ term -> setName ( $ input [ " name " ] ) ; $ term -> setAdministrationCode ( $ input [ " administrationCode " ] ) ; $ term -> setCountryCode ( $ input [ " countryCode " ] ) ; $ term -> setLatitude ( $ input [ " latitude " ] ) ; $ term -> setLongitude ( $ input [ " longitude " ] ) ; $ request [ " type " ] = " geo_term " ; } else { $ term = new \ snac \ data \ Term ( ) ; $ term -> setType ( $ input [ " type " ] ) ; $ term -> setID ( $ input [ " id " ] ) ; $ term -> setURI ( $ input [ " uri " ] ) ; $ term -> setDescription ( $ input [ " description " ] ) ; $ term -> setTerm ( $ input [ " term " ] ) ; $ request [ " type " ] = " term " ; } $ request [ " term " ] = $ term -> toArray ( ) ; $ serverResponse = $ this -> connect -> query ( $ request ) ; $ response = array ( ) ; $ response [ " server_debug " ] = $ serverResponse ; if ( ! is_array ( $ serverResponse ) ) { $ this -> logger -> addDebug ( " server's response:  $ serverResponse " ) ; } else { if ( isset ( $ serverResponse [ " result " ] ) ) $ response [ " result " ] = $ serverResponse [ " result " ] ; if ( isset ( $ serverResponse [ " error " ] ) ) { $ response [ " error " ] = $ serverResponse [ " error " ] ; } } return $ response ; }
Save Vocabulary Term
 Asks the server to update the controlled vocabulary term.
Save Vocabulary Term Asks the server to update the controlled vocabulary term .
// Build a data structure to send to the server // Geographic Term // Standard Term object // Send the query to the server