$widgetclassgroup_buttons[] = nc_get_array_2json_button(CONTROL_WIDGETCLASS_ADD, "widgetclass{$fs_suffix}.add(" . $widgetclass_group['Category_md5'] . ")", "nc-icon nc--dev-com-widgets-add nc--hovered"); $ret_widgetgroups[] = array("nodeId" => "widgetgroup-" . $widgetclass_group['Category_md5'], "name" => $widgetclass_group["Category"], "href" => "#widgetgroup.edit(" . $widgetclass_group['Category_md5'] . ")", "sprite" => 'dev-com-widgets' . ($File_Mode ? '' : '-v4'), "acceptDropFn" => "treeClassAcceptDrop", "onDropFn" => "treeClassOnDrop", "hasChildren" => true, "dragEnabled" => true, "buttons" => $widgetclassgroup_buttons); } } elseif ($node_type == 'widgetgroup' && $node_id) { $widgetclasses = $db->get_results("\n SELECT `Widget_Class_ID`,\n `Name`,\n `Template`\n FROM `Widget_Class`\n WHERE MD5(`Category`) = '" . $node_id . "'\n AND File_Mode = " . +$_REQUEST['fs'] . "\n ORDER BY `Category`,\n `Widget_Class_ID`", ARRAY_A); foreach ((array) $widgetclasses as $widgetclass) { $hasChildren = $db->get_var("SELECT COUNT(`Field_ID`) FROM `Field`\n WHERE `Widget_Class_ID` = '" . $widgetclass['Widget_Class_ID'] . "'"); $widgetclass_buttons = array(); $widgetclass_buttons[] = nc_get_array_2json_button(CONTROL_FIELD_LIST_ADD, "widgetfield{$fs_suffix}.add(" . $widgetclass['Widget_Class_ID'] . ")", "nc-icon nc--file-add nc--hovered"); $widgetclass_buttons[] = nc_get_array_2json_button(CONTROL_CLASS_DELETE, "widgetclass{$fs_suffix}.drop(" . $widgetclass['Widget_Class_ID'] . ", 1)", "nc-icon nc--remove nc--hovered"); $ret_widgetclasses[] = array("nodeId" => "widgetclass-" . $widgetclass['Widget_Class_ID'], "name" => $widgetclass["Widget_Class_ID"] . ". " . $widgetclass["Name"], "href" => "#widgetclass.edit(" . $widgetclass['Widget_Class_ID'] . ")", "sprite" => 'dev-com-widgets' . ($File_Mode ? '' : '-v4'), "acceptDropFn" => "treeClassAcceptDrop", "onDropFn" => "treeClassOnDrop", "hasChildren" => $hasChildren, "dragEnabled" => true, "buttons" => $widgetclass_buttons); } } elseif ($node_type == 'widgetclass' && $node_id) { $fields = $db->get_results("SELECT `Field_ID`, `Field_Name`, `TypeOfData_ID` FROM `Field`\n WHERE `Widget_Class_ID` = '" . $node_id . "'\n ORDER BY `Priority`", ARRAY_A); foreach ((array) $fields as $field) { if ($field["TypeOfData_ID"] == 11 && !($nc_core->modules->get_by_keyword('auth') && nc_auth_openid_possibility())) { continue; } $widgetfield_buttons = array(); $widgetfield_buttons[] = nc_get_array_2json_button(CONTROL_FIELD_LIST_DELETE, "widgetfield{$fs_suffix}.delete(" . $node_id . "," . $field['Field_ID'] . ")", "nc-icon nc--remove nc--hovered"); $ret_widgetfields[] = array("nodeId" => "field-" . $field['Field_ID'], "name" => $field["Field_ID"] . ". " . $field["Field_Name"], "href" => "#widgetfield.edit(" . $field['Field_ID'] . ")", "sprite" => $field_types[$field["TypeOfData_ID"]], "acceptDropFn" => "treeFieldAcceptDrop", "onDropFn" => "treeFieldOnDrop", "hasChildren" => false, "dragEnabled" => true, "buttons" => $widgetfield_buttons); } } elseif ($node_type == 'classificator.list') { // получение дерева списков $classificators = $db->get_results("SELECT `Classificator_ID`, `Classificator_Name`, `System` FROM `Classificator`\n ORDER BY `Classificator_ID`", ARRAY_A); $admin_cl = $perm->isAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_DEL, 0, 0); foreach ((array) $classificators as $classificator) { $c_id = $classificator['Classificator_ID']; //for short // Проверка на право if (!$classificator['System'] && !$perm->isAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_VIEW, $c_id)) {
/** * Show form to edit field or create new * * @param int Field id, 0 - if new * @param int ClassId or SystemTableId, if 0 - edit field * @param bool is field in system table * @param string action * @param string form name * @param string form id * @param string Advanced elements * @return bool true */ function FieldForm($FieldID, $Id, $isSys = 0, $action = "index.php", $FormName = '', $FormID = '', $Additional = '', $isWidget = 0) { global $db, $nc_core; global $UI_CONFIG; global $field_type_name, $type_of_edit_name; $FieldID = intval($FieldID); $Id = intval($Id); $no_multifile = false; if ($isSys) { if (!$Id && $FieldID) { $sql = "SELECT `System_Table_ID` FROM `Field` WHERE `Field_ID` = {$FieldID}"; $systemTableId = $db->get_var($sql); $no_multifile = $systemTableId != 3; } else { if ($Id != 3) { $no_multifile = true; } } } if ($FieldID) { $Array = $db->get_row("SELECT `Field_Name`, `Description`, `TypeOfData_ID`, `Format`, `Extension`, `NotNull`, `Priority`, `DoSearch`,\n `Inheritance`, `DefaultState`, `TypeOfEdit_ID`, `Widget_Class_ID`, `InTableView`\n FROM `Field`\n WHERE `Field_ID`='" . $FieldID . "' AND `Checked` = 1", ARRAY_A); if ($Array["Widget_Class_ID"]) { $isWidget = 1; } } else { $Array = $_POST; $where = $isSys ? "`System_Table_ID`" : ($isWidget ? "`Widget_Class_ID`" : "`Class_ID`"); $where .= "='" . $Id . "'"; if (!$Array["Priority"]) { $res = $db->get_var("SELECT (Priority+1) FROM `Field` WHERE " . $where . " ORDER BY `Priority` DESC LIMIT 1"); if (!is_null($res)) { $Array["Priority"] = $res; } } } // js для визульного заполнения "Формата" $js = "<script type='text/javascript' language='JavaScript'>\n " . ($Array["TypeOfData_ID"] || 1 ? "nc_field_additional_format(" . intval($Array["TypeOfData_ID"] ? $Array["TypeOfData_ID"] : 1) . ");" : "") . "\n\n function nc_field_additional_format(selected_field) {\n\n //settings for text\n document.getElementById('div_upload_limits').style.display = ((selected_field == 6 || selected_field == 11 ) ? 'block' : 'none');\n\n // select FS for file field\n document.getElementById('div_field_file').style.display = ((selected_field == 6) ? 'block' : 'none');\n\n //don't show Format field\n document.getElementById('div_format').style.display = ((selected_field == 3 || selected_field == 1) ? 'none' : 'block');\n\n //settings for text\n document.getElementById('div_field_text').style.display = ((selected_field == 3 ) ? 'block' : 'none');\n\n //settings for string\n document.getElementById('div_field_string').style.display = ((selected_field == 1 ) ? 'block' : 'none');\n\n //settings for date\n document.getElementById('div_field_date').style.display = ((selected_field == 8 ) ? 'block' : 'none');\n\n document.getElementById('div_file_resize').style.display = ((selected_field == 11 || selected_field == 6) ? 'block' : 'none');"; if (!$isSys) { $js .= "//settings for search\n\t\tdocument.getElementById('dosr').disabled = ((selected_field == 9 || selected_field == 11) ? true : false);\n\t\tdocument.getElementById('dosr').style.background = ( (selected_field == 9 || selected_field == 11) ? '#eee' : '' );"; } $js .= "// default value field\n var defaultField = document.getElementById('DefaultState');\n\n if (defaultField) {\n // default value field disabled\n defaultField.disabled = ( (selected_field == 11 || selected_field==3 || selected_field==6 || selected_field==8 || selected_field==10) ? true : false );\n defaultField.style.background = ( (selected_field == 11 || selected_field==3 || selected_field==6 || selected_field==8) ? '#eee' : '' );\n\n // default value field data\n defaultField.value = (selected_field==" . intval($Array["TypeOfData_ID"]) . " ? '" . $db->escape($Array["DefaultState"]) . "' : '');\n }\n return false;\n }\n\n function nc_select_field() {\n var selected_field = document.getElementById('TypeOfData_ID').selectedIndex + 1 ;\n nc_field_additional_format (selected_field);\n nc_field_select_fs();\n return false;\n }\n\n function nc_field_select_fs() {\n var selected_fs = document.getElementById('Format_FS').selectedIndex + 1;\n document.getElementById('attachment').disabled = ( selected_fs != 3 );\n document.getElementById('download').disabled = ( selected_fs != 3 );\n return false;\n }\n\n function nc_field_select_string_format() {\n document.getElementById('div_field_string_protect_email').style.display = document.getElementById('Format_String').value == 'email' ? 'block' : 'none';\n }\n\n function nc_field_select_fck(element) {\n var \$this = \$nc(element);\n var \$panel_block = \$nc('#format-panel-block');\n if (\$this.val() == 2) {\n \$panel_block.hide();\n } else {\n \$panel_block.show();\n }\n }\n function nc_field_select_transliteration(element) {\n \$nc('#transliteration_field').change(function() {\n if (\$nc('#transliteration_field').val() == 'Keyword') {\n \$nc('#use_url_rules').prop('checked', true);\n }\n });\n var \$this = \$nc(element);\n var \$panel_block = \$nc('#transliteration-fields-panel-block');\n if (\$this.is(':checked')) {\n \$panel_block.show();\n if (\$nc('#transliteration_field').val() == 'Keyword') {\n \$nc('#use_url_rules').prop('checked', true);\n }\n } else {\n \$panel_block.hide();\n }\n }\n nc_field_select_fs();\n nc_field_select_string_format();\n </script>\n"; print "<fieldset>"; if ($FieldID) { print "<legend>" . ($Array["Description"] ? $Array["Description"] : $Array["Field_Name"]) . "</legend>"; } print "<br/><form method='post' action='" . $action . "' name='" . $FormName . "' id='" . $FormID . "'>"; $Format_FS = NC_FS_PROTECTED; // тип по ФС по умолчанию $format_text = nc_field_parse_format("", NC_FIELDTYPE_TEXT); // для textarea значения по умолчанию if ($FieldID) { if (!$isWidget) { print CONTROL_FIELD_LIST_NAMELAT . ":<br>" . nc_admin_input_simple('FieldName', $Array["Field_Name"], 50, '', "maxlength='64'") . "<br><br>"; } else { print CONTROL_FIELD_LIST_NAME . ": " . $Array["Field_Name"] . "<br><br>"; } switch ($Array['TypeOfData_ID']) { case NC_FIELDTYPE_FILE: // определим тип ФС $format_file_resize = nc_field_parse_resize_options($Array['Format']); $Array['Format'] = array_shift(explode(';', $Array['Format'])); $format_file = nc_field_parse_format($Array['Format'], $Array['TypeOfData_ID']); $Format_FS = $format_file['fs']; $file_attach = $format_file['disposition']; // закачиваемый или нет? $file_download = $format_file['download']; $Array['Format'] = nc_preg_replace('/(:?)(fs)(\\d+)/', '', $Array['Format']); // уберем из Format тип ФС $Array['Format'] = nc_preg_replace('/(:?)(download)/', '', $Array['Format']); // уберем download $Array['Format'] = nc_preg_replace('/(:?)((attachment)|(inline))/', '', $Array['Format']); // уберем attachment break; case NC_FIELDTYPE_TEXT: $format_text = nc_field_parse_format($Array['Format'], $Array['TypeOfData_ID']); break; case NC_FIELDTYPE_DATETIME: $format_date = nc_field_parse_format($Array['Format'], $Array['TypeOfData_ID']); $Array['Format'] = $format_date['type']; break; case NC_FIELDTYPE_STRING: $format_string = nc_field_parse_format($Array['Format'], $Array['TypeOfData_ID']); $Array['Format'] = $format_string['format']; $Array['UseTransliteration'] = $format_string['use_transliteration']; $Array['TransliterationField'] = $format_string['transliteration_field']; $Array['UseUrlRules'] = $format_string['use_url_rules']; break; case NC_FIELDTYPE_MULTIFILE: $format_file_resize = nc_field_parse_resize_options($Array['Format']); $Array['Format'] = array_shift(explode(';', $Array['Format'])); break; } } else { print CONTROL_FIELD_LIST_NAMELAT . ":<br>" . nc_admin_input_simple('FieldName', $Array["Field_Name"], 50, '', "maxlength='64'") . "<br><br>"; } print CONTROL_FIELD_LIST_DESCRIPTION . ":<br>" . nc_admin_input_simple('Description', htmlspecialchars_decode($Array["Description"]), 50, '', "maxlength='64'") . "<br><br>"; $openid_possibility = $nc_core->modules->get_by_keyword('auth') && nc_auth_openid_possibility(); if ($FieldID && $Array['TypeOfData_ID'] == 11 && $openid_possibility) { print "<input name='TypeOfData_ID' value='11' type='hidden'>"; } print CONTROL_FIELD_ONE_FTYPE . ":<br><select name='TypeOfData_ID' id='TypeOfData_ID' onchange='nc_select_field(); return false;'" . ($FieldID && $Array['TypeOfData_ID'] == 11 && $openid_possibility ? " disabled='disabled'" : NULL) . ">"; //print CONTROL_FIELD_ONE_FTYPE.":<br><select name='TypeOfData_ID' id='TypeOfData_ID' onchange='nc_select_field(); return false;'>"; for ($i = 1; $i <= count($field_type_name); $i++) { // Полe тиа "Связь с другими.." для системных полей не нужно if (($isSys || $isWidget) && $i === 9) { continue; } if ($i == 11 && $no_multifile) { continue; } print "<option " . ($Array["TypeOfData_ID"] == $i ? "selected" : "") . " value='" . $i . "'>" . $i . ": " . $field_type_name[$i] . "</option>\n"; } print "</select><br><br>"; $html = "<div id='div_format'>" . CONTROL_FIELD_ONE_FORMAT . ":<br>" . nc_admin_input_simple('Format', $Array["TypeOfData_ID"] != 3 ? $Array["Format"] : "", 50, '', "maxlength='255'") . "<br><br></div>"; $html .= "<div id='div_field_string'>" . nc_admin_select_simple(CONTROL_FIELD_ONE_FORMAT . ":<br/>", 'Format_String', array('' => CONTROL_FIELD_ONE_FORMAT_NONE, 'email' => CONTROL_FIELD_ONE_FORMAT_EMAIL, 'url' => CONTROL_FIELD_ONE_FORMAT_URL, 'password' => CONTROL_FIELD_ONE_FORMAT_PASSWORD, 'phone' => CONTROL_FIELD_ONE_FORMAT_PHONE, 'tags' => CONTROL_FIELD_ONE_FORMAT_TAGS), $Array["Format"], "id='Format_String' onchange='nc_field_select_string_format();'") . "<br>"; $html .= "<div id='div_field_string_protect_email'>"; $html .= nc_admin_checkbox_simple('protect_email', '', CONTROL_FIELD_ONE_PROTECT_EMAIL, $format_string['protect_email']); $html .= "</div>"; $options = GetTransliterateOptions($isSys ? "system" : ($isWidget ? "widget" : "class"), $FieldID, $Id, $systemTableId); if (count($options) > 0) { $html .= "<div id='div_field_string_use_transliteration'>"; $html .= nc_admin_checkbox_simple('use_transliteration', '1', CONTROL_FIELD_USE_TRANSLITERATION, $Array['UseTransliteration'], '', "onchange='nc_field_select_transliteration(this); return true;'"); $html .= "</div>"; $html .= "<div id='transliteration-fields-panel-block' style='" . ($Array['UseTransliteration'] == 1 ? '' : 'display: none;') . "'>"; $html .= nc_admin_select_simple(CONTROL_FIELD_TRANSLITERATION_FIELD . ":<br/>", 'transliteration_field', $options, $Array["TransliterationField"], "id='transliteration_field'", "onchange='alert('here'); return true;'") . "<br>"; $html .= nc_admin_checkbox_simple('use_url_rules', '1', CONTROL_FIELD_USE_URL_RULES, $Array['UseUrlRules'], ''); $html .= "</div>"; } $html .= "</div>"; // Вывод ограничений на загрузку файлов для тип поля Файл и множественный выбор файлов $html .= "<div id='div_upload_limits' style='display: none;'>" . CONTROL_FIELD_FILE_UPLOADS_LIMITS . "<br />\n post_max_size (" . CONTROL_FIELD_FILE_POSTMAXSIZE . "): " . ini_get('post_max_size') . " <br />\n upload_max_filesize (" . CONTROL_FIELD_FILE_UPLOADMAXFILESIZE . "): " . ini_get('upload_max_filesize') . "<br />\n max_file_uploads (" . CONTROL_FIELD_FILE_MAXFILEUPLOADS . "): " . ini_get('max_file_uploads') . "<br />\n <br /></div>"; // расширение формата для Файлов $html .= "<div id='div_field_file' style='display: none;'>\r\n" . CLASSIFICATOR_TYPEOFFILESYSTEM . ":\n <select name='Format_FS' id='Format_FS' onchange='nc_field_select_fs(); return false;' >\r\n\n <option value='" . NC_FS_SIMPLE . "' " . (NC_FS_SIMPLE == $Format_FS ? 'selected' : '') . ">" . CONTROL_FS_NAME_SIMPLE . "</option>\r\n\n <option value='" . NC_FS_ORIGINAL . "' " . (NC_FS_ORIGINAL == $Format_FS ? 'selected' : '') . ">" . CONTROL_FS_NAME_ORIGINAL . "</option>\r\n\n <option value='" . NC_FS_PROTECTED . "' " . (NC_FS_PROTECTED == $Format_FS ? 'selected' : '') . ">" . CONTROL_FS_NAME_PROTECTED . "</option>\r\n\n </select>\n <br />" . nc_admin_checkbox_simple('attachment', '', CONTROL_FIELD_ATTACHMENT, $file_attach, '', "disabled") . "\n <br/>" . nc_admin_checkbox_simple('download', '', CONTROL_FIELD_DOWNLOAD_COUNT, $file_download, '', "disabled") . "\n </div>"; // расширение формата для текста $html .= "<div id='div_field_text' style='display: none;'>\n <table class='admin_table' width='40%' >\n <col width='25%'/><col width='25%'/><col width='25%'/><col width='25%'/>\n <tr align='center'>\n <th></th>\n <th>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_ACCESS_INHERIT . "</th>\n <th>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_YES . "</th>\n <th>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_NO . "</th>\n </tr>\n <tr align='center'>\n <td>" . CONTROL_CLASS_CLASS_OBJECTSLIST_SHOWOBJ_HTML . "</td>"; // разрешать HTML-теги for ($i = 0; $i <= 2; $i++) { $html .= "<td bgcolor='" . ($format_text['html'] == $i ? "#E7E7E7" : "#FFFFFF") . "'>" . nc_admin_radio_simple('format_html', $i, '', isset($Array['format_html']) && $Array['format_html'] == $i || $format_text['html'] == $i, '', "class='w'") . "\n </td>"; } $html .= "</tr><tr align='center'>\n <td>" . CONTROL_CLASS_CLASS_OBJECTSLIST_SHOWOBJ_BR . "</td>"; // перенос строки for ($i = 0; $i <= 2; $i++) { $html .= "<td bgcolor='" . ($format_text['br'] == $i ? "#E7E7E7" : "#FFFFFF") . "'>" . nc_admin_radio_simple('format_br', $i, '', isset($Array['format_br']) && $Array['format_br'] == $i || $format_text['br'] == $i, '', "class='w'") . "\n </td>"; } $html .= "\n </tr><tr align='center'>\n <td>" . CONTROL_FIELD__EDITOR_EMBED_TO_FIELD . "</td>"; // встроить редактор for ($i = 0; $i <= 2; $i++) { $html .= "<td bgcolor='" . ($format_text['fck'] == $i ? "#E7E7E7" : "#FFFFFF") . "'>" . nc_admin_radio_simple('format_fck', $i, '', isset($Array['format_fck']) && $Array['format_fck'] == $i || $format_text['fck'] == $i, '', "class='w' onchange='nc_field_select_fck(this); return true;'") . "\n </td>"; } $html .= "</tr></table><br/>"; $html .= CONTROL_FIELD__TEXTAREA_SIZE . ":<br/>\n <table class='admin_table' width='40%' >\n <col width='50%'/><col width='50%'/>\n <tr align='center'>\n <td>" . CONTROL_FIELD_HEIGHT . "</td>\n <td>" . nc_admin_input_simple('format_height', isset($Array['format_height']) ? $Array['format_height'] : $format_text['rows'], 0, 'width:100%') . "</td></tr>\n <tr align='center'>\n <td>" . CONTROL_FIELD_WIDTH . "</td>\n <td>" . nc_admin_input_simple('format_width', isset($Array['format_height']) ? $Array['format_width'] : $format_text['cols'], 0, 'width:100%') . "</td>\n </tr>\n </table>\n <br />"; $panels = array(0 => CONTROL_FIELD_PANELS_DEFAULT); $sql = "SELECT `Wysiwyg_Panel_ID`, `Name` FROM `Wysiwyg_Panel` " . "WHERE `Editor` = 'ckeditor' " . "ORDER BY `Wysiwyg_Panel_ID` ASC"; foreach ((array) $db->get_results($sql, ARRAY_A) as $panel) { $panels[$panel['Wysiwyg_Panel_ID']] = $panel['Name']; } $html .= "<div id='format-panel-block' style='" . ($format_text['fck'] == 2 ? 'display: none;' : '') . "'>" . CONTROL_FIELD_PANELS . ":<br><div class='nc-select'>" . nc_admin_select_simple('', 'format_panel', $panels, isset($Array['format_panel']) ? $Array['format_panel'] : $format_text['panel']) . "<i class='nc-caret'></i></div><br><br /></div>"; $html .= nc_admin_checkbox_simple('format_typo', 1, CONTROL_FIELD_TYPO, isset($Array['format_typo']) ? $Array['format_typo'] : $format_text['typo']) . "\n <br />" . nc_admin_checkbox_simple('format_bbcode', 1, CONTROL_FIELD_BBCODE_ENABLED, isset($Array['format_bbcode']) ? $Array['format_bbcode'] : $format_text['bbcode']) . "\n <br/><br/>\n </div>"; $html .= "<div id='div_field_date' style='display: none'>" . nc_admin_checkbox_simple('use_calendar', 1, CONTROL_FIELD_USE_CALENDAR, false, 'format_use_calendar', $format_date['calendar'] ? "checked='checked'" : "") . "\n </div><br/>"; $html .= "<div id='div_file_resize' style='display: none'>"; $html .= nc_admin_checkbox_simple('format_use_resize', 1, CONTROL_FIELD_MULTIFIELD_USE_IMAGE_RESIZE, $format_file_resize['use_resize']); $html .= "<div>"; $html .= CONTROL_FIELD_MULTIFIELD_IMAGE_WIDTH . ": " . nc_admin_input_simple('format_resize_width', $format_file_resize['resize_width'], 10) . " "; $html .= CONTROL_FIELD_MULTIFIELD_IMAGE_HEIGHT . ": " . nc_admin_input_simple('format_resize_height', $format_file_resize['resize_height'], 10); $html .= "</div><br>"; $html .= nc_admin_checkbox_simple('format_use_crop', 1, CONTROL_FIELD_MULTIFIELD_USE_IMAGE_CROP, $format_file_resize['use_crop']); $html .= "<div>"; $html .= "X0: " . nc_admin_input_simple('format_crop_x0', $format_file_resize['crop_x0'], 10) . " "; $html .= "Y0: " . nc_admin_input_simple('format_crop_y0', $format_file_resize['crop_y0'], 10) . "<br>"; $html .= "X1: " . nc_admin_input_simple('format_crop_x1', $format_file_resize['crop_x1'], 10) . " "; $html .= "Y1: " . nc_admin_input_simple('format_crop_y1', $format_file_resize['crop_y1'], 10); $html .= "</div><br>"; $html .= nc_admin_checkbox_simple('format_crop_ignore', 1, CONTROL_FIELD_MULTIFIELD_CROP_IGNORE, $format_file_resize['crop_ignore']); $html .= "<div>"; $html .= CONTROL_FIELD_MULTIFIELD_IMAGE_WIDTH . ": " . nc_admin_input_simple('format_crop_ignore_width', $format_file_resize['crop_ignore_width'], 10) . " "; $html .= CONTROL_FIELD_MULTIFIELD_IMAGE_HEIGHT . ": " . nc_admin_input_simple('format_crop_ignore_height', $format_file_resize['crop_ignore_height'], 10); $html .= "</div><br/>"; $html .= nc_admin_checkbox_simple('format_use_preview', 1, CONTROL_FIELD_MULTIFIELD_USE_IMAGE_PREVIEW, $format_file_resize['use_preview']); $html .= "<div>"; $html .= CONTROL_FIELD_MULTIFIELD_IMAGE_WIDTH . ": " . nc_admin_input_simple('format_preview_width', $format_file_resize['preview_width'], 10) . " "; $html .= CONTROL_FIELD_MULTIFIELD_IMAGE_HEIGHT . ": " . nc_admin_input_simple('format_preview_height', $format_file_resize['preview_height'], 10); $html .= "</div>"; $html .= "</div><br/>"; echo $html; echo nc_admin_textarea_simple('Extension', $Array['Extension'], CONTROL_FIELD_ONE_EXTENSION . ":<br>", 7, 0, '', 'soft'); echo "<br><br>"; print nc_admin_checkbox_simple('NotNull', 1, CONTROL_FIELD_ONE_MUSTBE, $Array["NotNull"], 'notn') . "<br>"; if ($isSys) { print nc_admin_checkbox_simple('Inheritance', 1, CONTROL_FIELD_ONE_INHERITANCE, $Array["Inheritance"], 'inhr') . "<br>"; } else { print nc_admin_checkbox_simple('DoSearch', 1, CONTROL_FIELD_ONE_INDEX, $Array["DoSearch"] && $Array['TypeOfData_ID'] != 9, 'dosr', $Array['TypeOfData_ID'] != 9 ? " disabled='disabled'" : "") . "<br>"; print nc_admin_checkbox_simple('InTableView', 1, CONTROL_FIELD_ONE_IN_TABLE_VIEW, $Array["InTableView"]) . "<br>"; } print '<br>'; print CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_PRIORITY . ": " . nc_admin_input_simple('Priority', $Array["Priority"] + 0, 3, '', "maxlength='5'") . "<br><br>"; print CONTROL_FIELD_ONE_DEFAULT . "*:<br>"; print nc_admin_input_simple('DefaultState', $Array["DefaultState"], 50, '', "id='DefaultState' maxlength='255'") . "\n"; print "<br>* " . CONTROL_FIELD_ONE_DEFAULT_NOTE . ".<br><br>\n"; print "<table class='admin_table' width='60%' >" . "<col width='25%'/><col width='25%'/><col width='25%'/><col width='25%'/>" . "<tr><td></td>"; if (!$Array["TypeOfEdit_ID"]) { $Array["TypeOfEdit_ID"] = 1; } for ($i = 1; $i <= count($type_of_edit_name); $i++) { print "<td text-align:center'><label for='mod" . $i . "'>" . $type_of_edit_name[$i] . "</label></td>"; } print "</tr><tr><td text-align:center'>" . CONTROL_FIELD_ONE_ACCESS . "</td>"; for ($i = 1; $i <= count($type_of_edit_name); $i++) { print "<td text-align:center'>" . nc_admin_radio_simple('TypeOfEdit_ID', $i, '', $Array["TypeOfEdit_ID"] == $i, "mod" . $i, "class='w'") . "</td>"; } print "</tr>" . "</table>"; // js для визуальной настройки формата print $js; if (!$FieldID) { $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_FIELD_LIST_ADD, "action" => "mainView.submitIframeForm('" . $FormID . "')"); } else { $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "action" => "mainView.submitIframeForm('" . $FormID . "')"); } $name = $isSys ? "SystemTableID" : ($isWidget ? "widgetclass_id" : "ClassID"); if ($Id) { print "<input type='hidden' name='" . $name . "' value='" . $Id . "'>\n"; print "<input type='hidden' name='phase' value='3'>\n"; } else { if ($isSys) { print "<input type='hidden' name='SystemTableID' value='" . $Id . "'>\n"; } print "<input type='hidden' name='FieldID' value='" . $FieldID . "'>\n"; print "<input type='hidden' name='phase' value='5'>\n"; } print $Additional; print $nc_core->token->get_input(); print "<input type='hidden' name='isSys' value='" . $isSys . "'>\n"; print "<input type='hidden' name='fs' value='" . +$_REQUEST['fs'] . "'>"; print "<input type='submit' class='hidden'>\n"; print "<input type='hidden' name='isWidget' value='{$isWidget}' />"; print "</form>\n"; print "</fieldset>"; return true; }