public function setAuthors($authors) { // First, remove any authors currently in the XML. $this->_xmlloader->removeElements('/author'); // Now I can add the ones in the authors array. foreach ($authors as $a) { if (isset($a['email']) && $a['email']) { $this->_xmlloader->getElement('//theme/author[@name="' . $a['name'] . '"][@email="' . $a['email'] . '"]'); } else { $this->_xmlloader->getElement('//theme/author[@name="' . $a['name'] . '"]'); } } }
/** * Set all asset files in this component. Only really usable in the installer. * * @param $files array Array of files to set. */ public function setViewFiles($files) { // Clear out the array first. $this->_xmlloader->removeElements('//component/view/file'); // It would be nice to have them alphabetical. $newarray = array(); foreach ($files as $f) { $newarray[$f['file']] = $f; } ksort($newarray); // And recreate them all. foreach ($newarray as $f) { $el = $this->_xmlloader->createElement('//component/view/file[@filename="' . $f['file'] . '"][@md5="' . $f['md5'] . '"]'); } }