/** * Load typoscript from flexValue , parse, and return conf - array * * @param string $script * @return array typoscript configuration array */ public function scriptParser($script = "") { // get constants $this->_constParser->parse(implode("\n", $GLOBALS['TSFE']->tmpl->constants), $this->_matchCondition); // recursive substitution of constants (up to 10 nested levels) for ($i = 0; $i < 10; $i++) { $old_script = $script; $script = preg_replace_callback('/\\{\\$(.[^}]*)\\}/', array($this, 'substituteConstantsCallBack'), $script); if ($old_script == $script) { break; } } if (is_array($GLOBALS['TSFE']->tmpl->setup)) { foreach ($GLOBALS['TSFE']->tmpl->setup as $tsObjectKey => $tsObjectValue) { if ($tsObjectKey !== intval($tsObjectKey)) { $this->_parser->setup[$tsObjectKey] = $tsObjectValue; } } } $script = $this->_parser->checkIncludeLines($script); $this->_parser->parse($script, $this->_matchCondition); return $this->_parser->setup; }