Esempio n. 1
0
function showUploadForm()
{
    $maxfilesize = min(ini_get('upload_max_filesize'), ini_get('upload_post_max_size') - 100);
    global $maxfilesize, $HTTP_ROOT_PATH, $HTTP_FILES_PATH, $HTTP_IMAGES_PATH, $HTTP_TEMPLATE_PATH;
    ?>
    <form method="post">
        <fieldset>
	<legend><?php 
    echo TOOLS_DUMP_CREATE_HEADER;
    ?>
</legend>
            <?php 
    echo nc_admin_radio_simple('backup_mode', 'full', TOOLS_DUMP_CREATE_OPT_FULL, true, 'backup_mode_full');
    ?>
<br />
            <?php 
    echo nc_admin_radio_simple('backup_mode', 'simple', TOOLS_DUMP_CREATE_OPT_DATA, false, 'backup_mode_simple');
    ?>
<br />
            <?php 
    echo nc_admin_radio_simple('backup_mode', 'sql', TOOLS_DUMP_CREATE_OPT_SQL, false, 'backup_mode_sql');
    ?>
<br />
            <input type="hidden" name="phase" value="1" />
	    <input type="submit" value="<?php 
    echo TOOLS_DUMP_CREATE_SUBMIT;
    ?>
" />
        </fieldset>
    </form>

    <form enctype='multipart/form-data' action='dump.php' method='post'>
        <input type='hidden' name='MAX_FILE_SIZE' value='<?php 
    echo $maxfilesize;
    ?>
'>
        <fieldset>
            <legend><?php 
    echo TOOLS_DUMP_INC_TITLE;
    ?>
</legend>
            <div style='margin:10px;'>
                <input size='40' name='filename' type='file'>
                <input type='submit' value='<?php 
    echo TOOLS_DUMP_INC_DORESTORE;
    ?>
' title='<?php 
    echo TOOLS_DUMP_INC_DORESTORE;
    ?>
'>
            </div>
            <input type='hidden' name='phase' value='7'>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <font color='gray'>
                        <?php 
    echo nc_admin_checkbox_simple('what[]', 'database', TOOLS_DUMP_INC_DBDUMP, true, 'database');
    ?>
<br />
                        <?php 
    echo nc_admin_checkbox_simple('what[]', 'netcat_template', TOOLS_DUMP_INC_FOLDER . ' <b>' . $HTTP_TEMPLATE_PATH . '</b>', true, 'netcat_template');
    ?>
<br />
                        <?php 
    echo nc_admin_checkbox_simple('what[]', 'netcat_files', TOOLS_DUMP_INC_FOLDER . ' <b>' . $HTTP_FILES_PATH . '</b>', true, 'netcat_files');
    ?>
<br />
                        <?php 
    echo nc_admin_checkbox_simple('what[]', 'images', TOOLS_DUMP_INC_FOLDER . ' <b>' . $HTTP_IMAGES_PATH . '</b>', true, 'images');
    ?>
<br />
                        <?php 
    echo nc_admin_checkbox_simple('what[]', 'modules', TOOLS_DUMP_INC_FOLDER . ' <b>' . $HTTP_ROOT_PATH . '</b>', true, 'modules');
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
    </form>
    <?php 
}
Esempio n. 2
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()");
}
Esempio n. 3
0
function nc_class_wizard_settings($class_id, $class_type, $class_name = '', $class_group = '')
{
    global $db, $UI_CONFIG;
    $class_id = intval($class_id);
    $fields = $db->get_results("SELECT `Field_ID`, `Field_Name`, `Description` FROM `Field` WHERE `Class_ID` = '" . $class_id . "' ORDER BY `Field_ID`", ARRAY_A);
    echo "<form method='POST' action='wizard_class.php' name='settings'>";
    switch ($class_type) {
        case 1:
            #one object on page
            nc_print_status(WIZARD_CLASS_FORM_SETTINGS_NO_SETTINGS, 'error');
            break;
        case 4:
            #Web-form
            echo "<fieldset><legend>" . WIZARD_CLASS_FORM_SETTINGS_FEEDBACK_FIELDS_SETTINGS . "</legend>";
            foreach ($fields as $field) {
                echo nc_admin_checkbox_simple("SettingsFormFields[" . $field['Field_ID'] . "]", $field['Field_ID'], $field['Field_Name'] . " (" . $field['Description'] . ")") . "<br>";
            }
            ?>
            </fieldset><br>
            <?php 
            echo WIZARD_CLASS_FORM_SETTINGS_FEEDBACK_SENDER_NAME;
            ?>
:<br>
            <?php 
            echo nc_admin_input_simple('SettingsSenderName', '');
            ?>
<br><br>
            <?php 
            echo WIZARD_CLASS_FORM_SETTINGS_FEEDBACK_SENDER_MAIL;
            ?>
:<br>
            <?php 
            echo nc_admin_input_simple('SettingsSenderEmail', '');
            ?>
<br><br>
            <?php 
            echo WIZARD_CLASS_FORM_SETTINGS_FEEDBACK_SUBJECT;
            ?>
:<br>
            <?php 
            echo nc_admin_input_simple('SettingsSenderEmail', '');
            ?>
<br><br>
            <?php 
            break;
        case 3:
            #Search
            echo "<fieldset><legend>" . WIZARD_CLASS_FORM_SETTINGS_FIELDS_FOR_OBJECT_SEARCH . "</legend>";
            foreach ($fields as $field) {
                echo nc_admin_checkbox_simple("SettingsSearchFields[" . $field['Field_ID'] . "]", $field['Field_ID'], $field['Field_Name'] . " (" . $field['Description'] . ")") . "<br>";
            }
            echo "</fieldset>";
            //Здесь break не нужен - сразу идет как и в "Списке объетов"
        //Здесь break не нужен - сразу идет как и в "Списке объетов"
        case 2:
            // Список объектов
            echo "<fieldset><legend>" . WIZARD_CLASS_FORM_SETTINGS_FIELDS_FOR_OBJECT_LIST . "</legend>";
            foreach ($fields as $field) {
                echo nc_admin_checkbox_simple("SettingsObjectList[" . $field['Field_ID'] . "]", $field['Field_ID'], $field['Field_Name'] . " (" . $field['Description'] . ")") . "<br>";
            }
            ?>
            </fieldset>
            <br>
            <fieldset>
                <legend><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_SETTINGS_FOR_LIST_VIEW;
            ?>
</legend>
                <b><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_OBJECT_NUMBER_ON_THE_PAGE;
            ?>
:</b><br><?php 
            echo nc_admin_input_simple('SettingsRecNum', 30);
            ?>
<br><br>
                <b><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_SORT_OBJECT_BY_FIELD;
            ?>
:</b><br>
                <select name='SettingsSort'>
                    <option id='SettingsSort0' value='0'><?php 
            echo WIZARD_CLASS_DEFAULT;
            ?>
                        <?php 
            foreach ($fields as $field) {
                echo "<option value='" . $field[Field_Name] . "'>" . $field[Field_Name] . " (" . $field[Description] . ")";
            }
            ?>
                </select><br><br>
                <?php 
            echo nc_admin_radio_simple('SettingsSortDirection', 1, WIZARD_CLASS_FORM_SETTINGS_SORT_ASC, true, 'SettingsSortDirection1');
            ?>
                <br>
                <?php 
            echo nc_admin_radio_simple('SettingsSortDirection', 2, WIZARD_CLASS_FORM_SETTINGS_SORT_DESC, false, 'SettingsSortDirection2');
            ?>
                <br><br>
                <b><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_PAGE_NAVIGATION;
            ?>
:</b><br>
                <?php 
            echo nc_admin_radio_simple('SettingsNavigation', 1, WIZARD_CLASS_FORM_SETTINGS_PAGE_NAVIGATION_BY_NEXT_PREV, true, 'SettingsNavigation1');
            ?>
                <br>
                <?php 
            echo nc_admin_radio_simple('SettingsNavigation', 2, WIZARD_CLASS_FORM_SETTINGS_PAGE_NAVIGATION_BY_PAGE_NUMBER, false, 'SettingsNavigation2');
            ?>
                <br>
                <?php 
            echo nc_admin_radio_simple('SettingsNavigation', 3, WIZARD_CLASS_FORM_SETTINGS_PAGE_NAVIGATION_BY_BOTH, false, 'SettingsNavigation3');
            ?>
                <br>
                <br><b><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_LOCATION_OF_NAVIGATION;
            ?>
:</b><br>
                <?php 
            echo nc_admin_radio_simple('SettingsNavigationPosition', 1, WIZARD_CLASS_FORM_SETTINGS_LOCATION_TOP, true, 'SettingsNavigationPosition1');
            ?>
                <br>
            <?php 
            echo nc_admin_radio_simple('SettingsNavigationPosition', 2, WIZARD_CLASS_FORM_SETTINGS_LOCATION_BOTTOM, false, 'SettingsNavigationPosition2');
            ?>
                <br>
                    <?php 
            echo nc_admin_radio_simple('SettingsNavigationPosition', 3, WIZARD_CLASS_FORM_SETTINGS_LOCATION_BOTH, false, 'SettingsNavigationPosition3');
            ?>
                <br>

                <br><b><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_LIST_OBJECT_TYPE;
            ?>
:</b><br>
                <?php 
            echo nc_admin_radio_simple('SettingsObjectListType', 1, WIZARD_CLASS_FORM_SETTINGS_LIST_TYPE, true, 'SettingsObjectListType1');
            ?>
                <br>
            <?php 
            echo nc_admin_radio_simple('SettingsObjectListType', 2, WIZARD_CLASS_FORM_SETTINGS_TABLE_TYPE, false, 'SettingsObjectListType2');
            ?>
                <br>
            </fieldset>
            <br>
            <fieldset id='SettingsObjectListDelimiter'>
                <legend><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_LIST_TYPE_SETTINGS;
            ?>
</legend>
                <b><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_LIST_DELIMITER_TYPE;
            ?>
:</b><br>
                <?php 
            echo nc_admin_radio_simple('SettingsObjectListDelimiter', 1, "&lt;hr&gt", true, 'SettingsObjectListDelimiter1');
            ?>
                <br>
            <?php 
            echo nc_admin_radio_simple('SettingsObjectListDelimiter', 2, "&lt;br&gt", false, 'SettingsObjectListDelimiter2');
            ?>
                <br>
            </fieldset>
            <fieldset id='SettingsObjectTable'>
                <legend><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_TABLE_TYPE_SETTINGS;
            ?>
</legend>
            <?php 
            echo nc_admin_checkbox_simple('SettingsObjectTableBackground', 1, WIZARD_CLASS_FORM_SETTINGS_TABLE_BACKGROUND);
            ?>
<br>
            <?php 
            echo nc_admin_checkbox_simple('SettingsObjectTableBorder', 1, WIZARD_CLASS_FORM_SETTINGS_TABLE_BORDER);
            ?>
<br>
            </fieldset>
            <br>
                <?php 
            echo nc_admin_checkbox_simple('SettingsIsObjectFull', 1, WIZARD_CLASS_FORM_SETTINGS_FULL_PAGE);
            ?>
<br>
            <br>
            <fieldset id='SettingsObjectFullLink' style='display: none;'>
                <legend><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_FULL_PAGE_LINK_TYPE;
            ?>
</legend>
                <?php 
            echo WIZARD_CLASS_FORM_SETTINGS_CHECK_FIELDS_TO_FULL_PAGE;
            ?>
<br>
                <?php 
            foreach ($fields as $field) {
                echo nc_admin_checkbox_simple("SettingsObjectFullLink[" . $field[Field_ID] . "]", $field['Field_ID'], $field['Field_Name'] . " (" . $field['Description'] . ")") . '<br>';
            }
            ?>
            </fieldset>
            <br>
            <fieldset id='SettingsObjectFull' style='display: none;'>
                <legend><?php 
            echo WIZARD_CLASS_FORM_SETTINGS_FIELDS_TO_SHOW_OBJECT;
            ?>
</legend>
                <?php 
            foreach ($fields as $field) {
                echo nc_admin_checkbox_simple("SettingsObjectFull[" . $field['Field_ID'] . "]", $field['Field_ID'], $field['Field_Name'] . " (" . $field['Description'] . ")") . '<br>';
            }
            ?>
            </fieldset>

            <script>
                var settingsIsObjectFull = document.getElementById('SettingsIsObjectFull');
                var settingsObjectFullLink = document.getElementById('SettingsObjectFullLink');
                var settingsObjectFull = document.getElementById('SettingsObjectFull');

                var settingsObjectListDelimiter = document.getElementById('SettingsObjectListDelimiter');
                var settingsObjectTable = document.getElementById('SettingsObjectTable');

                settingsObjectListDelimiter.style.display = 'none';
                settingsObjectTable.style.display = 'none';

                settingsIsObjectFull.onclick =  function() {
                    if(settingsIsObjectFull.checked) {
                        settingsObjectFullLink.style.display = '';
                        settingsObjectFull.style.display = '';
                    } else {
                        settingsObjectFullLink.style.display = 'none';
                        settingsObjectFull.style.display = 'none';
                    }
                    return true;
                }

                //  var settingsObjectListDelimiter = document.getElementById('SettingsObjectListDelimiter');

                var radio = document.forms.settings.SettingsObjectListType;

                for (var i = 0; i < radio.length; i++) {
                    if (radio[i].checked) {
                        if (radio[i].value == 1) {
                            settingsObjectListDelimiter.style.display = '';
                            settingsObjectTable.style.display = 'none';
                        }
                        if (radio[i].value == 2) {
                            settingsObjectTable.style.display = '';
                            settingsObjectListDelimiter.style.display = 'none';
                        }
                    }
                    radio[i].onclick = function() {
                        if (this.checked) {
                            if (this.value == 1) {
                                settingsObjectListDelimiter.style.display = '';
                                settingsObjectTable.style.display = 'none';
                            }
                            if (this.value == 2) {
                                settingsObjectTable.style.display = '';
                                settingsObjectListDelimiter.style.display = 'none';
                            }
                        }
                    }
                }

            </script>
            <?php 
            break;
    }
    echo "<input type='hidden' name='phase' value='5'>";
    echo "<input type='hidden' name='Class_Type' value='{$class_type}'>";
    echo "<input type='hidden' name='ClassID' value='{$class_id}'>";
    echo "<input type='hidden' name='ClassName' value='" . $class_name . "'>";
    echo "<input type='hidden' name='Class_Group' value='{$class_group}'>";
    echo "<input type='submit' class='hidden'>";
    echo "</form>";
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => WIZARD_CLASS_BUTTON_SAVE_SETTINGS, "action" => "mainView.submitIframeForm()");
}
Esempio n. 4
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;
}