Пример #1
0
function RedirectForm($RedirectID)
{
    global $nc_core, $db, $UI_CONFIG;
    $RedirectID = intval($RedirectID);
    $OldURL = $db->escape($_POST['OldURL']);
    $NewURL = $db->escape($_POST['NewURL']);
    $HeaderCode = intval($_POST['HeaderCode']);
    if ($RedirectID) {
        list($OldURL, $NewURL, $HeaderCode) = $db->get_row("SELECT `OldURL`,`NewURL`, `Header` FROM `Redirect` WHERE `Redirect_ID`='" . $RedirectID . "'", ARRAY_N);
    }
    if ($HeaderCode != 301 && $HeaderCode != 302) {
        $HeaderCode = 301;
    }
    echo "\n    <form method='post' action='redirect.php'>\n       <font color='gray'>\n  " . TOOLS_REDIRECT_OLDLINK . ":<br/>" . nc_admin_input_simple('OldURL', $OldURL, 70, '', "maxlength='255'") . "<br/><br/>\n  " . TOOLS_REDIRECT_NEWLINK . ":<br/>" . nc_admin_input_simple('NewURL', $NewURL, 70, '', "maxlength='255'") . "<br/><br/>\n  " . TOOLS_REDIRECT_HEADERSEND . ":<br/>" . nc_admin_select_simple('', 'HeaderCode', array(301 => 301, 302 => 302), $HeaderCode) . "\n  <hr size='1' color='cccccc'> ";
    if (!$RedirectID) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => TOOLS_REDIRECT_ADDONLY, "action" => "mainView.submitIframeForm()");
    } else {
        echo "\n      <input type='hidden' name='RedirectID' value='" . $RedirectID . "' />";
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "action" => "mainView.submitIframeForm()");
    }
    echo $nc_core->token->get_input();
    echo "<input type='hidden' name='phase' value='2'>";
    echo "<input type='submit' class='hidden' /> </form>";
    return 0;
}
Пример #2
0
/**
 * Вывод формы настроек CKEditor
 *
 * @return bool
 */
