/** * Diese Funktion, soll es dem Programmierer erleichtern die Konfigurationsdatei der * Erweiterung zu speichern. Übergeben wird dabei ein Array der Konfiguration. * Dies wird dann als XML Datei abgespeichert und auf FP geschrieben. * @param Array $config Die Konfiguration der Erweiterung * */ function saveConfiguration($config) { $configFile = "ext/" . $this->extConfig['basename'] . "/config.xml"; require_once "lib/Miplex2/BeautifyXML.class.php"; $beauty = new BeautifyXML(); $node = $beauty->formatXML($this->_prepareNode($config)); $fp = fopen($configFile, "w"); fwrite($fp, $node); fclose($fp); }
/** * Abspeichern des Inhaltes der im Speicher liegenden XML Datei * * @author Martin Grund * @return Boolean Endzustand */ function saveXML($beautify = 1) { require_once $this->miplexConfiguration->miplexDir . "BeautifyXML.class.php"; $bea = new BeautifyXML(); $xml = $this->xPathHandle->exportAsXml(); //Reformat XML $xml = $bea->formatXML($xml); $hFile = fopen($this->miplexConfiguration->contentDir . $this->miplexConfiguration->contentFileName, "w"); $cnt = fwrite($hFile, $xml); if ($cnt > 0) { return true; } else { return false; } }