Beispiel #1
0
 /**
  * Update the options XML with a new document
  * 
  * @param object Harmoni_DOMDocument $optionsDocument
  * @return null
  * @access public
  * @since 5/15/08
  */
 public function updateOptionsDocument(Harmoni_DOMDocument $optionsDocument)
 {
     if (!$this->canModify()) {
         throw new PermissionDeniedException();
     }
     // Unset the options if we have an empty document.
     if (!isset($optionsDocument->documentElement)) {
         $this->updateThemeDataByType('options.xml', '');
         return;
     }
     // Validate any options document given.
     $optionsDocument->schemaValidateWithException(HARMONI . '/Gui2/theme_options.xsd');
     $this->updateThemeDataByType('options.xml', $optionsDocument->saveXML());
 }
 /**
  * Dumps the internal XML tree back into a string with added whitespace 
  * (new-lines and tabbing).
  * 
  * @param optional object DOMNode $node
  * @param optional int $options
  * @return string
  * @access public
  * @since 1/23/08
  */
 public function saveXMLWithWhitespace(DOMNode $node = null, $options = null)
 {
     $doc = new Harmoni_DOMDocument();
     if (is_null($node)) {
         if ($this->documentElement) {
             $doc->appendChild($doc->importNode($this->documentElement, true));
         }
     } else {
         $doc->appendChild($doc->importNode($node, true));
     }
     $doc->addWhitespaceToDocument();
     return $doc->saveXML($doc->documentElement, $options);
 }