Beispiel #1
0
             $html .= '<tr><td>';
             $obFile = new CListFile($arResult["IBLOCK_ID"], $arResult["ELEMENT_FIELDS"]["IBLOCK_SECTION_ID"], $arResult["ELEMENT_ID"], $FIELD_ID, $value["VALUE"]);
             $obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
             $obFileControl = new CListFileControl($obFile, $FIELD_ID . '[' . $key . '][VALUE]');
             $html .= $obFileControl->GetHTML(array('max_size' => 102400, 'max_width' => 150, 'max_height' => 150, 'url_template' => $arParams["~LIST_FILE_URL"], 'a_title' => GetMessage("CT_BLEE_ENLARGE"), 'download_text' => GetMessage("CT_BLEE_DOWNLOAD")));
             $html .= '</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") . '">';
         $arTabElement[] = array("id" => $FIELD_ID, "name" => $arField["~NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html, "show" => $show);
     } else {
         foreach ($arResult["FORM_DATA"][$FIELD_ID] as $key => $value) {
             $obFile = new CListFile($arResult["IBLOCK_ID"], $arResult["ELEMENT_FIELDS"]["IBLOCK_SECTION_ID"], $arResult["ELEMENT_ID"], $FIELD_ID, $value["VALUE"]);
             $obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
             $obFileControl = new CListFileControl($obFile, $FIELD_ID . '[' . $key . '][VALUE]');
             $html = $obFileControl->GetHTML(array('max_size' => 102400, 'max_width' => 150, 'max_height' => 150, 'url_template' => $arParams["~LIST_FILE_URL"], 'a_title' => GetMessage("CT_BLEE_ENLARGE"), 'download_text' => GetMessage("CT_BLEE_DOWNLOAD")));
             $arTabElement[] = array("id" => $FIELD_ID . '[' . $key . '][VALUE]', "name" => $arField["~NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html, "show" => $show);
         }
     }
 } elseif ($arField["PROPERTY_TYPE"] == "G") {
     if ($arField["IS_REQUIRED"] == "Y") {
         $items = array();
     } else {
         $items = array("" => GetMessage("CT_BLEE_NO_VALUE"));
     }
     $rsSections = CIBlockSection::GetTreeList(array("IBLOCK_ID" => $arField["LINK_IBLOCK_ID"]));
     while ($ar = $rsSections->GetNext()) {
         $items[$ar["ID"]] = str_repeat(" . ", $ar["DEPTH_LEVEL"]) . $ar["~NAME"];
     }
     if ($arField["MULTIPLE"] == "Y") {
         $params = array("size" => 5, "multiple" => "multiple");
Beispiel #2
0
 protected function renderFieldByTypeF(array $field)
 {
     if ($field['MULTIPLE'] == 'Y') {
         $results = array();
         foreach ($field['VALUE'] as $value) {
             $file = new CListFile(0, 0, 0, 0, $value);
             $fileControl = new CListFileControl($file, null);
             $results[] = $fileControl->GetHTML(array('download_text' => GetMessage("CT_BLEE_DOWNLOAD"), 'show_input' => false));
         }
         $result = implode('<br>', $results);
     } else {
         $file = new CListFile(0, 0, 0, 0, $field["VALUE"]);
         $fileControl = new CListFileControl($file, null);
         $result = $fileControl->GetHTML(array('download_text' => GetMessage("CT_BLEE_DOWNLOAD"), 'show_input' => false));
     }
     return $result;
 }
     } else {
         $value = "";
     }
 } elseif ($arField["TYPE"] == "F") {
     if (is_array($value)) {
         foreach ($value as $ii => $file) {
             $obFile = new CListFile($arResult["IBLOCK_ID"], 0, $arRow["data"]["ID"], $FIELD_ID, $file);
             $obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
             $obFileControl = new CListFileControl($obFile, $FIELD_ID);
             $value[$ii] = '<nobr>' . $obFileControl->GetHTML(array('show_input' => false, 'max_size' => 102400, 'max_width' => 50, 'max_height' => 50, 'url_template' => $arParams["~LIST_FILE_URL"], 'a_title' => GetMessage("CT_BLL_ENLARGE"), 'download_text' => GetMessage("CT_BLL_DOWNLOAD"))) . '</nobr>';
         }
     } else {
         $obFile = new CListFile($arResult["IBLOCK_ID"], 0, $arRow["data"]["ID"], $FIELD_ID, $value);
         $obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
         $obFileControl = new CListFileControl($obFile, $FIELD_ID);
         $value = '<nobr>' . $obFileControl->GetHTML(array('show_input' => false, 'max_size' => 102400, 'max_width' => 50, 'max_height' => 50, 'url_template' => $arParams["~LIST_FILE_URL"], 'a_title' => GetMessage("CT_BLL_ENLARGE"), 'download_text' => GetMessage("CT_BLL_DOWNLOAD"))) . '</nobr>';
     }
 } elseif ($arField["TYPE"] == "E") {
     if (is_array($value)) {
         foreach ($value as $ii => $id) {
             if ($id > 0) {
                 $arElements[] =& $arResult["ELEMENTS_ROWS"][$i]["data"][$FIELD_ID][$ii];
             }
         }
         $arArrays[$i . "_" . $FIELD_ID] =& $arResult["ELEMENTS_ROWS"][$i]["data"][$FIELD_ID];
     } elseif ($value > 0) {
         $arElements[] =& $arResult["ELEMENTS_ROWS"][$i]["data"][$FIELD_ID];
     }
     continue;
 } elseif ($arField["TYPE"] == "G") {
     if (is_array($value)) {
Beispiel #4
0
     } else {
         if (!is_array($arResult["FORM_DATA"][$FIELD_ID])) {
             $arResult["FORM_DATA"][$FIELD_ID] = array($arResult["FORM_DATA"][$FIELD_ID]);
         }
         foreach ($arResult["FORM_DATA"][$FIELD_ID] as $key => $value) {
             $obFile = new CListFile($arResult["IBLOCK_ID"], $arResult["ELEMENT_FIELDS"]["IBLOCK_SECTION_ID"], $arResult["ELEMENT_ID"], $FIELD_ID, $value["VALUE"]);
             $obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
             $obFileControl = new CListFileControl($obFile, $FIELD_ID . '[' . $key . '][VALUE]');
             $params = array('max_size' => 102400, 'max_width' => 150, 'max_height' => 150, 'url_template' => $arParams["~LIST_FILE_URL"], 'a_title' => GetMessage("CT_BLEE_ENLARGE"), 'download_text' => GetMessage("CT_BLEE_DOWNLOAD"));
             if ($read == "Y") {
                 $params['show_input'] = false;
             }
             if ($arResult["ELEMENT_ID"] > 0 && $read == "Y" && empty($value["VALUE"])) {
                 $html = GetMessage("CT_BLEE_READ_ONLY_FIELD_NOT_DATA");
             } else {
                 $html = $obFileControl->GetHTML($params);
             }
             $arTabElement[] = array("id" => $FIELD_ID . '[' . $key . '][VALUE]', "name" => $arField["~NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html, "show" => $show);
         }
     }
 } elseif ($arField["PROPERTY_TYPE"] == "G") {
     if ($arField["IS_REQUIRED"] == "Y") {
         $items = array();
     } else {
         $items = array("" => GetMessage("CT_BLEE_NO_VALUE"));
     }
     $rsSections = CIBlockSection::GetTreeList(array("IBLOCK_ID" => $arField["LINK_IBLOCK_ID"]));
     while ($ar = $rsSections->GetNext()) {
         $items[$ar["ID"]] = str_repeat(" . ", $ar["DEPTH_LEVEL"]) . $ar["~NAME"];
     }
     if ($arField["MULTIPLE"] == "Y") {