/* parse source file for PHP code */ $arScripts = PHPParser::ParseFile($filesrc); /* identify the component by line number */ $aComponents = array(); foreach ($arScripts as $script) { $nLineFrom = substr_count(substr($filesrc, 0, $script[0]), "\n") + 1; $nLineTo = substr_count(substr($filesrc, 0, $script[1]), "\n") + 1; if ($nLineFrom <= $src_line && $nLineTo >= $src_line) { $aComponents[] = $script; } if ($nLineTo > $src_line) { break; } } foreach ($aComponents as $component) { $arRes = PHPParser::CheckForComponent($component[2]); if ($arRes && $arRes["SCRIPT_NAME"] == $_GET["path"]) { $arValues = $arRes["PARAMS"]; $aComponent = $component; break; } } } if ($aComponent === false) { $strWarning .= GetMessage("comp_prop_err_comp") . "<br>"; } } //$_SERVER["REQUEST_METHOD"] == "POST" && $_GET["action"] == "refresh" if ($strWarning == "") { $arTemplate = CTemplates::GetByID($_GET["path"], $arValues, $_GET["template_id"]); /* save parameters to file */