Пример #1
0
 /**
  * Formats a string for presentation as HTML
  * @param string The string to be formatted
  * @param boolean True if the string is to be sent directly to output
  * @return string The HTML formatted string  
  */
 function forHTML($str, $doPrint = false)
 {
     require_once DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php';
     return DOMIT_Utilities::forHTML($str, $doPrint);
 }
Пример #2
0
 /**
  * Removes a cache of the specified document
  * @param string The name of the xml file to be retrieved
  * @return boolean True if a cache has been removed
  */
 function removeFromCache($xmlFileName)
 {
     require_once DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php';
     $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE;
     return unlink($name);
 }
Пример #3
0
 /**
  * Generates a node tree from an array and appends it to the specified document or node
  * @param object The document or node to which the child nodes should be appended
  * @param array An associative multidimensional array of elements and values
  */
 function fromArray(&$node, &$myArray)
 {
     if ($node->nodeType == DOMIT_DOCUMENT_NODE) {
         $docNode =& $node;
     } else {
         $docNode =& $node->ownerDocument;
     }
     foreach ($myArray as $key => $value) {
         if (is_array($value)) {
             //check for numeric indices
             $total = count($value);
             if ($total > 0 && isset($value[0])) {
                 for ($i = 0; $i < $total; $i++) {
                     $node->appendChild($docNode->createElement($key));
                     DOMIT_Utilities::fromArray($node->lastChild, $value[$i]);
                 }
             } else {
                 //generate child elements
                 $node->appendChild($docNode->createElement($key));
                 DOMIT_Utilities::fromArray($node->lastChild, $value);
             }
         } else {
             $node->appendChild($docNode->createElement($key));
             $node->lastChild->appendChild($docNode->createTextNode($value));
         }
     }
 }
 /**
  * Generates a string representation of the node and its children
  * @param boolean True if HTML readable output is desired
  * @param boolean True if illegal xml characters should be converted to entities
  * @return string The string representation  
  */
 function toString($htmlSafe = false, $subEntities = false)
 {
     require_once DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php';
     global $DOMIT_defined_entities_flip;
     $result = $subEntities ? DOMIT_Utilities::convertEntities($this->nodeValue, $DOMIT_defined_entities_flip) : $this->nodeValue;
     if ($htmlSafe) {
         $result = $this->forHTML($result);
     }
     return $result;
 }
Пример #5
0
 /**
  * output of export
  * @return bool true/false
  */
 function output_export()
 {
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     // immer ge�ndert
     header("Cache-Control: no-cache, must-revalidate");
     // HTTP/1.1
     header("Pragma: no-cache");
     // HTTP/1.0
     header("Content-type: text/xml");
     DOMIT_Utilities::fromArray($this->xmldoc, $this->OLWebOrder);
     echo $this->xmldoc->toString(false, true);
     /*echo '<pre>';
     		print_r($orders);
     		echo '</pre>';*/
     return true;
 }