function _resolveScripting($sInterpreter, $sPath, $aConf = FALSE, $mStackedValue = array()) { $aRes = tx_ameosformidable::parseForTemplate($sPath); $aValue = $aConf; reset($aRes); while (list($i, $aExp) = each($aRes)) { if ($aValue === AMEOSFORMIDABLE_LEXER_FAILED || $aValue === AMEOSFORMIDABLE_LEXER_BREAKED) { // throwing exception to notify that lexer has failed or has breaked return $aValue; } $sTrimExpr = trim($aExp["expr"]); if ($aExp["rec"] === TRUE) { if ($sTrimExpr[0] == '"' && $sTrimExpr[strlen($sTrimExpr) - 1] == '"') { $aValue = substr($sTrimExpr, 1, -1); } else { $aBeforeValue = $aValue; $aValue = tx_ameosformidable::_resolveScripting($sInterpreter, $aExp["args"], $aConf, $aValue); if (!is_array($aValue)) { $sExecString = $aExp["expr"] . "(\"" . $aValue . "\")"; } else { $sExecString = $aExp["expr"]; } $aValue = tx_ameosformidable::_resolveScripting($sInterpreter, $sExecString, $aBeforeValue); } $sDebug = $aExp["args"]; } else { if ($sTrimExpr[0] == '"' && $sTrimExpr[strlen($sTrimExpr) - 1] == '"') { $aValue = substr($sTrimExpr, 1, -1); } else { $sExecString = $aExp["expr"]; if ($aExp["args"] !== FALSE) { $sExecString .= "(" . trim($aExp["args"]) . ")"; } if (array_key_exists($i + 1, $aRes)) { $aNextExp = $aRes[$i + 1]; $sNextExecString = $aNextExp["expr"]; if ($aNextExp["args"] !== FALSE) { $sNextExecString .= "(" . trim($aNextExp["args"]) . ")"; } } else { $sNextExecString = FALSE; } $aValue = tx_ameosformidable::_resolveScripting_atomic($sInterpreter, $sExecString, $aValue, $sNextExecString); } $sDebug = $sExecString; } } return $aValue; }