src/snac/client/webui/WebUIExecutor.php
/**
     * Send Message
     *
     * Asks the server to send the message given in the input.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @return string The response to the client
     */
Send Message
Asks the server to send the message given in the input.

@param string[] $input Post/Get inputs from the webui
@return string The response to the client
Send Message Asks the server to send the message given in the input . @param string [] $input Post / Get inputs from the webui @return string The response to the client
public function sendMessage(&$input) {
        $response = array();
        if (isset($input["to_user"]) && isset($input["subject"]) && isset($input["body"])) {
            $toUsers = explode(",", $input["to_user"]);
            $message = new \snac\data\Message();
            $message->setSubject($input["subject"]);
            $message->setBody($input["body"]);
            $message->setFromUser($this->getUser());
            $errors = array();
            foreach ($toUsers as $toUserID) {
                $toUser = new \snac\data\User();
                $toUser->setUserID(trim($toUserID));
                $message->setToUser($toUser);
                $ask = array("command"=>"send_message",
                            "message"=>$message->toArray());
                $serverResponse = $this->connect->query($ask);
                if (!isset($serverResponse["result"]) || $serverResponse["result"] != 'success') {
                    array_push($errors, trim($toUserID));
                }
            }
            if (!empty($errors)) {
                $response["message"] = "Could not send to: " . implode(", ", $errors) . ".";
            }
            if (count($errors) < count($toUsers)) {
                $response["result"] = "success";
            }
        } else {
            $response["result"] = "error";
        }
        return $response;
    }
public function sendMessage ( & $ input ) { $ response = array ( ) ; if ( isset ( $ input [ " to_user " ] ) && isset ( $ input [ " subject " ] ) && isset ( $ input [ " body " ] ) ) { $ toUsers = explode ( " , " , $ input [ " to_user " ] ) ; $ message = new \ snac \ data \ Message ( ) ; $ message -> setSubject ( $ input [ " subject " ] ) ; $ message -> setBody ( $ input [ " body " ] ) ; $ message -> setFromUser ( $ this -> getUser ( ) ) ; $ errors = array ( ) ; foreach ( $ toUsers as $ toUserID ) { $ toUser = new \ snac \ data \ User ( ) ; $ toUser -> setUserID ( trim ( $ toUserID ) ) ; $ message -> setToUser ( $ toUser ) ; $ ask = array ( " command " => " send_message " , " message " => $ message -> toArray ( ) ) ; $ serverResponse = $ this -> connect -> query ( $ ask ) ; if ( ! isset ( $ serverResponse [ " result " ] ) || $ serverResponse [ " result " ] != 'success' ) { array_push ( $ errors , trim ( $ toUserID ) ) ; } } if ( ! empty ( $ errors ) ) { $ response [ " message " ] = " Could not send to:  " . implode ( " ,  " , $ errors ) . " . " ; } if ( count ( $ errors ) < count ( $ toUsers ) ) { $ response [ " result " ] = " success " ; } } else { $ response [ " result " ] = " error " ; } return $ response ; }
Send Message
 Asks the server to send the message given in the input.
Send Message Asks the server to send the message given in the input .
// split out the users to send to