예제 #1
0
 function sendInfoPanelsDef()
 {
     $fileData = file_get_contents($this->xmlFilePath);
     $matches = array();
     preg_match('/<infoPanels>.*<\\/infoPanels>/', str_replace("\n", "", $fileData), $matches);
     if (count($matches)) {
         AJXP_XMLWriter::header();
         AJXP_XMLWriter::write($this->replaceAjxpXmlKeywords(str_replace("\n", "", $matches[0])), true);
         AJXP_XMLWriter::close();
         exit(1);
     }
 }
예제 #2
0
 /**
  * Send a success or error message to the client.
  * @static
  * @param $logMessage
  * @param $errorMessage
  * @param bool $print
  * @return string
  */
 public static function sendMessage($logMessage, $errorMessage, $print = true)
 {
     if ($errorMessage == null) {
         $messageType = "SUCCESS";
         $message = AJXP_Utils::xmlContentEntities($logMessage);
     } else {
         $messageType = "ERROR";
         $message = AJXP_Utils::xmlContentEntities($errorMessage);
     }
     return AJXP_XMLWriter::write("<message type=\"{$messageType}\">" . $message . "</message>", $print);
 }
예제 #3
0
 /**
  * Print the XML for actions
  *
  * @param boolean $filterByRight
  * @param User $user
  */
 function sendActionsToClient($filterByRight, $user, $repository)
 {
     //AJXP_XMLWriter::header();
     foreach ($this->actions as $name => $action) {
         if ($name == "get_driver_actions" || $name == "get_ajxp_actions") {
             continue;
         }
         if ($filterByRight && $this->actionNeedsRight($name, "r")) {
             if ($user == null || !$user->canRead($repository->getId())) {
                 continue;
             }
         }
         if ($filterByRight && $this->actionNeedsRight($name, "w")) {
             if ($user == null || !$user->canWrite($repository->getId())) {
                 continue;
             }
         }
         if (isset($action["XML"])) {
             $xml = $action["XML"];
             $xml = $this->replaceAjxpXmlKeywords($xml);
             $xml = preg_replace("/[\n\r]?/", "", $xml);
             $xml = preg_replace("/\t/", " ", $xml);
             AJXP_XMLWriter::write($xml, true);
         }
     }
     //AJXP_XMLWriter::close();
 }