protected function loadOutputSettings($themePath)
{
$outputs = array();
$xml = $this->loadXML($this->toFullPath($themePath, $this->themeConfigFileName));
if ($xml != NULL) {
$nodes = $this->getNodes($xml, self::TAG_OUTPUT);
foreach ($nodes as $node) {
/* @var $node \SimpleXMLElement */
try {
// First we have to search if there is an ouput
// registered with the name specifed in the XML.
$outputName = $this->readAttribute($node, self::ATTR_OUTPUT_NAME);
$output = $this->getOutputService()->findByName($outputName);
if ($output != NULL) {
$oset = $this->loadOutputSetting($node, $themePath);
$oset->setOutput($output);
$outputs[] = $oset;
} else {
$this->getErrorHandler()->warning(ThemeErrors::OUTPUT_MISSING, $outputName);
}
} catch (XMLMissingAttribueException $e) {
$this->getErrorHandler()->error(ThemeErrors::XML_MISSING_ATTRIBUTE, self::ATTR_OUTPUT_NAME, self::TAG_OUTPUT);
} catch (FailedException $e) {
// Nothing to do.
}
}
}
return $outputs;
}