function WysiwygCkeditorSettingsForm()
{
    global $nc_core, $db, $UI_CONFIG;
    $settings = $nc_core->get_settings(null, null, true);
    $sql = "SELECT `Wysiwyg_Panel_ID`, `Name` FROM `Wysiwyg_Panel` " . "WHERE `Editor` = 'ckeditor' " . "ORDER BY `Wysiwyg_Panel_ID` ASC";
    $panels = (array) $db->get_results($sql, ARRAY_A);
    $panels_select_array = array(0 => NETCAT_WYSIWYG_SETTINGS_PANEL_NOT_SELECTED);
    foreach ($panels as $panel) {
        $panels_select_array[$panel['Wysiwyg_Panel_ID']] = $panel['Wysiwyg_Panel_ID'] . '. ' . $panel['Name'];
    }
    $editor_type = $settings['EditorType'];
    ?>
    <form method='post' action='index.php'>
        <legend><?php 
    echo NETCAT_WYSIWYG_SETTINGS_BASIC_SETTINGS;
    ?>
</legend>
        <table border='0' cellpadding='6' cellspacing='0' width='100%'>
            <tr>
                <td colspan="2">
                    <?php 
    if ($editor_type == 3) {
        ?>
                        <?php 
        echo NETCAT_WYSIWYG_SETTINGS_THIS_EDITOR_IS_USED_BY_DEFAULT;
        ?>
                    <?php 
    } else {
        ?>
                        <a href="index.php?phase=9&editor_type=3"><?php 
        echo NETCAT_WYSIWYG_SETTINGS_USE_BY_DEFAULT;
        ?>
</a>
                    <?php 
    }
    ?>

                </td>
            </tr>
            <tr>
                <td>
                    <?php 
    echo NETCAT_SETTINGS_EDITOR_SKINS;
    ?>
:<br>
                    <select name="CKEditorSkin">
                        <?php 
    $dir = $nc_core->ROOT_FOLDER . "editors/ckeditor4/skins/";
    $settings_skin = $settings['CKEditorSkin'];
    if (!file_exists($dir . $settings_skin)) {
        $settings['CKEditorSkin'] = CKEditor::$defaultSkin;
    }
    if (is_dir($dir) && ($handle = opendir($dir))) {
        while (($skin = readdir($handle)) !== false) {
            if (file_exists($dir . $skin . '/skin.js') || file_exists($dir . $skin . '/editor.css') || file_exists($dir . $skin . '/dialog.css')) {
                echo "<option value='" . $skin . "' " . ($settings['CKEditorSkin'] == $skin ? "selected" : "") . ">" . $skin . "</option>";
            }
        }
        closedir($handle);
    }
    ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <?php 
    echo nc_admin_checkbox_simple('InlineEditConfirmation', 1, "" . NETCAT_SETTINGS_INLINE_EDIT_CONFIRMATION . "", $settings['InlineEditConfirmation']);
    ?>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <?php 
    echo nc_admin_checkbox_simple('CkeditorEmbedEditor', 1, "" . NETCAT_SETTINGS_EDITOR_EMBED_TO_FIELD . "", $settings['CkeditorEmbedEditor']);
    ?>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <?php 
    echo nc_admin_checkbox_simple('CKEditorFileSystem', 1, "" . NETCAT_SETTINGS_EDITOR_CKEDITOR_FILE_SYSTEM . "", $settings['CKEditorFileSystem']);
    ?>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <?php 
    echo nc_admin_checkbox_simple('CKEditorAllowCyrilicFolder', 1, "" . NETCAT_SETTINGS_EDITOR_CKEDITOR_CYRILIC_FOLDER . "", $settings['CKEditorAllowCyrilicFolder']);
    ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php 
    echo NETCAT_SETTINGS_EDITOR_ENTER_MODE;
    ?>
:<br>
                    <?php 
    $enter_modes = array(1 => NETCAT_SETTINGS_EDITOR_ENTER_MODE_P, 2 => NETCAT_SETTINGS_EDITOR_ENTER_MODE_BR, 3 => NETCAT_SETTINGS_EDITOR_ENTER_MODE_DIV);
    ?>
                    <?php 
    echo nc_admin_select_simple('', 'CKEditorEnterMode', $enter_modes, $settings['CKEditorEnterMode']);
    ?>
                </td>
            </tr>
        </table>
        <legend><?php 
    echo NETCAT_WYSIWYG_SETTINGS_PANEL_SETTINGS;
    ?>
</legend>
        <table border='0' cellpadding='6' cellspacing='0' width='100%'>
            <tr>
                <td style="width: 200px;">
                    <?php 
    echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_EDITOR_PANEL_FULL;
    ?>
:<br>
                    <?php 
    echo nc_admin_select_simple('', 'CkeditorPanelFull', $panels_select_array, $settings['CkeditorPanelFull']);
    ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php 
    echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_EDITOR_PANEL_INLINE;
    ?>
:<br>
                    <?php 
    echo nc_admin_select_simple('', 'CkeditorPanelInline', $panels_select_array, $settings['CkeditorPanelInline']);
    ?>
                </td>
            </tr>
        </table>
        <legend><?php 
    echo NETCAT_WYSIWYG_SETTINGS_CONFIG_JS_SETTINGS;
    ?>
</legend>
        <?php 
    echo nc_admin_textarea(NETCAT_WYSIWYG_SETTINGS_CONFIG_JS_FILE, 'CkeditorConfigFile', file_get_contents($nc_core->INCLUDE_FOLDER . '../editors/ckeditor4/config.js'), 0, 0, 'height: 250px;');
    ?>
        <?php 
    echo $nc_core->token->get_input();
    ?>
        <input type="hidden" name="phase" value="2"/>
        <input type="hidden" name="editor" value="ckeditor"/>
    </form>
    <?php 
    $UI_CONFIG = new ui_config_wysiwyg(NETCAT_WYSIWYG_CKEDITOR_SETTINGS_TITLE_SETTINGS, '#wysiwyg.ckeditor.settings', 'ckeditor-tab', 'ckeditor-settings');
    $UI_CONFIG->actionButtons = array(array("id" => "submit", "caption" => NETCAT_WYSIWYG_SETTINGS_BUTTON_SAVE, "action" => "mainView.submitIframeForm()"));
    return true;
}
Пример #3
0
function ImportClassificator_modal()
{
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    $s_t0 = $s_t1 = $s_t2 = $s_d0 = $s_d1 = "";
    if ($SortType == 0) {
        $s_t0 = ' selected';
    }
    if ($SortType == 1) {
        $s_t1 = ' selected';
    }
    if ($SortType == 2) {
        $s_t2 = ' selected';
    }
    if ($SortDirection == 0) {
        $s_d0 = ' selected';
    }
    if ($SortDirection == 1) {
        $s_d1 = ' selected';
    }
    echo nc_get_simple_modal_header(CLASSIFICATORS_IMPORT_HEADER);
    ?>

    <form id='adminForm' class='nc-form' enctype='multipart/form-data' action='classificator.php' method='post'>
        <input type=hidden name=MAX_FILE_SIZE value=1000000>
        <input type=hidden name=phase value=13>

        <?php 
    echo CONTENT_CLASSIFICATORS_ADD_KEYWORD;
    ?>
:<br><?php 
    echo nc_admin_input_simple('ClassificatorTable', $ClassificatorTable, 50, '', "maxlength='32'");
    ?>
<br><br>
        <?php 
    echo CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NAME;
    ?>
:<br><?php 
    echo nc_admin_input_simple('ClassificatorName', $ClassificatorName, 50, '', "maxlength='32'");
    ?>
        <br><br>
        <?php 
    echo CLASSIFICATORS_IMPORT_FILE;
    ?>
:<br><input size=40 name=FileCSV type=file><br><br>
        <table cellspacing=0 cellpadding=0>
            <tr>
                <td>
                    <?php 
    echo nc_admin_select_simple(CLASSIFICATORS_SORT_HEADER . ":<br>", 'SortType', array(CLASSIFICATORS_SORT_TYPE_ID, CLASSIFICATORS_SORT_TYPE_NAME, CLASSIFICATORS_SORT_TYPE_PRIORITY), $SortType, "style='width: 100%;'");
    ?>
                </td>
                <td width=4>&nbsp;</td>
                <td>
                    <?php 
    echo nc_admin_select_simple(CLASSIFICATORS_SORT_DIRECTION . ":<br>", 'SortDirection', array(CLASSIFICATORS_SORT_ASCENDING, CLASSIFICATORS_SORT_DESCENDING), $SortDirection, "style='width: 100%;'");
    ?>
                </td>
            </tr>
        </table>
        <?php 
    echo $nc_core->token->get_input();
    ?>
    </form>
    <?php 
    echo nc_get_simple_modal_footer();
}
Пример #4
0
/**
 * Show form to add new permission
 *
 * @param int User ID
 * @param int phase
 * @param string action in form
 * @param int Permission Group ID
 */
