Exemplo n.º 1
0
 /**
  * send response
  * @access public
  *
  */
 public function sendResponse()
 {
     $xml =& QFinder_Connector_Core_Factory::getInstance("Core_Xml");
     $this->_connectorNode =& $xml->getConnectorNode();
     $this->checkConnector();
     if ($this->mustCheckRequest()) {
         $this->checkRequest();
     }
     $resourceTypeName = $this->_currentFolder->getResourceTypeName();
     if (!empty($resourceTypeName)) {
         $this->_connectorNode->addAttribute("resourceType", $this->_currentFolder->getResourceTypeName());
     }
     if ($this->mustAddCurrentFolderNode()) {
         $_currentFolder = new Qfinder_Connector_Utils_XmlNode("CurrentFolder");
         $this->_connectorNode->addChild($_currentFolder);
         $_currentFolder->addAttribute("path", QFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($this->_currentFolder->getClientPath()));
         $this->_errorHandler->setCatchAllErros(true);
         $_url = $this->_currentFolder->getUrl();
         $_currentFolder->addAttribute("url", is_null($_url) ? "" : QFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($_url));
         $this->_errorHandler->setCatchAllErros(false);
         $_currentFolder->addAttribute("acl", $this->_currentFolder->getAclMask());
     }
     $this->buildXml();
     $_oErrorNode =& $xml->getErrorNode();
     $_oErrorNode->addAttribute("number", "0");
     echo $this->_connectorNode->asXML();
     exit;
 }
Exemplo n.º 2
0
 /**
  * Send error message to the browser. If error number is set to 1, $text (custom error message) will be displayed
  * Don't call this function directly
  *
  * @access public
  * @param int $number error number
  * @param string $text Custom error message (optional)
  */
 public function raiseError($number, $text = false)
 {
     $this->_errorNode->addAttribute("number", intval($number));
     if (false != $text) {
         $this->_errorNode->addAttribute("text", $text);
     }
     echo $this->_connectorNode->asXML();
 }