$params = array('width' => '100%', 'height' => '200px'); if ($arField["MULTIPLE"] == "Y") { $checkHtml = false; $html = '<table id="tbl' . $FIELD_ID . '">'; foreach ($arResult["FORM_DATA"]["~" . $FIELD_ID] as $key => $value) { if ($arField["TYPE"] == "S:HTML") { if (is_array($value['VALUE'])) { $value['VALUE']['TEXT'] ? $htmlContent = $value['VALUE']['TEXT'] : ($htmlContent = ''); } else { $value['VALUE'] ? $htmlContent = $value['VALUE'] : ($htmlContent = ''); } $checkHtml = true; $fieldIdForHtml = 'id_' . $FIELD_ID . '__' . $key . '_'; $fieldNameForHtml = $FIELD_ID . "[" . $key . "][VALUE][TEXT]"; $html .= '<input type="hidden" name="' . $FIELD_ID . '[' . $key . '][VALUE][TYPE]" value="html">'; $html .= '<tr><td>' . connectionHtmlEditor($fieldIdForHtml, $fieldNameForHtml, $params, $htmlContent) . '</td></tr>'; } else { $html .= '<tr><td>' . call_user_func_array($arField["PROPERTY_USER_TYPE"]["GetPublicEditHTML"], array($arField, $value, array("VALUE" => $FIELD_ID . "[" . $key . "][VALUE]", "DESCRIPTION" => '', "FORM_NAME" => "form_" . $arResult["FORM_ID"], "MODE" => "FORM_FILL", "COPY" => $arResult["COPY_ID"] > 0))) . '</td></tr>'; } } $html .= '</table>'; if ($checkHtml) { $html .= '<input type="button" onclick="createAdditionalHtmlEditor(\'tbl' . $FIELD_ID . '\', \'' . $FIELD_ID . '\', \'' . $FIELD_ID . '\');" value="' . GetMessage("CT_BLEE_ADD_BUTTON") . '">'; } else { $html .= '<input type="button" onclick="addNewTableRow(\'tbl' . $FIELD_ID . '\', 1, /' . $FIELD_ID . '\\[(n)([0-9]*)\\]/g, 2)" value="' . GetMessage("CT_BLEE_ADD_BUTTON") . '">'; } $arTabElement[] = array("id" => $FIELD_ID, "name" => $arField["~NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html, "show" => $show); } else { $html = ''; foreach ($arResult["FORM_DATA"]["~" . $FIELD_ID] as $key => $value) { $html = call_user_func_array($arField["PROPERTY_USER_TYPE"]["GetPublicEditHTML"], array($arField, $value, array("VALUE" => $FIELD_ID . "[" . $key . "][VALUE]", "DESCRIPTION" => '', "FORM_NAME" => "form_" . $arResult["FORM_ID"], "MODE" => "FORM_FILL", "COPY" => $arResult["COPY_ID"] > 0)));
$arTab1Fields[] = array("id" => "DEFAULT_VALUE", "name" => GetMessage("CT_BLFE_FIELD_DEFAULT_VALUE"), "type" => "list", "items" => $items); } elseif (preg_match("/^(E|E:)/", $arResult["FORM_DATA"]["TYPE"])) { //No default value input } elseif (!is_array($arPropertyFields["HIDE"]) || !in_array("DEFAULT_VALUE", $arPropertyFields["HIDE"])) { //Show default property value input if it was not cancelled by property if (is_array($arUserType)) { if (array_key_exists("GetPublicEditHTML", $arUserType)) { $html = ''; if ($arResult["FORM_DATA"]["TYPE"] == "S:HTML") { $params = array('width' => '100%', 'height' => '200px'); if (is_array($arResult["FORM_DATA"]["~DEFAULT_VALUE"])) { $htmlContent = $arResult["FORM_DATA"]["~DEFAULT_VALUE"]["TEXT"]; } else { $arResult["FORM_DATA"]["~DEFAULT_VALUE"] ? $htmlContent = $arResult["FORM_DATA"]["~DEFAULT_VALUE"]["TEXT"] : ($htmlContent = ''); } $html = connectionHtmlEditor($arResult['FIELD_ID'], $params, $htmlContent); } else { $html = call_user_func_array($arUserType["GetPublicEditHTML"], array($arResult["FIELD"], array("VALUE" => $arResult["FORM_DATA"]["~DEFAULT_VALUE"], "DESCRIPTION" => ""), array("VALUE" => "DEFAULT_VALUE", "DESCRIPTION" => "", "MODE" => "EDIT_FORM", "FORM_NAME" => "form_" . $arResult["FORM_ID"]))); } $arTab1Fields[] = array("id" => "DEFAULT_VALUE", "name" => GetMessage("CT_BLFE_FIELD_DEFAULT_VALUE"), "type" => "custom", "value" => $html); } else { $arTab1Fields[] = array("id" => "DEFAULT_VALUE", "name" => GetMessage("CT_BLFE_FIELD_DEFAULT_VALUE")); } } } function connectionHtmlEditor($fieldId, $params, $content) { $html = ''; if (CModule::includeModule('fileman')) { ob_start(); $editor = new CHTMLEditor();
$html .= '<input type="button" onclick="createAdditionalHtmlEditor(\'tbl' . $FIELD_ID . '\', \'' . $FIELD_ID . '\', \'' . $FIELD_ID . '\');" value="' . GetMessage("CT_BLEE_ADD_BUTTON") . '">'; } else { $html .= '<input type="button" onclick="addNewTableRow(\'tbl' . $FIELD_ID . '\', 1, /' . $FIELD_ID . '\\[(n)([0-9]*)\\]/g, 2)" value="' . GetMessage("CT_BLEE_ADD_BUTTON") . '">'; } $arTabElement[] = array("id" => $FIELD_ID, "name" => $arField["~NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html, "show" => $show); } else { $html = ''; foreach ($arResult["FORM_DATA"]["~" . $FIELD_ID] as $key => $value) { if ($arField["TYPE"] == "S:HTML") { if (is_array($value['VALUE'])) { $htmlContent = $value['VALUE']['TEXT']; } else { $value['VALUE'] ? $htmlContent = $value['VALUE']['TEXT'] : ($htmlContent = ''); } $fieldNameForHtml = $FIELD_ID . "[" . $key . "][VALUE]"; $html = connectionHtmlEditor($FIELD_ID, $fieldNameForHtml, $params, $htmlContent); } else { $html = call_user_func_array($arField["PROPERTY_USER_TYPE"]["GetPublicEditHTML"], array($arField, $value, array("VALUE" => $FIELD_ID . "[" . $key . "][VALUE]", "DESCRIPTION" => '', "FORM_NAME" => "form_" . $arResult["FORM_ID"], "MODE" => "FORM_FILL", "COPY" => $arResult["COPY_ID"] > 0))); } break; } $arTabElement[] = array("id" => $FIELD_ID, "name" => $arField["~NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html, "show" => $show); } } elseif ($arField["PROPERTY_TYPE"] == "N") { if ($arField["MULTIPLE"] == "Y") { $html = '<table id="tbl' . $FIELD_ID . '">'; foreach ($arResult["FORM_DATA"][$FIELD_ID] as $key => $value) { $html .= '<tr><td><input type="text" name="' . $FIELD_ID . '[' . $key . '][VALUE]" value="' . $value["VALUE"] . '"></td></tr>'; } $html .= '</table>'; $html .= '<input type="button" onclick="addNewTableRow(\'tbl' . $FIELD_ID . '\', 1, /' . $FIELD_ID . '\\[(n)([0-9]*)\\]/g, 2)" value="' . GetMessage("CT_BLEE_ADD_BUTTON") . '">';