function AddPermissionForm($UserID, $phase = 10, $action = 'index.php', $PermissionGroupID = 0)
{
    global $nc_core, $ADMIN_PATH, $MODULE_VARS;
    global $db, $UI_CONFIG;
    global $perm, $user_login;
    $MODULE_VARS = $nc_core->modules->get_module_vars();
    $params = array('AdminType', 'unlimit', 'start_time', 'start_day', 'start_month', 'start_year', 'start_hour', 'start_minute', 'end_time', 'end_day', 'end_month', 'end_year', 'end_hour', 'end_minute', 'item', 'site_list', 'sub_list', 'subclass_list', 'Read', 'Comment', 'Add', 'Edit', 'Check', 'Delete', 'Moderate', 'Administer', 'across_start', 'across_start_type', 'across_end', 'across_end_type');
    foreach ($_POST as $key => $val) {
        if (!in_array($key, $params)) {
            continue;
        }
        ${$key} = $val;
    }
    $module_subscriber = 0;
    if (nc_module_check_by_keyword('subscriber', 0)) {
        $module_subscriber = $MODULE_VARS['subscriber']['VERSION'] > 1 ? 2 : 1;
    }
    if (!$AdminType) {
        $AdminType = 0;
    }
    if (!isset($unlimit)) {
        $unlimit = 1;
    }
    if (isset($unlimit) && !$unlimit) {
        $unlimit = 0;
    }
    if (!$start_time) {
        $start_time = 0;
    }
    if (!$end_time) {
        $end_time = 0;
    }
    $site_list_id = $db->get_col("SELECT `Catalogue_ID`, `Catalogue_Name` From `Catalogue`");
    $site_list_name = $db->get_col(0, 1);
    ?>

                        <script language='javascript'>
                            var site_id = new Array();
                            var site_name = new Array();
    <?php 
    for ($i = 0; $i < count($site_list_id); $i++) {
        print "site_id[" . $i . "]=" . $site_list_id[$i] . ";";
        print "site_name[" . $i . "]=\"" . addslashes($site_list_name[$i]) . "\";";
    }
    ?>

        var some_const = {
            allclassificator : '<?php 
    echo CONTENT_CLASSIFICATORS_NAMEALL;
    ?>
',
            classificator : '<?php 
    echo CONTENT_CLASSIFICATORS_NAMEONE;
    ?>
',
            selectsite: '<?php 
    echo CONTROL_USER_SELECTSITE;
    ?>
',
            allsite:    '<?php 
    echo CONTROL_USER_SELECTSITEALL;
    ?>
',
            siteadmin: '<?php 
    echo CONTROL_USER_RIGHTS_SITEADMIN;
    ?>
',
            subadmin : '<?php 
    echo CONTROL_USER_RIGHTS_SUBDIVISIONADMIN;
    ?>
',
            ccadmin: '<?php 
    echo CONTROL_USER_RIGHTS_SUBCLASSADMINS;
    ?>
',
            site : '<?php 
    echo SECTION_INDEX_MENU_SITE;
    ?>
',
            sub : '<?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_SECTION;
    ?>
',
            cc : '<?php 
    echo CONTROL_USER_FUNCS_CLASSINSECTION;
    ?>
',
            item : '<?php 
    echo CONTROL_USER_RIGHTS_ITEM;
    ?>
',
            selectitem : '<?php 
    echo CONTROL_USER_RIGHTS_SELECT_ITEM;
    ?>
',
            load : '<?php 
    echo CONTROL_USER_RIGHTS_LOAD;
    ?>
',
            mailer : '<?php 
    echo NETCAT_MODULE_SUBSCRIBE_MAILER;
    ?>
'
        }

                        </script>





                        <form action='<?php 
    echo $action;
    ?>
' method='post' name='admin' id='admin'>
                            <input name='phase' value='<?php 
    echo $phase;
    ?>
' type='hidden'>
                            <input type='hidden' name='UserID' value='<?php 
    echo $UserID;
    ?>
'>
                            <input type='hidden' name='PermissionGroupID' value='<?php 
    echo $PermissionGroupID;
    ?>
'>

                            <br>
                            <table border='0' width='75%' align='left' style='margin-left: 20px'>
                                <tr><td width='30%' valign='top'>

                                        <fieldset><legend><?php 
    echo CONTROL_USER_RIGHTS_TYPE_OF_RIGHT;
    ?>
</legend>
                                            <?php 
    if ($perm->isDirector()) {
        ?>
                                                <?php 
        echo nc_admin_radio_simple('AdminType', DIRECTOR, CONTROL_USER_RIGHTS_DIRECTOR, $AdminType == DIRECTOR, 'dir', "onclick='nc_user_obj.setType(7)'");
        ?>
                                                <br>
                                            <?php 
    }
    ?>
    <?php 
    $disabled = $perm->isSupervisor() ? '' : ' disabled';
    ?>
                                            <?php 
    echo nc_admin_radio_simple('AdminType', SUPERVISOR, CONTROL_USER_RIGHTS_SUPERVISOR, $AdminType == SUPERVISOR, 'sv', "onclick='nc_user_obj.setType(6)'" . $disabled);
    ?>
                                            <br>
                                            <div style='height: 6px'></div>
                                                <?php 
    echo nc_admin_radio_simple('AdminType', EDITOR, CONTROL_USER_RIGHTS_EDITOR, $AdminType == EDITOR, 'man', "onclick='nc_user_obj.setType(5)'" . $disabled);
    ?>
                                            <br>
                                            <nobr>
    <?php 
    echo nc_admin_radio_simple('AdminType', MODERATOR, CONTROL_USER_RIGHTS_MODERATOR, $AdminType == MODERATOR, 'mod', "onclick='nc_user_obj.setType(12)'" . $disabled);
    ?>
                                                <br>
                                            </nobr>
                                            <nobr>
    <?php 
    echo nc_admin_radio_simple('AdminType', DEVELOPER, CONTROL_USER_RIGHTS_CLASSIFICATORADMIN, $AdminType == DEVELOPER, 'devel', "onclick='nc_user_obj.setType(14)'" . $disabled);
    ?>
                                                <br>
                                            </nobr>

                                            <?php 
    if ($module_subscriber == 2) {
        ?>
                                                <div style='height: 6px'></div>
                                                <?php 
        echo nc_admin_radio_simple('AdminType', SUBSCRIBER, CONTROL_USER_RIGHTS_SUBSCRIBER, $AdminType == SUBSCRIBER, 'subscriber', "onclick='nc_user_obj.setType(30)'" . $disabled);
        ?>
                                                <br>
                                            <?php 
    }
    ?>

                                            <div style='height: 6px'></div>
                                            <?php 
    echo nc_admin_radio_simple('AdminType', BAN, CONTROL_USER_RIGHTS_BAN, $AdminType == BAN, 'ban', "onclick='nc_user_obj.setType(20)'" . $disabled);
    ?>
                                            <br>
                                            <div style='height: 6px'></div>
    <?php 
    echo nc_admin_radio_simple('AdminType', GUEST, CONTROL_USER_RIGHTS_GUESTONE, $AdminType == GUEST, 'guest', "onclick='nc_user_obj.setType(8)'" . $disabled);
    ?>
                                            <br>
                                            <br><br><br><br><br><br><br>
                                        </fieldset>

                                    </td><td valign='top'>

                                        <div id='div_livetime' name='div_livetime' style='display: none'>
                                            <fieldset><legend><?php 
    echo CONTROL_USER_RIGHTS_LIVETIME;
    ?>
</legend>
                                                <?php 
    echo nc_admin_radio_simple('unlimit', 1, CONTROL_USER_RIGHTS_UNLIMITED, $unlimit, '', "onclick='nc_user_obj.disable_livetime(1)'");
    ?>
                                                <br>
                                                <?php 
    echo nc_admin_radio_simple('unlimit', 0, CONTROL_USER_RIGHTS_LIMITED, !$unlimit, '', "onclick='nc_user_obj.disable_livetime(0)'");
    ?>
                                                <br>
                                                <div name='div_time' id='div_time' style='min-width:350px'>
                                                    <br><?php 
    echo CONTROL_USER_RIGHTS_STARTING_OPERATIONS;
    ?>
:<br>
                                                    <table border='0' cellpadding='2' cellspacing='0'><tr><td>
                                                                <?php 
    echo nc_admin_radio_simple('start_time', 0, CONTROL_USER_RIGHTS_NOW, !$start_time, 'start_now', "onclick='nc_user_obj.setStartType(0)'");
    ?>
                                                            </td><td colspan='4'></td></tr><tr><td>
                                                                <?php 
    echo nc_admin_radio_simple('start_time', 1, CONTROL_USER_RIGHTS_ACROSS . "&nbsp;&nbsp;", $start_time == 1, 'start_across', "onclick='nc_user_obj.setStartType(1)'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('across_start', $across_start, 2, '', "id='across_start' maxlength='2'");
    ?>
                                                            </td><td>
    <?php 
    echo nc_admin_select_simple('', 'across_start_type', array(CONTROL_USER_RIGHTS_ACROSS_MINUTES, CONTROL_USER_RIGHTS_ACROSS_HOURS, CONTROL_USER_RIGHTS_ACROSS_DAYS, CONTROL_USER_RIGHTS_ACROSS_MONTHS), $across_start_type, "id='across_start_type'");
    ?>
                                                            </td><td colspan='2'></td></tr><tr><td>

                                                                <?php 
    echo nc_admin_radio_simple('start_time', 2, '', $start_time == 2, 'start_define', "onclick='nc_user_obj.setStartType(2)'");
    ?>
                                                                <?php 
    echo nc_admin_input_simple('start_day', '', 2, '', "maxlength='2' id='start_day'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('start_month', '', 2, '', "maxlength='2' id='start_month'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('start_year', '', 4, '', "maxlength='4' id='start_year'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('start_hour', '', 2, '', "maxlength='2' id='start_hour'");
    ?>
                                                                <b> :</b></td><td>
    <?php 
    echo nc_admin_input_simple('start_minute', '', 2, '', "maxlength='2' id='start_minute'");
    ?>
                                                            </td></tr></table>

                                                    <br><?php 
    echo CONTROL_USER_RIGHTS_FINISHING_OPERATIONS;
    ?>
:<br>
                                                    <table border='0' cellpadding='2' cellspacing='0'><tr><td colspan='5'>
                                                                <?php 
    echo nc_admin_radio_simple('end_time', 0, CONTROL_USER_RIGHTS_NONLIMITED, !$end_time, 'end_now', "onclick='nc_user_obj.setEndType(0)'");
    ?>
                                                            </td></tr><tr><td>
                                                                <?php 
    echo nc_admin_radio_simple('end_time', 1, CONTROL_USER_RIGHTS_ACROSS, !$end_time, 'end_across', "onclick='nc_user_obj.setEndType(1)'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('across_end', $across_end, 2, '', "id='across_end' maxlength='2'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_select_simple('', 'across_end_type', array(CONTROL_USER_RIGHTS_ACROSS_MINUTES, CONTROL_USER_RIGHTS_ACROSS_HOURS, CONTROL_USER_RIGHTS_ACROSS_DAYS, CONTROL_USER_RIGHTS_ACROSS_MONTHS), $across_end_type, "id='across_end_type'");
    ?>
                                                            </td><td colspan='2'></td></tr><tr><td>

                                                                <?php 
    echo nc_admin_radio_simple('end_time', 2, '', $end_time == 2, 'end_define', "onclick='nc_user_obj.setEndType(2)'");
    ?>
                                                                <?php 
    echo nc_admin_input_simple('end_day', '', 2, '', "maxlength='2' id='end_day'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('end_month', '', 2, '', "maxlength='2' id='end_month'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('end_year', '', 4, '', "maxlength='4' id='end_year'");
    ?>
                                                            </td><td>
                                                                <?php 
    echo nc_admin_input_simple('end_hour', '', 2, '', "maxlength='2' id='end_hour'");
    ?>
                                                                <b> :</b></td><td>
    <?php 
    echo nc_admin_input_simple('end_minute', '', 2, '', "maxlength='2' id='end_minute'");
    ?>
                                                            </td></tr></table>
                                                </div>
                                            </fieldset>
                                        </div>

                                    </td></tr><tr><td colspan='2'>

                                        <div name='div_main_right' id='div_main_right' style='display: none'>
                                            <fieldset><legend><?php 
    echo CONTROL_USER_RIGHTS_RIGHT;
    ?>
</legend>
                                                <div name='userperm' id='userperm' style='display: none'><br>
                                                    <?php 
    echo nc_admin_checkbox_simple('user_add', 1, CONTROL_USER_RIGHTS_CONTROL_ADD);
    ?>
<br>
    <?php 
    echo nc_admin_checkbox_simple('user_edit', 1, CONTROL_USER_RIGHTS_CONTROL_EDIT);
    ?>
<br>
    <?php 
    echo nc_admin_checkbox_simple('user_del', 1, CONTROL_USER_RIGHTS_CONTROL_DELETE);
    ?>
<br>
                                                </div>

                                                <br>

                                                <table id='tbl_item' name='tbl_item' cellpadding='4' cellspacing='1' width='75%' bgcolor='#CCCCCC'>
                                                    <tbody></tbody>
                                                </table>

                                                <div name='div_perm' id='div_perm' style='display: none'><br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Read', 1, CONTROL_CLASS_ACTIONS_VIEW, false, 'l01');
    ?>
<br>
                                                    <?php 
    if (nc_module_check_by_keyword("comments")) {
        ?>
                                                        <?php 
        echo nc_admin_checkbox_simple('Comment', 1, CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_COMMENT, false, 'l07');
        ?>
<br>
                                                    <?php 
    }
    ?>
                                                    <?php 
    echo nc_admin_checkbox_simple('Add', 1, CONTROL_CONTENT_CATALOUGE_ADD, false, 'l02');
    ?>
<br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Edit', 1, CONTROL_CLASS_ACTIONS_EDIT, false, 'l03');
    ?>
<br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Check', 1, CONTROL_CLASS_ACTIONS_CHECKED, false, 'l031');
    ?>
<br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Delete', 1, CONTROL_CLASS_ACTIONS_DELETE, false, 'l032');
    ?>
<br>
                                                    <?php 
    if ($module_subscriber == 1) {
        ?>
                                                        <?php 
        echo nc_admin_checkbox_simple('Subscribe', 1, CONTROL_CLASS_ACTIONS_MAIL, false, 'l04');
        ?>
<br>
                                                    <?php 
    }
    ?>
    <?php 
    echo nc_admin_checkbox_simple('Moderate', 1, CONTROL_CLASS_ACTIONS_MODERATE, false, 'l05', "onclick='nc_user_obj.handler_checkbox(5)'");
    ?>
<br>
    <?php 
    echo nc_admin_checkbox_simple('Administer', 1, CONTROL_CLASS_ACTIONS_ADMIN, false, 'l06', "onclick='nc_user_obj.handler_checkbox(6)'");
    ?>
<br>
                                                </div>

                                                <div name='div_perm_ban' id='div_perm_ban' style='display: none'><br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Read', 1, CONTROL_CLASS_ACTIONS_VIEW, false, 'l1');
    ?>
<br>
                                                    <?php 
    if (nc_module_check_by_keyword("comments")) {
        ?>
                                                        <?php 
        echo nc_admin_checkbox_simple('Comment', 1, CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_COMMENT, false, 'l7');
        ?>
<br>
                                                    <?php 
    }
    ?>
                                                    <?php 
    echo nc_admin_checkbox_simple('Add', 1, CONTROL_CONTENT_CATALOUGE_ADD, false, 'l2');
    ?>
<br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Edit', 1, CONTROL_CLASS_ACTIONS_EDIT, false, 'l3');
    ?>
<br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Check', 1, CONTROL_CLASS_ACTIONS_CHECKED, false, 'l31');
    ?>
<br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Delete', 1, CONTROL_CLASS_ACTIONS_DELETE, false, 'l32');
    ?>
<br>
                                                    <?php 
    if (nc_module_check_by_keyword("subscriber", false)) {
        ?>
        <?php 
        echo nc_admin_checkbox_simple('Subscribe', 1, CONTROL_CLASS_ACTIONS_MAIL, false, 'l4');
        ?>
<br>
    <?php 
    }
    ?>
                                                </div>

                                                <div name='div_perm_classificator' id='div_perm_classificator' style='display: none'><br>
                                                    <?php 
    echo nc_admin_checkbox_simple('Edit', 1, CONTROL_CLASS_ACTIONS_EDIT, false, 'l1');
    ?>
<br>
    <?php 
    echo nc_admin_checkbox_simple('Add', 1, CONTROL_CONTENT_CATALOUGE_ADD, false, 'l2');
    ?>
<br>
    <?php 
    echo nc_admin_checkbox_simple('Moderate', 1, CONTROL_CLASS_ACTIONS_MODERATE, false, 'l3');
    ?>
<br>
                                                </div>

                                                <div name='div_perm_subscriber' id='div_perm_subscriber' style='display: none'><br>
                                                </div>

                                            </fieldset>
                                        </div>




                                    </td></tr><tr><td colspan='2'>
                                        <div name="div_help" id="div_help" style='display: none'>
                                            <fieldset><legend><?php 
    echo CONTROL_USER_RIGHTS_CONTROL_HELP;
    ?>
</legend>
                                                <div id='help' name = 'help' style='padding: 10px'></div>
                                            </fieldset>
                                        </div>
                                    </td></tr></table>
    <?php 
    echo $nc_core->token->get_input();
    ?>
                        </form>

                        <script type="text/javascript" src='<?php 
    echo $ADMIN_PATH;
    ?>
js/user.js'></script>
                        <script type="text/javascript">
                            nc_user_obj = new nc_user_perm();
                            nc_user_obj.setType(<?php 
    echo $AdminType;
    ?>
);
                            nc_user_obj.disable_livetime(<?php 
    echo $unlimit;
    ?>
);
                            nc_user_obj.setStartType(<?php 
    echo $start_time;
    ?>
);
                            nc_user_obj.setEndType(<?php 
    echo $end_time;
    ?>
);
                        </script>
                        <?php 
    if ($UserID) {
        $UI_CONFIG->headerText = CONTROL_USER_RIGHT_ADDPERM . " " . addslashes($user_login);
    } else {
        $UI_CONFIG->headerText = CONTROL_USER_RIGHT_ADDPERM_GROUP . " " . GetPermissionGroupName($PermissionGroupID);
    }
    $UI_CONFIG->actionButtons[] = array("id" => "addright", "caption" => CONTROL_USER_RIGHT_ADDNEWRIGHTS, "action" => "mainView.submitIframeForm()");
}
Пример #5
0
/**
 * 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;
}