Newscoop\Service\Implementation\ThemeManagementServiceLocal::loadOutputSettings PHP Method

loadOutputSettings() protected method

Load all the output settings from the specified path.
protected loadOutputSettings ( string $themePath ) : array
$themePath string The theme path from where to load the output settings, *(not null not empty).
return array The array containing all the found output settings, not null.
    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;
    }