示例#1
0
}
if ($strWarning == "") {
    // try to read parameters from script file
    /* Try to open script containing the component call */
    if (!$src_path || $src_line <= 0) {
        $strWarning .= GetMessage("comp_prop_err_param") . "<br>";
    } else {
        $abs_path = $io->RelativeToAbsolutePath($src_path);
        $f = $io->GetFile($abs_path);
        $filesrc = $f->GetContents();
        if (!$filesrc || $filesrc == "") {
            $strWarning .= GetMessage("comp_prop_err_open") . "<br>";
        }
    }
    if ($strWarning == "") {
        $arComponent = PHPParser::FindComponent($_GET["component_name"], $filesrc, $src_line);
        if ($arComponent === false) {
            $strWarning .= GetMessage("comp_prop_err_comp") . "<br>";
        } else {
            $arValues = $arComponent["DATA"]["PARAMS"];
        }
    }
}
if ($strWarning == "") {
    if ($_SERVER["REQUEST_METHOD"] == "POST" && $_GET["action"] == "refresh") {
        // parameters were changed by "ok" button
        // we need to refresh the component description with new values
        $arValues = array_merge($arValues, $_POST);
    }
    $curTemplate = isset($_POST["NEW_COMPONENT_TEMPLATE"]) ? $_POST["NEW_COMPONENT_TEMPLATE"] : $_GET["component_template"];
    $arComponentDescription = CComponentUtil::GetComponentDescr($_GET["component_name"]);
示例#2
0
}
if ($strWarning == "") {
    // try to read parameters from script file
    /* Try to open script containing the component call */
    if (!$src_path || $src_line <= 0) {
        $strWarning .= GetMessage("comp_prop_err_param") . "<br>";
    } else {
        $abs_path = $io->RelativeToAbsolutePath($src_path);
        $f = $io->GetFile($abs_path);
        $filesrc = $f->GetContents();
        if (!$filesrc || $filesrc == "") {
            $strWarning .= GetMessage("comp_prop_err_open") . "<br>";
        }
    }
    if ($strWarning == "") {
        $arComponent = PHPParser::FindComponent($componentName, $filesrc, $src_line);
        if ($arComponent === false) {
            $strWarning .= GetMessage("comp_prop_err_comp") . "<br>";
        } else {
            $arValues = $arComponent["DATA"]["PARAMS"];
        }
    }
}
if ($strWarning == "") {
    if ($_SERVER["REQUEST_METHOD"] == "POST" && $_GET["action"] == "refresh") {
        // parameters were changed by "ok" button
        // we need to refresh the component description with new values
        $arValues = array_merge($arValues, $_POST);
    }
    $curTemplate = isset($_POST["COMPONENT_TEMPLATE"]) ? $_POST["COMPONENT_TEMPLATE"] : $componentTemplate;
    $data = CComponentParamsManager::GetComponentProperties($componentName, $curTemplate, $templateId, $arValues);