예제 #1
0
파일: copy.php 프로젝트: Blu2z/implsk
function nc_copy_form()
{
    global $UI_CONFIG, $db;
    $nc_core = nc_Core::get_object();
    $all_sites = $nc_core->catalogue->get_all();
    $copy_type = $nc_core->input->fetch_get_post('copy_type');
    if (!$copy_type) {
        $copy_type = 'site';
    }
    $catalogue_id = intval($nc_core->input->fetch_get_post('catalogue_id'));
    $sub_id = intval($nc_core->input->fetch_get_post('sub_id'));
    if ($catalogue_id) {
        $Result = $db->get_results("SELECT `Subdivision_ID` AS value,\n                                    CONCAT(Subdivision_ID, '. ', Subdivision_Name) AS description,\n                                    `Parent_Sub_ID` AS parent\n                                    FROM `Subdivision`\n                                    WHERE `Catalogue_ID` = '" . $catalogue_id . "'\n                                    ORDER BY `Subdivision_ID`", ARRAY_A);
        if (!empty($Result)) {
            $res_sub = nc_select_options($Result, $sub_id);
        }
    }
    $dest_catalogue_id = intval($nc_core->input->fetch_get_post('dest_catalogue_id'));
    $dest_sub_id = intval($nc_core->input->fetch_get_post('dest_sub_id'));
    if ($dest_catalogue_id) {
        $Result = $db->get_results("SELECT `Subdivision_ID` AS value,\n                                    CONCAT(Subdivision_ID, '. ', Subdivision_Name) AS description,\n                                    `Parent_Sub_ID` AS parent\n                                    FROM `Subdivision`\n                                    WHERE `Catalogue_ID` = '" . $dest_catalogue_id . "'\n                                    ORDER BY `Subdivision_ID`", ARRAY_A);
        if (!empty($Result)) {
            $res_dest_sub = nc_select_options($Result, $dest_sub_id);
        }
    }
    $templates = array('sub_name' => $nc_core->input->fetch_get_post('tmpl_sub_name'), 'sub_keyword' => $nc_core->input->fetch_get_post('tmpl_sub_keyword'), 'cc_name' => $nc_core->input->fetch_get_post('tmpl_cc_name'), 'cc_keyword' => $nc_core->input->fetch_get_post('tmpl_cc_keyword'));
    $html .= " <form action='copy.php' method='post'>\n             <input type='hidden' name='phase' value='1' /> ";
    $html .= "<script type='text/javascript'>\n              var nc_ajax = null;\n              try {\n                nc_ajax = new XMLHttpRequest();\n              }\n              catch(e) {\n                try {\n                  nc_ajax = new ActiveXObject(\"Msxml2.XMLHTTP\");\n                }\n                catch(e) {\n                    nc_ajax = new ActiveXObject(\"Microsoft.XMLHTTP\");\n                  }\n              }\n\n\n              function nc_copy_resp_subs() {\n                if (nc_ajax.readyState == 4) {\n                   document.getElementById('sub_list').innerHTML = \"<select  name='sub_id' id='sub_id'>\" + nc_ajax.responseText +\"</select>\";\n                }\n              }\n\n              function nc_copy_resp_destsubs() {\n                if (nc_ajax.readyState == 4) {\n                   document.getElementById('dest_sub_list').innerHTML = \"<select name='dest_sub_id' id='dest_sub_id'><option value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_LINEADD_ROOT . "</option>\" + nc_ajax.responseText +\"</select>\";\n                }\n              }\n\n\n              function nc_copy_query ( dest) {\n                var list = document.getElementById(dest ? 'dest_catalogue_id' : 'catalogue_id');\n                var site = list.options[list.selectedIndex].value;\n                nc_ajax.open('POST', '../user/index.php?phase=20', true);\n                nc_ajax.onreadystatechange = dest ? nc_copy_resp_destsubs : nc_copy_resp_subs ;\n                nc_ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded, charset=utf-8');\n                nc_ajax.send('getsublist=' + site );\n              }\n\n              function nc_copy_change_type() {\n                if (document.getElementById('copy_type').selectedIndex == 1 ) {\n                  var list = document.getElementById('catalogue_id');\n                  var site = list.options[list.selectedIndex].value;\n                  document.getElementById('row3').style.display = 'block';\n                  document.getElementById('dest_fl').style.display = 'block';\n                  nc_ajax.open('POST', '../user/index.php?phase=20', true);\n                  nc_ajax.onreadystatechange = nc_copy_resp_subs;\n                  nc_ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded, charset=utf-8');\n                  nc_ajax.send('getsublist=' + site );\n                }\n                else {\n                  document.getElementById('row3').style.display = 'none';\n                  document.getElementById('dest_fl').style.display = 'none';\n                }\n              }\n            </script>";
    $html .= "<div id='copy_sub'><fieldset><legend>" . TOOLS_COPYSUB_SOURCE . "</legend>";
    $html .= "<div id='row1' class='div_row'>\n              <div class='left_col'>" . TOOLS_COPYSUB_ACTION . "</div>\n              <div class='right_col'>\n                  <select  id='copy_type' name='copy_type' onchange='nc_copy_change_type(); return false;'>\n                     <option value='site' " . ($copy_type == 'site' ? "selected='selected'" : "") . ">" . TOOLS_COPYSUB_COPY_SITE . "</option>\n                     <option value='sub' " . ($copy_type == 'sub' ? "selected='selected'" : "") . ">" . TOOLS_COPYSUB_COPY_SUB . "</option>\n                      </select>\n               </div>\n               <div style='clear:both;'></div>\n            </div>";
    $html .= "<div id='row2'  class='div_row'>\n              <div class='left_col' style='border-top: none;'>" . TOOLS_COPYSUB_SITE . "</div>\n              <div class='right_col' style='border-top: none;'>\n                  <select  id='catalogue_id' name='catalogue_id' onchange='nc_copy_query(0); return false;'>";
    foreach ($all_sites as $v) {
        $html .= "<option value='" . $v['Catalogue_ID'] . "' " . ($catalogue_id == $v['Catalogue_ID'] ? "selected='selected'" : "") . ">" . $v['Catalogue_ID'] . ". " . $v['Catalogue_Name'] . "</option>";
    }
    $html .= "          </select>\n               </div>\n               <div style='clear:both;'></div>\n            </div>";
    $html .= "<div id='row3' class='div_row' " . ($copy_type == 'site' ? "style='display: none; '" : "") . ">\n              <div class='left_col' style='border-top: none;'>" . TOOLS_COPYSUB_SUB . "</div>\n              <div id='sub_list' class='right_col' style='border-top: none;'>\n                " . ($res_sub ? "<select name='sub_id'>" . $res_sub . "</select>" : "") . "\n               </div>\n               <div style='clear:both;'></div>\n            </div>\n            </fieldset>";
    $html .= "<fieldset id='dest_fl' " . ($copy_type == 'site' ? "style='display: none; '" : "") . "><legend>" . TOOLS_COPYSUB_DESTINATION . "</legend>\n             <div id='row_dest_1' class='div_row'>\n              <div class='left_col'>" . TOOLS_COPYSUB_SITE . "</div>\n              <div class='right_col' >\n                  <select  id='dest_catalogue_id' name='dest_catalogue_id'  onchange='nc_copy_query(1); return false;'>";
    foreach ($all_sites as $v) {
        $html .= "<option value='" . $v['Catalogue_ID'] . "' " . ($dest_catalogue_id == $v['Catalogue_ID'] ? "selected='selected'" : "") . ">" . $v['Catalogue_ID'] . ". " . $v['Catalogue_Name'] . "</option>";
    }
    $html .= "          </select>\n               </div>\n               <div style='clear:both;'></div>\n            </div>\n\n\n            <div id='row_dest_2' class='div_row'>\n              <div class='left_col' style='border-top: none;'>" . WIZARD_CLASS_FORM_SUBDIVISION_PARENTSUB . "</div>\n              <div id='dest_sub_list' class='right_col' style='border-top: none;'>\n                <select name='dest_sub_id'><option value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_LINEADD_ROOT . "</option>" . ($res_dest_sub ? $res_dest_sub : "") . "</select>\n               </div>\n               <div style='clear:both;'></div>\n            </div>\n            </fieldset> ";
    $html .= "<fieldset><legend>" . TOOLS_COPYSUB_TEMPLATE_NAME . "</legend>\n              <div id='tmpl1' class='div_row'>\n              <div class='left_col'>" . REPORTS_LAST_NAME . "</div>\n              <div  class='right_col' >" . nc_admin_input_simple('tmpl_sub_name', $templates['sub_name'] ? $templates['sub_name'] : "%NAME%", 0, '') . "\n               </div>\n               <div style='clear:both;'></div>\n            </div>\n            <div id='tmpl2' class='div_row'>\n              <div class='left_col' style='border-top: none;'>" . TOOLS_COPYSUB_KEYWORD_SUB . "</div>\n              <div  class='right_col' style='border-top: none;'>" . nc_admin_input_simple('tmpl_sub_keyword', $templates['sub_keyword'] ? $templates['sub_keyword'] : "%KEYWORD%-copy", 0, '') . "\n               </div>\n               <div style='clear:both;'></div>\n            </div>\n            <div id='tmpl3' class='div_row'>\n              <div class='left_col' style='border-top: none;'>" . TOOLS_COPYSUB_NAME_CC . "</div>\n              <div  class='right_col' style='border-top: none;'>" . nc_admin_input_simple('tmpl_cc_name', $templates['cc_name'] ? $templates['cc_name'] : "%NAME%", 0, '') . "\n               </div>\n               <div style='clear:both;'></div>\n            </div>\n            <div id='tmpl4' class='div_row'>\n              <div class='left_col' style='border-top: none;'>" . TOOLS_COPYSUB_KEYWORD_CC . "</div>\n              <div  class='right_col' style='border-top: none;'>" . nc_admin_input_simple('tmpl_cc_keyword', $templates['cc_keyword'] ? $templates['cc_keyword'] : "%KEYWORD%-copy", 0, '') . "\n               </div>\n               <div style='clear:both;'></div>\n            </div></fieldset>\n            ";
    $html .= "<fieldset><legend>" . TOOLS_COPYSUB_SETTINGS . "</legend>" . nc_admin_checkbox_simple('with_child', 1, TOOLS_COPYSUB_COPY_WITH_CHILD, false, '', !$phase ? " checked='checked'" : "") . "<br/>" . nc_admin_checkbox_simple('with_сс', 1, TOOLS_COPYSUB_COPY_WITH_CC, false, '', !$phase ? " checked='checked'" : "") . "<br/>" . nc_admin_checkbox_simple('with_object', 1, TOOLS_COPYSUB_COPY_WITH_OBJECT, false, '', !$phase ? " checked='checked'" : "");
    $html .= "</fieldset></div>";
    if (!$res_dest_sub) {
        $html .= "<script type='text/javascript'> nc_copy_query(1); </script>";
    }
    $html .= $nc_core->token->get_input();
    $html .= " </form>";
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => TOOLS_COPYSUB_COPY, "action" => "mainView.submitIframeForm()");
    return $html;
}
예제 #2
0
function CrontasksList()
{
    global $db, $UI_CONFIG, $ADMIN_TEMPLATE, $nc_core;
    $Result = $db->get_results("SELECT * FROM `CronTasks` ORDER BY `Cron_ID` ", ARRAY_A);
    if ($db->is_error) {
        throw new nc_Exception_DB_Error($db->last_query, $db->last_error);
    }
    if ($countClassif = $db->num_rows) {
        echo "\n    <form method='post' action='crontasks.php'>\n\n    <table class='nc-table nc--striped' width=100%>\n      <tr>\n        <th width='3%'>ID</th>\n        <th width='14%' class='align-center'>" . TOOLS_CRON_MINUTES . "</th>\n        <th width='16%'>" . TOOLS_CRON_LANCHED . "</th>\n        <th width='45%'>" . TOOLS_CRON_SCRIPTURL . "</th>\n        <th class='nc-text-center'>" . TOOLS_CRON_CHANGE . "</th>\n        <th class='nc-text-center'><i class='nc-icon nc--remove' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DELETE . "'></i></th>\n      </tr>";
        foreach ($Result as $Array) {
            print "<tr>";
            print "<td >" . $Array['Cron_ID'] . "</td>\n";
            print "<td class='nc-text-center'>{$Array['Cron_Minutes']}:{$Array['Cron_Hours']}:{$Array['Cron_Days']}</a></td>";
            if ($Array['Cron_Launch']) {
                print "<td>" . date("H:i d.m.Y", $Array['Cron_Launch']) . "</td>";
            } else {
                print "<td>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_NO . "</td>";
            }
            print "<td><a href='" . $Array['Cron_Script_URL'] . "' target=_blank>" . $Array['Cron_Script_URL'] . "</a></font></td>";
            print "<td class='nc-text-center'><a href=crontasks.php?phase=4&CronID=" . $Array['Cron_ID'] . "><div class='icons icon_settings' title='" . TOOLS_REDIRECT_CHANGEINFO . "'></div></a></td>";
            print "<td class='nc-text-center'>" . nc_admin_checkbox_simple("Delete" . $Array['Cron_ID'], $Array['Cron_ID']) . "</td>";
            print "</tr>";
        }
        echo "</table></td></tr></table><br/>";
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => NETCAT_ADMIN_DELETE_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "right", "red_border" => true);
    } else {
        nc_print_status(TOOLS_CRON_NOTASKS, 'info');
    }
    $UI_CONFIG->actionButtons[] = array("id" => "add", "caption" => TOOLS_CRON_ADDLINK, "location" => "cron.add", "align" => "left");
    if ($countClassif) {
        echo "<input type='hidden' name='phase' value='3'>";
        echo "<input type='submit' class='hidden'>";
        echo $nc_core->token->get_input();
        echo "</form>";
    }
}
예제 #3
0
파일: dump.inc.php 프로젝트: Blu2z/implsk
function ShowBackUps()
{
    global $db_path, $ADMIN_PATH, $ADMIN_TEMPLATE, $DUMP_FOLDER, $UI_CONFIG;
    $dir_read = dir($DUMP_FOLDER);
    $dir_count = dir($DUMP_FOLDER);
    $total = 0;
    $read = 0;
    while (($entry = $dir_count->read()) !== false) {
        $total++;
    }
    $total -= 2;
    $dir_count->close();
    while (($entry = $dir_read->read()) !== false) {
        $entry_str = substr($entry, -4);
        if ($entry != "." && $entry != ".." && ($entry_str == ".tgz" || $entry_str == ".rar")) {
            if ($total - 1 > $read) {
                $read++;
            }
            $countDumps = 1;
            $filename = $entry;
            //substr($entry, 0, strlen($entry) - 20);
            $filesize = filesize($DUMP_FOLDER . $entry);
            $filetime = filemtime($DUMP_FOLDER . $entry);
            $table = "";
            $table .= "<tr>";
            $table .= "<td><font size='-1'><b><a href='" . $ADMIN_PATH . "dump.php?phase=3&file=" . $entry . "'>" . $filename . "</a></b></td>\r\n";
            $table .= "<td><font size='-1'>" . date("Y-m-d H:i:s", $filetime) . "</td>";
            $table .= "<td><font size='-1'>" . nc_bytes2size($filesize) . "</td>";
            $table .= "<td align='center'>" . nc_admin_checkbox_simple('del[]', $entry) . "</td>";
            $table .= "</tr>";
            $table_arr[$filetime] = $table;
        }
    }
    $dir_read->close();
    if ($countDumps != 1) {
        nc_print_status(TOOLS_DUMP_NOONE, "info");
    } else {
        ?>
        <form id='backups_form' method='post'>
        <fieldset>
	<legend><?php 
        echo TOOLS_DUMP_BACKUPLIST_HEADER;
        ?>
</legend>
            <table border='0' cellpadding='0' cellspacing='0' width='100%'>
                <tr>
                    <td >
                        <table  class='admin_table' width='100%'>
                            <tr>
                                <th width='45%'><?php 
        echo TOOLS_DUMP_INC_ARCHIVE;
        ?>
</th>
                                <th width='25%'><?php 
        echo TOOLS_DUMP_DATE;
        ?>
</th>
                                <th width='20%'><?php 
        echo TOOLS_DUMP_SIZE;
        ?>
</th>
                                <td class='align-center'><div class='icons icon_delete' title='<?php 
        echo CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DELETE;
        ?>
'></div></td>
                            </tr>
        <?php 
        if (is_array($table_arr) && !empty($table_arr)) {
            ksort($table_arr);
            echo join("", $table_arr);
        }
        ?>
                        </table>
                    </td>
                </tr>
            </table>
            <br>
            <?php 
    }
    if ($countDumps) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => TOOLS_DUMP_REMOVE_SELECTED, "action" => "mainView.submitIframeForm('backups_form')", "align" => "right", "red_border" => true);
        ?>
            <input type='hidden' name='phase' value='2'>
            <input type='submit' class='hidden'>
        </fieldset>
        </form>
        <?php 
    }
}
예제 #4
0
function nc_trash_prerecovery($trash_ids)
{
    global $UI_CONFIG;
    $nc_core = nc_Core::get_object();
    if (!is_array($trash_ids)) {
        $trash_ids = array($trash_ids);
    }
    $trash_ids = array_map('intval', $trash_ids);
    $trash_data = $nc_core->db->get_results("\n  SELECT `t`.`Sub_Class_ID`, `t`.`Class_ID` , `t`.`Subdivision_ID`, t.`XML_Filename`,\n                  `sub`.`Subdivision_Name`, `cc`.`Sub_Class_Name`\n  FROM `Trash_Data` as `t`\n  LEFT JOIN `Sub_Class` as `cc` ON `t`.`Sub_Class_ID` = `cc`.`Sub_Class_ID`\n  LEFT JOIN `Subdivision` as `sub` ON `sub`.`Subdivision_ID` =  `t`.`Subdivision_ID`\n  WHERE t.Trash_ID IN (" . join(',', $trash_ids) . ")\n  AND `sub`.`Subdivision_ID` IS NULL\n  GROUP BY `t`.`Subdivision_ID`", ARRAY_A);
    if (!$trash_data) {
        return false;
    }
    $t = nc_trash_load_sub_cc($trash_data);
    $subdivisions = $t['subs'];
    $sub_classes = $t['ccs'];
    $cc_sub = $t['cc_sub'];
    unset($t);
    foreach ($subdivisions as $sub_id => $row) {
        $f = 1;
        foreach ($trash_data as $v) {
            if ($v['Subdivision_ID'] == $sub_id) {
                $f = 0;
            }
        }
        if ($f) {
            unset($subdivisions[$sub_id]);
        }
    }
    if (!count($subdivisions)) {
        return false;
    }
    echo NETCAT_TRASH_PRERECOVERYSUB_INFO;
    echo "<form action='index.php' method='post' >";
    foreach ($subdivisions as $sub_id => $row) {
        // узнаем номер сайта
        $catalogue = intval($row['catalogue']);
        try {
            $nc_core->catalogue->get_by_id($catalogue);
        } catch (Exception $e) {
            $catalogue = $nc_core->db->get_var("SELECT `Catalogue_ID` FROM `Catalogue` ORDER BY Checked, Priority LIMIT 1");
        }
        echo "<input type='hidden' name='sub_catalogue[" . $sub_id . "]' value='" . $catalogue . "' />";
        $subs = $nc_core->db->get_results("SELECT `Subdivision_ID` AS value,\n                                    CONCAT(Subdivision_ID, '. ', Subdivision_Name) AS description,\n                                    `Parent_Sub_ID` AS parent\n                                    FROM `Subdivision`\n                                    WHERE `Catalogue_ID` = '" . $catalogue . "'\n                                    ORDER BY `Subdivision_ID`", ARRAY_A);
        echo "<table border='0' cellpadding='6' cellspacing='0' width='100%'>\n           <tr><td>" . nc_admin_checkbox_simple("sub_checked[" . $sub_id . "]", 1, NETCAT_TRASH_PRERECOVERYSUB_CHECKED, '', $row['checked'] ? " checked='checked'" : "") . "\n           </td></tr>\n           <tr><td>\n             <font color='gray'>" . NETCAT_TRASH_PRERECOVERYSUB_NAME . ":</font><br/>" . nc_admin_input_simple("sub_name[" . $sub_id . "]", $row['name'], 50, '', "maxlength='255'") . "\n           </td></tr>\n           <tr><td>\n             <font color='gray'>" . NETCAT_TRASH_PRERECOVERYSUB_KEYWORD . ":</font><br/>" . nc_admin_input_simple("sub_keyword[" . $sub_id . "]", $row['keyword'], 50, '', "maxlength='255'") . "\n           </td></tr>\n           <tr><td>\n           <font color='gray'>" . NETCAT_TRASH_PRERECOVERYSUB_PARENT . ":</font><br/>\n           <select name='sub_parent[" . $sub_id . "]' ><option value='0'>" . NETCAT_TRASH_PRERECOVERYSUB_ROOT . "</option>" . nc_select_options($subs, $row['parent']) . "</select>\n           </td></tr>\n         </table><br/>";
    }
    foreach ($trash_ids as $id) {
        echo "<input type='hidden' name='trash_ids[]' value='" . $id . "' />\r\n";
    }
    echo "<input type='hidden' name='phase' value='21' />";
    echo "</form>";
    $UI_CONFIG->actionButtons[] = array("id" => "next", "caption" => NETCAT_TRASH_PRERECOVERYSUB_NEXT, "action" => "mainView.submitIframeForm()");
    return true;
}
예제 #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;
}
예제 #6
0
파일: wizard.inc.php 프로젝트: Blu2z/implsk
function nc_class_wizard_class_form($class_id, $class_type)
{
    global $db, $UI_CONFIG, $ADMIN_PATH;
    global $EnglishName, $SubClassName, $Checked, $SubdivisionID, $CatalogueID;
    echo "<form method='post' action='wizard_class.php'>\n";
    echo "<fieldset>\n";
    echo "<legend>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MAININFO . "</legend>\n";
    printf(CONTROL_CONTENT_SUBCLASS_CLASSNAME, $CatalogueID ? CONTROL_CONTENT_SUBCLASS_ONSITE : CONTROL_CONTENT_SUBCLASS_ONSECTION);
    echo ":<br>" . nc_admin_input_simple('SubClassName', $class_name ? $class_name : $SubClassName, 50, '', "id='SubClassName' maxlength='255'") . "<br><br>\n";
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_KEYWORD . ":<br>" . nc_admin_input_simple('EnglishName', $EnglishName, 50, '', "id='EnglishName' maxlength='255") . "<br><br>\n";
    echo WIZARD_CLASS_FORM_SUBDIVISION_PARENTSUB . ":<br>\n";
    echo nc_admin_input_simple('SubdivisionID', $SubdivisionID, 0, '', "id='SelectedSub' readonly");
    echo "&nbsp;&nbsp;&nbsp;<a href='#' onclick=\"window.open('" . $ADMIN_PATH . "wizard/select_subdivision.php', 'nc_popup_map', 'width=350,height=500,menubar=no,resizable=no,scrollbars=no,toolbar=no,resizable=yes'); return false;\">" . WIZARD_CLASS_FORM_SUBDIVISION_SELECT_SUBDIVISION . "</a><br><br>\n";
    //  echo "&nbsp;&nbsp;&nbsp;<a href='#' onclick=\"document.getElementById('SelectedSub').value='';document.getElementById('SelectedCat').value='';return false;\">".WIZARD_CLASS_FORM_SUBDIVISION_DELETE."</a><br><br>\n";
    echo nc_admin_checkbox_simple('Checked', 1, CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_TURNON, false, 'turnon', isset($Checked) ? $Checked ? " checked" : "" : " checked") . "<br><br>\n";
    switch ($class_type) {
        case 1:
            $default_action = 'index';
            break;
        case 2:
            $default_action = 'index';
            break;
        case 3:
            $default_action = 'search';
            break;
        case 4:
            $default_action = 'add';
            break;
    }
    echo "<input type='hidden' name='DefaultAction' value='" . $default_action . "' />\n";
    echo "<input type='hidden' name='ReadAccessID' value='0' />\n";
    echo "<input type='hidden' name='WriteAccessID' value='0' />\n";
    echo "<input type='hidden' name='EditAccessID' value='0' />\n";
    echo "<input type='hidden' name='SubscribeAccessID' value='0' />\n";
    echo "<input type='hidden' name='ModerationID' value='0' />\n";
    echo "<input type='hidden' name='AllowTags' value='-1' />\n";
    echo "<input type='hidden' name='NL2BR' value='-1' />\n";
    echo "<input type='hidden' name='UseCaptcha' value='-1' />\n";
    echo "<input type='hidden' name='RecordsPerPage' value='' />\n";
    echo "<input type='hidden' name='SortBy' value='' />\n";
    echo "<input type='hidden' name='ClassID' value='" . $class_id . " /'>\n";
    echo "<input type='hidden' name='phase' value='9' />\n";
    echo "<input type='hidden' name='SubClassID' value='0' />\n";
    echo "<input id='SelectedCat' type='hidden' name='CatalogueID' value='" . $CatalogueID . "' />\n";
    echo "<input type='submit' class='hidden' />";
    echo "</form>\n";
    $UI_CONFIG->actionButtons = array(array("id" => "submit", "caption" => STRUCTURE_TAB_SUBCLASS_ADD, "action" => "mainView.submitIframeForm()"));
}
예제 #7
0
/**
 * Вывод формы авторизации пользователя
 */
function LoginForm()
{
    global $REQUEST_URI, $AUTH_USER, $ADMIN_LANGUAGE, $ADMIN_TEMPLATE, $AUTH_PW;
    global $posting, $USER_LANG, $ADMIN_AUTHTYPE, $AUTHORIZATION_TYPE;
    global $SUB_FOLDER, $HTTP_ROOT_PATH;
    global $nc_core;
    if ($_REQUEST['AUTH_USER'] || $_REQUEST['AUTH_PW']) {
        $textinfo = CONTROL_AUTH_LOGIN_OR_PASSWORD_INCORRECT;
    }
    $m_auth = $nc_core->modules->get_by_keyword('auth');
    // есть модуль ЛК
    $need_captcha = 0;
    // нужна ли каптча
    $login_en = 1;
    // доступна авторизация по логину
    $token_en = 0;
    // доступна авторизация по токену
    if ($m_auth) {
        $nc_auth = nc_auth::get_object();
        $login_en = $nc_core->get_settings('authtype_admin', 'auth') & NC_AUTHTYPE_LOGIN;
        $token_en = $nc_auth->token_enabled();
        $nc_auth_token = new nc_auth_token();
        $nc_token_rand = $nc_auth_token->get_random_256();
        $_SESSION['nc_token_rand'] = $nc_token_rand;
        $need_captcha = $nc_auth->need_captcha();
        if ($nc_auth->is_invalid_captcha()) {
            $textinfo = NETCAT_MODULE_CAPTCHA_WRONG_CODE_SMALL;
        }
    }
    $lang = Language_Show();
    $sellang = $_COOKIE['PHP_AUTH_LANG'] ? $_COOKIE['PHP_AUTH_LANG'] : $ADMIN_LANGUAGE;
    // селект с языком
    $lang_select = "<div class='nc-select nc--blocked'><select name='NEW_AUTH_LANG'>";
    foreach ($lang as $val) {
        $lang_select .= "<option value='" . $val . "'" . ($val == $sellang ? " selected" : "") . ">" . $val . "</option>\n";
    }
    $lang_select .= "  </select><i class='nc-caret'></i></div>";
    // сохранить логин пароль
    $loginsave = '';
    if ($ADMIN_AUTHTYPE == 'manual' && $AUTHORIZATION_TYPE == 'cookie') {
        $loginsave = nc_admin_checkbox_simple('loginsave', '', CONTROL_AUTH_HTML_SAVELOGIN);
    }
    ?>
    <noscript><div style="font-weight: bold;"><?php 
    echo CONTROL_AUTH_JS_REQUIRED;
    ?>
</div></noscript>

<?php 
    if ($m_auth) {
        ?>
    <script type='text/javascript' src='<?php 
        echo $SUB_FOLDER . $HTTP_ROOT_PATH . 'modules/auth/auth.js';
        ?>
'></script>
<?php 
    }
    ?>

<script type='text/javascript'>
    function authCheckFields () {
        var authForm = document.getElementById('AUTH_FORM');
        var login = document.getElementsByName('AUTH_USER');
        var pass = document.getElementsByName('AUTH_PW');

        switch (true) {
            case (login.value == '' && pass.value == ''):
                alert('<?php 
    echo CONTROL_AUTH_FIELDS_NOT_EMPTY;
    ?>
');
                return false;
                break;
            case (login.value == ''):
                alert('<?php 
    echo CONTROL_AUTH_LOGIN_NOT_EMPTY;
    ?>
');
                return false;
                break;
            default:
            	return true;
                //authForm.submit();
            }
        }
        $nc(function() {
			$nc('#AUTH_FORM').submit( function() {
				var login = $nc("input[name = 'AUTH_USER']").val();
				var pass = $nc("input[name = 'AUTH_PW']").val();
				if (!login  && !pass) {
					alert('<?php 
    echo CONTROL_AUTH_FIELDS_NOT_EMPTY;
    ?>
');
					return false;
				}
				if (!login) {
					alert('<?php 
    echo CONTROL_AUTH_LOGIN_NOT_EMPTY;
    ?>
');
					return false;
				}
				return true;
			});

			function place_footer() {
				var footer = $nc('.bottom_line');

				var form  = $nc('.content');
				var body_height = $nc(document.body).height();

				var form_bottom = form.offset().top + form.height();

				footer.css({top:null, bottom:null});

				if (form_bottom + footer.height() > body_height) {
					footer.css({top:form_bottom+'px'});
				} else {
					footer.css({bottom:'0px'});
				}
			}

			$nc(window).resize(place_footer);

			place_footer();

            $nc('INPUT[name=AUTH_USER]').focus();
        });
</script>
<form action='<?php 
    echo $REQUEST_URI;
    ?>
' method='post' name='AUTH_FORM' id='AUTH_FORM'>
    <input type='hidden' name='AuthPhase' value='1'>

    <table border='0' cellpadding='4' cellspacing='0' id="classical" style="display:none; margin:0 auto">
        <tr>
            <td></td>
            <td class="nc-text-red"><?php 
    echo $textinfo;
    ?>
</td>
        </tr>
        <tr>
            <td><label><?php 
    echo CONTROL_AUTH_HTML_LOGIN;
    ?>
</label></td>
            <td><?php 
    echo nc_admin_input_simple('AUTH_USER', stripcslashes($AUTH_USER), 32, "", "id='AUTH_USER' class='nc--blocked' maxlength='255'");
    ?>
</td>
        </tr>
        <tr>
            <td><label><?php 
    echo CONTROL_AUTH_HTML_PASSWORD;
    ?>
</label></td>
            <td><?php 
    echo nc_admin_input_password('AUTH_PW', stripcslashes($AUTH_PW), 32, "", "class='nc--blocked' maxlength='255'");
    ?>
</td>
        </tr>
        <tr>
            <td><label><?php 
    echo CONTROL_AUTH_HTML_LANG;
    ?>
</label></td>
            <td><?php 
    echo $lang_select;
    ?>
</td>
        </tr>
<?php 
    if ($need_captcha) {
        ?>
            <tr>
                <td></td>
                <td class="captcha"><?php 
        echo nc_captcha_formfield();
        ?>
</td>
            </tr>
            <tr>
                <td><?php 
        echo NETCAT_MODERATION_CAPTCHA_SMALL;
        ?>
</td>
                        <td><?php 
        echo nc_admin_input_simple('nc_captcha_code', '', 32, "maxlength='255'");
        ?>
</td>
                    </tr>
<?php 
    }
    ?>
                    <tr>
                        <td rowspan='2'><?php 
    echo $icon;
    ?>
</td>
                        <td><?php 
    echo $loginsave;
    ?>
</td>
                    </tr>
                    <tr>
                        <td>
                            <button type='submit' class="nc-btn nc--blue"><?php 
    echo CONTROL_AUTH_HTML_AUTH;
    ?>
</button>
                            <span id='menu'></span>
<?php 
    if ($posting && $REQUEST_URI != $REQUESTED_FROM) {
        echo "<br/><a href='" . $REQUESTED_FROM . "' class='relogin'>" . CONTROL_AUTH_HTML_BACK . "</a>";
    }
    ?>
                </td>
            </tr>
        </table>

        <!-- форма авторизация по токену -->
<?php 
    /*$token_en=1;*/
    if ($token_en) {
        ?>
            <table border='0' cellpadding='4' cellspacing='0' id="token" style="display:none; margin:0 auto">
                <tr>
                    <td colspan="2">
                        <div id='tokeninfo' class="nc-alert nc--red"></div>
                    </td>
                </tr>
                <tr><td colspan="2">
                            <div id='nc_token_plugin_wrapper'></div>
                            <script>
                                $nc("#nc_token_plugin_wrapper").append("<object id='nc_token_plugin' type='application/x-rutoken' width='0' height='0'></object>");
                            </script>
                        <input type='hidden' value='' id='nc_token_signature'  name='nc_token_signature'/>
                    </td></tr>
                <tr>
                    <td><label><?php 
        echo CONTROL_AUTH_HTML_LOGIN;
        ?>
</label></td>
                                <td><div class='nc-select nc--blocked'><select  name='nc_token_login' id='nc_token_login'></select><i class='nc-caret'></i></div></td>
                            </tr>
                            <tr>
                                <td><label><?php 
        echo CONTROL_AUTH_HTML_LANG;
        ?>
</label></td>
                                <td><?php 
        echo $lang_select;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td colspan="2">
                                    <button onclick='nc_token_sign(); return false;' type='submit' class="nc-btn nc--blue"><?php 
        echo CONTROL_AUTH_HTML_AUTH;
        ?>
</button>
                                </td>
                            </tr>
                        </table>
<?php 
    }
    ?>
                    </form>

                    <script type='text/javascript'>
                            var authForm = document.getElementById('AUTH_FORM');
                            // перенаправлять туда, куда пользователь хотел зайти
                            authForm.action += window.location.hash;

                            function show_token () {
<?php 
    if ($login_en && $token_en) {
        ?>
                                  $nc("#menu").html("<a href='#' class='nc-btn nc--small' onclick='show_classical(); return false;'><?php 
        echo NETCAT_AUTH_TYPE_LOGINPASSWORD;
        ?>
</a>");
<?php 
    }
    ?>

                                  $nc("#classical").hide();
                                  $nc("#token").show();
                                  $nc("#classical :input").attr('disabled', true);
                                  $nc("#token :input").removeAttr('disabled');
                                  $nc('#tokeninfo').hide();
                                  if ( !nc_token_obj.load() ) {
                                      $nc('#tokeninfo').html("<?php 
    echo CONTROL_AUTH_USB_TOKEN_NOT_INSERTED;
    ?>
");
                                      $nc('#tokeninfo').show();
                                  }
                              }

                              function show_classical () {
<?php 
    if ($login_en && $token_en) {
        ?>
                                      $nc("#menu").html("<button type='button' class='nc-btn nc--right nc--small' onclick='show_token()' ><?php 
        echo NETCAT_AUTH_TYPE_TOKEN;
        ?>
</button>");
<?php 
    }
    ?>

                                      $nc("#classical").show();
                                      $nc("#token").hide();
                                      $nc("#classical :input").removeAttr('disabled');
                                      $nc("#token :input").attr('disabled', true);
                                  }

<?php 
    if ($m_auth) {
        echo "nc_token_obj = new nc_auth_token ( {'randnum' : '" . $nc_token_rand . "'}); ";
    }
    ?>

                                function nc_token_sign ( ) {
                                    $nc('#tokeninfot').hide();
                                    err_text = { 1: "<?php 
    echo CONTROL_AUTH_TOKEN_PLUGIN_DONT_INSTALL;
    ?>
", 2: "<?php 
    echo CONTROL_AUTH_USB_TOKEN_NOT_INSERTED;
    ?>
",
                                        3: "<?php 
    echo CONTROL_AUTH_PIN_INCORRECT;
    ?>
", 4: "<?php 
    echo CONTROL_AUTH_KEYPAIR_INCORRECT;
    ?>
"};

                                    if ( (err_num = nc_token_obj.sign()) ) {
                                        $nc('#tokeninfo').html(err_text[err_num]);
                                        $nc('#tokeninfo').show();
                                    }
                                }
<?php 
    echo $login_en ? "show_classical();" : "show_token();";
    ?>

                            </script>
<?php 
}
예제 #8
0
파일: admin.inc.php 프로젝트: Blu2z/implsk
/**
 * Функция выводит список пользовательских настроек
 *
 * @param int номер компонента
 * @param int номер макета дизайн
 * @param array массив с настройками
 * @return int
 */
function nc_customsettings_show($ClassID = 0, $TemplateID = 0, $custom_settings = array(), $Class_Template = 0)
{
    global $UI_CONFIG;
    $suffix = +$_REQUEST['fs'] ? '_fs' : '';
    if (!$ClassID && !$TemplateID) {
        return false;
    }
    if ($ClassID && !$Class_Template) {
        $ac = "urlDispatcher.load('dataclass{$suffix}.custom.new(" . $ClassID . ")')";
        $ac1 = "urlDispatcher.load('dataclass{$suffix}.custom.manual(" . $ClassID . ")')";
    } else {
        if ($ClassID && $Class_Template) {
            $ac = "urlDispatcher.load('classtemplate{$suffix}.custom.new(" . $ClassID . ")')";
            $ac1 = "urlDispatcher.load('classtemplate{$suffix}.custom.manual(" . $ClassID . ")')";
        } else {
            $ac = "urlDispatcher.load('template{$suffix}.custom.new(" . $TemplateID . ")')";
            $ac1 = "urlDispatcher.load('template{$suffix}.custom.manual(" . $TemplateID . ")')";
        }
    }
    $UI_CONFIG->actionButtons[] = array("id" => "addcs", "caption" => CONTROL_FIELD_LIST_ADD, "action" => $ac, 'align' => 'left');
    $UI_CONFIG->actionButtons[] = array("id" => "del", "caption" => NETCAT_CUSTOM_ONCE_MANUAL_EDIT, "action" => $ac1, 'align' => 'left');
    if (empty($custom_settings)) {
        nc_print_status(NETCAT_CUSTOM_NONE_SETTINGS, 'info');
        return false;
    }
    $a2f = new nc_a2f($custom_settings, '');
    $header = " <table class='nc-table nc--striped nc--small nc--hovered' style='width:100%'>\n            <tr>\n              <th width='30%'>" . NETCAT_CUSTOM_ONCE_FIELD_NAME . "</th>\n              <th width='45%'>" . NETCAT_CUSTOM_ONCE_FIELD_DESC . "</th>\n              <th  width='20%'>" . NETCAT_CUSTOM_TYPE . "</th>\n              <td align=center width='5%'>\n                " . nc_admin_img('delete', NETCAT_CUSTOM_ONCE_DROP) . "\n              </td>\n            </tr>";
    echo "<form action='index.php' method='post' >";
    echo "<input type='hidden' name='phase' value='" . ($ClassID ? $Class_Template ? "2410" : "241" : "81") . "' />";
    echo "<input type='hidden' name='ClassID' value='" . $ClassID . "' />";
    echo "<input type='hidden' name='TemplateID' value='" . $TemplateID . "' />";
    echo "<input type='hidden' name='fs' value='" . +$_REQUEST['fs'] . "' />";
    echo $a2f->render_settings($header, '<tr style="background-color: #FFF;"><td><a href="index.php?phase=' . ($ClassID ? $Class_Template ? 250 : 25 : 9) . '&amp;' . ($ClassID ? "ClassID=" . $ClassID : "TemplateID=" . $TemplateID) . '&amp;param=%NAME&fs=' . +$_REQUEST['fs'] . '">%NAME</a></td><td>%CAPTION</td><td>%TYPENAME</td><td align="center">' . nc_admin_checkbox_simple("kill[]", "%NAME") . '</td></tr>', '</table>');
    $custom_settings = $a2f->eval_value($custom_settings);
    $UI_CONFIG->actionButtons[] = array("id" => "del", "caption" => NETCAT_CUSTOM_ONCE_DROP_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "right", "red_border" => true);
    echo "</form>";
    return false;
}
예제 #9
0
function SettingsForm()
{
    global $nc_core;
    global $db, $ADMIN_PATH;
    $Array = $nc_core->get_settings(null, null, true, 0);
    ?>

    <form method='post' action='settings.php' style='overflow:hidden' class="nc-form">
        <fieldset>
            <legend><?php 
    echo CONTROL_SETTINGSFILE_BASIC_MAIN;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo CONTROL_SETTINGSFILE_BASIC_MAIN_NAME;
    ?>
:<br>
                        <?php 
    echo nc_admin_input_simple('ProjectName', $Array["ProjectName"], 70, '', "maxlength='255'");
    ?>
<br>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    $tpl = $db->get_results("SELECT `Template_ID` as value,\n      CONCAT(`Template_ID`, ': ', `Description`) as description,\n      `Parent_Template_ID` as parent\n      FROM `Template`\n      ORDER BY `Priority`, `Template_ID`", ARRAY_A);
    if (!empty($tpl)) {
        ?>
                            <?php 
        echo CONTROL_SETTINGSFILE_BASIC_EDIT_TEMPLATE;
        ?>
:<br>
                            <select name="EditDesignTemplateID">
                                <option value="0"><?php 
        echo CONTROL_SETTINGSFILE_BASIC_EDIT_TEMPLATE_DEFAULT;
        ?>
</option>
                                <option></option>
                                <?php 
        echo nc_select_options($tpl, $Array["EditDesignTemplateID"]);
        ?>
                            </select>
                            <?php 
    } else {
        echo CONTROL_TEMPLATE_NONE;
    }
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>
        <fieldset>
            <legend><?php 
    echo CONTROL_SETTINGSFILE_BASIC_EMAILS;
    ?>
</legend>
            <table border=0 cellpadding=6 cellspacing=0 width=100%><tr><td>
                        <?php 
    echo CONTROL_SETTINGSFILE_CHANGE_EMAILS_FIELD;
    ?>
:<br>
                        <?php 
    $systable = $db->get_var("SELECT System_Table_ID FROM System_Table WHERE System_Table_Name='User'");
    $res = $db->get_results("SELECT Field_Name,Description FROM Field WHERE System_Table_ID='" . $systable . "' AND Format LIKE 'email%' ORDER BY Priority", ARRAY_N);
    if ($count = $db->num_rows) {
        if ($count == 1) {
            list($field_id, $field_name) = $res[0];
            echo "" . $field_name . "<input type=hidden name=UserEmailField value=" . $field_id . ">";
        } else {
            echo "<select name=UserEmailField>";
            foreach ($res as $field) {
                list($field_id, $field_name) = $field;
                echo "<option " . ($field_id == $Array["UserEmailField"] ? "selected" : "") . " value=" . $field_id . ">" . $field_id . ": " . $field_name;
            }
            echo "</select>";
        }
    } else {
        ?>
                            <b><?php 
        echo CONTROL_SETTINGSFILE_CHANGE_EMAILS_NONE;
        ?>
</b> (<a href=<?php 
        echo "" . $ADMIN_PATH . "field/index.php?fs=1&isSys=1&SystemTableID=" . $systable;
        ?>
><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_ADD;
        ?>
</a>)
                        <?php 
    }
    ?>
</td></tr><tr><td>
                        <?php 
    echo CONTROL_SETTINGSFILE_BASIC_EMAILS_FROMNAME;
    ?>
:<br>
                        <?php 
    echo nc_admin_input_simple('SpamFromName', $Array["SpamFromName"], 70, '', "maxlength='255'");
    ?>
                    </td></tr><tr><td>
                        <?php 
    echo CONTROL_SETTINGSFILE_BASIC_EMAILS_FROMEMAIL;
    ?>
:<br>
    <?php 
    echo nc_admin_input_simple('SpamFromEmail', $Array["SpamFromEmail"], 70, '', "maxlength='255'");
    ?>
                    </td></tr></table>
        </fieldset>

        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_EDITOR;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td colspan='2'>
						<?php 
    $kc_block = "<select name='SaveKeycode'>";
    $kc = $Array['SaveKeycode'] ? $Array['SaveKeycode'] : 83;
    for ($i = 65; $i <= 90; $i++) {
        $kc_block .= "<option value='" . $i . "'" . ($i == $kc ? ' selected' : '') . ">" . chr($i) . "</option>";
    }
    $kc_block .= "</select>";
    ?>
						<?php 
    echo sprintf(NETCAT_SETTINGS_EDITOR_KEYCODE, $kc_block);
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>

        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_CODEMIRROR;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td colspan="2">
                        <?php 
    echo nc_admin_checkbox_simple('CMEmbeded', 1, "" . NETCAT_SETTINGS_CODEMIRROR_EMBEDED . "", $Array['CMEmbeded']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <?php 
    echo nc_admin_checkbox_simple('CMDefault', 1, "" . NETCAT_SETTINGS_CODEMIRROR_DEFAULT . "", $Array['CMDefault'], '', $Array['CMEmbeded'] != 1 ? ' disabled' : '');
    ?>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <?php 
    echo nc_admin_checkbox_simple('CMAutocomplete', 1, "" . NETCAT_SETTINGS_CODEMIRROR_AUTOCOMPLETE . "", $Array['CMAutocomplete'], '', $Array['CMEmbeded'] != 1 ? ' disabled' : '');
    ?>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <?php 
    echo nc_admin_checkbox_simple('CMHelp', 1, "" . NETCAT_SETTINGS_CODEMIRROR_HELP . "", $Array['CMHelp'], '', $Array['CMEmbeded'] != 1 ? ' disabled' : '');
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>
        <script type='text/javascript'>$nc('#CMEmbeded').change(function () {
            var chk = $nc(this).attr('checked');
            $nc('input[name^=\"CM\"]').each(function (i, e) { if($nc(e).attr('id') != 'CMEmbeded') { if(chk) $nc(e).removeAttr('disabled').removeAttr('checked'); else $nc(e).attr('disabled', true); }});
        })</script>

		<fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_JS;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo NETCAT_SETTINGS_JS_FUNC_NC_JS;
    ?>
:
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('JSLoadjQueryDollar', 1, NETCAT_SETTINGS_JS_LOAD_JQUERY_DOLLAR, $Array['JSLoadjQueryDollar']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('JSLoadjQueryExtensionsAlways', 1, NETCAT_SETTINGS_JS_LOAD_JQUERY_EXTENSIONS_ALWAYS, $Array['JSLoadjQueryExtensionsAlways']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('JSLoadModulesScripts', 1, NETCAT_SETTINGS_JS_LOAD_MODULES_SCRIPTS, $Array['JSLoadModulesScripts']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('MinifyStaticFiles', 1, NETCAT_SETTINGS_MINIFY_STATIC_FILES, $Array['MinifyStaticFiles']);
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>

        <!-- Корзина-->
        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_TRASHBIN;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('TrashUse', 1, "" . NETCAT_SETTINGS_TRASHBIN_USE . "", $Array['TrashUse']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo NETCAT_SETTINGS_TRASHBIN_MAXSIZE;
    ?>
 (<?php 
    echo NETCAT_SIZE_MBYTES;
    ?>
):<br>
                        <?php 
    echo nc_admin_input_simple('TrashLimit', $Array["TrashLimit"], 70, '', "maxlength='255'");
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>

        <!-- Компоненты -->
        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_COMPONENTS;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('RemindSave', 1, "" . NETCAT_SETTINGS_REMIND_SAVE . "", $Array['RemindSave']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('PacketOperations', 1, "" . NETCAT_SETTINGS_PACKET_OPERATIONS . "", $Array['PacketOperations']);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('TextareaResize', 1, "" . NETCAT_SETTINGS_TEXTAREA_RESIZE . "", $Array['TextareaResize']);
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>

        <!-- NetCat QuickBar -->
        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_QUICKBAR;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('QuickBar', 1, "" . NETCAT_SETTINGS_QUICKBAR_ENABLE . "", $Array['QuickBar']);
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>

        <!-- FirePHP -->
        <!--
        <fieldset>
          <legend><?php 
    echo NETCAT_SETTINGS_FIREPHP;
    ?>
</legend>
      <table border='0' cellpadding='6' cellspacing='0' width='100%'>
       <tr>
        <td>
        <?php 
    echo nc_admin_checkbox_simple('FirePHP', 1, "" . NETCAT_SETTINGS_FIREPHP_ENABLE . "", $Array['FirePHP'], '', "id='FirePHP'");
    ?>
        </td>
      </tr>
      </table>
    </fieldset>
    <br>
        -->
        <!-- Syntax Highlighting -->
        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_SYNTAXEDITOR;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('SyntaxEditor', 1, "" . NETCAT_SETTINGS_SYNTAXEDITOR_ENABLE . "", $Array['SyntaxEditor'], '', "id='SyntaxEditor'");
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>
        <!-- Syntax Checking -->

        <!-- Token -->
        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_USETOKEN;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <?php 
    echo nc_admin_checkbox_simple('UseTokenAdd', 1, "" . NETCAT_SETTINGS_USETOKEN_ADD . "", $Array['UseToken'] & NC_TOKEN_ADD, '', "id='UseTokenAdd'");
    ?>
                        <br/>
                        <?php 
    echo nc_admin_checkbox_simple('UseTokenEdit', 1, "" . NETCAT_SETTINGS_USETOKEN_EDIT . "", $Array['UseToken'] & NC_TOKEN_EDIT, '', "id='UseTokenEdit'");
    ?>
                        <br/>
                        <?php 
    echo nc_admin_checkbox_simple('UseTokenDrop', 1, "" . NETCAT_SETTINGS_USETOKEN_DROP . "", $Array['UseToken'] & NC_TOKEN_DROP, '', "id='UseTokenDrop'");
    ?>
                        <br/>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>


        <fieldset>
            <legend><?php 
    echo NETCAT_SETTINGS_ALTBLOCKS;
    ?>
</legend>
            <table border='0' cellpadding='6' cellspacing='0' width='100%'>
                <tr>
                    <td>
    <?php 
    echo nc_admin_checkbox_simple('AdminButtonsType', 1, "" . NETCAT_SETTINGS_ALTBLOCKS_TEXT . "", $Array['AdminButtonsType'], '', "id='AdminButtonsType'");
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
    <?php 
    echo nc_admin_textarea("\$f_AdminButtons", "AdminButtons", $Array['AdminButtons'], 1, 0);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
    <?php 
    echo nc_admin_textarea("\$f_AdminCommon", "AdminCommon", $Array['AdminCommon'], 1, 0);
    ?>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
    echo NETCAT_SETTINGS_ALTBLOCKS_PARAMS;
    ?>
:<br>
    <?php 
    echo nc_admin_input_simple('AdminParameters', $Array["AdminParameters"], 70, '', "maxlength='255'");
    ?>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br>

        <!-- License
        <fieldset>
          <legend><?php 
    echo NETCAT_SETTINGS_LICENSE;
    ?>
</legend>
          <table border='0' cellpadding='6' cellspacing='0' width='100%'>
           <tr>
            <td>
        <?php 
    echo NETCAT_SETTINGS_LICENSE_PRODUCT;
    ?>
:<br>
    <?php 
    echo nc_admin_input_simple('ProductNumber', $Array["ProductNumber"], 70, '', "id='ProductNumber' maxlength='255'");
    ?>
            </td>
          </tr>
           <tr>
            <td>
        <?php 
    echo NETCAT_SETTINGS_LICENSE_CODE;
    ?>
:<br>
        <?php 
    echo nc_admin_input_simple('Code', $Array["Code"], 70, '', "id='ProductNumber' maxlength='255'");
    ?>
            </td>
          </tr>
          </table>
        </fieldset>
        <br>-->

        <input type=hidden name=phase value=2>
        <?php 
    echo $nc_core->token->get_input();
    ?>
        <?php 
    global $UI_CONFIG;
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "action" => "mainView.submitIframeForm()");
    ?>
        <input type='submit' class='hidden'>
    </form>
    <?php 
}
예제 #10
0
/**
 * Вывод формы добавления/редактирования панели
 *
 * @param null|int $id
 * @return bool
 */
function PanelForm($id = null)
{
    global $db, $nc_core, $UI_CONFIG;
    global $toolbars;
    $panelName = null;
    if ($id !== null) {
        $id = (int) $id;
        $sql = "SELECT `Wysiwyg_Panel_ID`, `Name`, `Toolbars` FROM `Wysiwyg_Panel` " . "WHERE `Wysiwyg_Panel_ID` = {$id}";
        $panel = $db->get_row($sql, ARRAY_A);
        if (!$panel) {
            return false;
        }
        $panelName = $panel['Name'];
        $panel['Toolbars'] = (array) @unserialize($panel['Toolbars']);
    } else {
        $panel = array('Name' => '', 'Toolbars' => array());
    }
    $post = $nc_core->input->fetch_post();
    if (isset($post['Name'])) {
        $panel['Name'] = $post['Name'];
        if (!isset($post['Toolbars'])) {
            $post['Toolbars'] = array();
            $panel['Toolbars'] = array();
        }
    }
    foreach ($toolbars as $toolbar => $title) {
        if (isset($post['Toolbars']) && isset($post['Toolbars'][$toolbar])) {
            $panel['Toolbars'][$toolbar] = true;
        }
        if (!isset($panel['Toolbars'][$toolbar])) {
            $panel['Toolbars'][$toolbar] = false;
        }
    }
    ?>
    <form action="index.php" method="post">
        <table>
            <tr>
                <td>
                    <?php 
    echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_PANEL_NAME;
    ?>
:<br>
                    <input type="text" name="Name" value="<?php 
    echo $panel['Name'];
    ?>
" size="70"/><br><br>
                </td>
            </tr>
            <tr>
                <td>
                    <?php 
    echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_TOOLBARS_SETTINGS;
    ?>
:<br>
                    <?php 
    foreach ($toolbars as $toolbar => $title) {
        ?>
                        <?php 
        echo nc_admin_checkbox_simple('Toolbars[' . $toolbar . ']', 1, $title, $panel['Toolbars'][$toolbar]);
        ?>
                        <br>
                    <?php 
    }
    ?>
                </td>
            </tr>
        </table>
        <?php 
    echo $nc_core->token->get_input();
    ?>
        <input type="hidden" name="phase" value="6"/>
        <?php 
    if ($id) {
        ?>
            <input type="hidden" name="Wysiwyg_Panel_ID" value="<?php 
        echo $id;
        ?>
"/>
        <?php 
    }
    ?>
    </form>
    <legend><?php 
    echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_PANEL_PREVIEW;
    ?>
:<br></legend>
    <?php 
    $ckeditor = new CKEditor();
    echo $ckeditor->CreatePanelPreviewHtml();
    $UI_CONFIG = new ui_config_wysiwyg($id ? $panelName : NETCAT_WYSIWYG_CKEDITOR_SETTINGS_TITLE_ADD_FORM, $id ? '#wysiwyg.ckeditor.panels.edit(' . $id . ')' : '#wysiwyg.ckeditor.panels.add', 'ckeditor-tab', 'ckeditor-panels');
    $UI_CONFIG->actionButtons = array(array("id" => "submit", "caption" => $id ? NETCAT_WYSIWYG_CKEDITOR_SETTINGS_BUTTON_EDIT_PANEL : NETCAT_WYSIWYG_CKEDITOR_SETTINGS_BUTTON_ADD_PANEL, "action" => "mainView.submitIframeForm()"), array("id" => "cancel", "caption" => NETCAT_WYSIWYG_CKEDITOR_SETTINGS_BUTTON_CANCEL, "location" => "wysiwyg.ckeditor.panels", "align" => "left"));
    return true;
}
예제 #11
0
function OneClassificatorList($ClassificatorID, $SortType, $SortDirection)
{
    global $db, $UI_CONFIG, $ADMIN_PATH, $ADMIN_TEMPLATE, $perm, $nc_core;
    global $NO_RIGHTS_MESSAGE;
    if (!+$_REQUEST['isNaked']) {
        echo '<br />';
    }
    $UI_CONFIG = new ui_config_classificator('edit', $ClassificatorID);
    $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';
    }
    $TableName = GetTableNameByID($ClassificatorID);
    $Name = GetClassificatorNameByID($ClassificatorID, true);
    $isSystem = IsSystemClassificator($ClassificatorID);
    if ($isSystem) {
        if (!$perm->isDirectAccessClassificator(NC_PERM_ACTION_VIEW, $ClassificatorID)) {
            nc_print_status($NO_RIGHTS_MESSAGE, 'error');
            EndHtml();
            exit;
        }
        $admin_cl = $perm->isDirectAccessClassificator(NC_PERM_ACTION_ADMIN, $ClassificatorID);
        $access_to_add = $perm->isDirectAccessClassificator(NC_PERM_ACTION_ADDELEMENT, $ClassificatorID);
    } else {
        $admin_cl = $perm->isAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_ADMIN, $ClassificatorID);
        $access_to_add = $perm->isAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_ADDELEMENT, $ClassificatorID);
    }
    if (!$admin_cl) {
        //Есть доступа к измененению названия списка..?
        ?>
<br /><br/>
        <table cellspacing='3' cellpadding='3'>
            <tr>
                <td><?php 
        echo CONTROL_SCLASS_TABLE_NAME;
        ?>
:</td>
                <td><?php 
        echo $TableName;
        ?>
</td>
            </tr>
            <tr>
                <td><br/></td>
                <td></td>
            </tr>
            <tr>
                <td><?php 
        echo CONTROL_SCLASS_LISTING_NAME;
        ?>
:
                </td>
                <td><?php 
        echo $Name;
        ?>
</td>
            </tr>
        </table>
        <br>

    <?php 
    } else {
        ?>
        <div id='nc_admin_mode_content'>
        <form method='post' action='classificator.php'>
        <?php 
        echo CONTROL_SCLASS_TABLE_NAME;
        ?>
: <?php 
        echo $TableName;
        ?>
<br><br>
        <table cellspacing=0 cellpadding=0>
            <tr>
                <td nowrap>
                    <?php 
        echo CONTROL_SCLASS_LISTING_NAME;
        ?>
:<br>
                    <?php 
        echo nc_admin_input_simple('ClassificatorName', $Name, 50, '', "maxlength='50'");
        ?>
                </td>
                <td width=4>&nbsp;</td>
                <td nowrap>
                    <?php 
        echo nc_admin_select_simple(CLASSIFICATORS_SORT_HEADER . ":<br>", 'SortType', array(0 => CLASSIFICATORS_SORT_TYPE_ID, 1 => CLASSIFICATORS_SORT_TYPE_NAME, 2 => CLASSIFICATORS_SORT_TYPE_PRIORITY), $SortType, "tyle='width:110px;'");
        ?>
                </td>
                <td width=4>&nbsp;</td>
                <td nowrap>
                    <?php 
        echo nc_admin_select_simple(CLASSIFICATORS_SORT_DIRECTION . ":<br>", 'SortDirection', array(0 => CLASSIFICATORS_SORT_ASCENDING, 1 => CLASSIFICATORS_SORT_DESCENDING), $SortDirection, "tyle='width:160px;'");
        ?>
                </td>
            </tr>
        </table>
        <hr size=1 color=cccccc>


    <?php 
    }
    $Sort_Order = " ORDER BY ";
    switch ($SortType) {
        case 1:
            $Sort_Order .= "{$TableName}_Name";
            break;
        case 2:
            $Sort_Order .= "{$TableName}_Priority";
            break;
        default:
            $Sort_Order .= "{$TableName}_ID";
            break;
    }
    if ($SortDirection == 1) {
        $Sort_Order .= " DESC";
    }
    $Select = "select {$TableName}_ID, {$TableName}_Name, {$TableName}_Priority, Checked from Classificator_{$TableName}";
    $Select .= $Sort_Order;
    $db->last_error = '';
    $Result = $db->get_results($Select, ARRAY_N);
    // если произошла ошибка sql, ее можно попробовать исправить
    if ($db->last_error) {
        $db->query("ALTER TABLE `Classificator_" . $TableName . "`\n         ADD `Value` text default null,\n         ADD `Checked` int(1) default 1");
        $db->last_error = '';
        // делаем запрос снова
        $Result = $db->get_results($Select, ARRAY_N);
        if ($db->last_error) {
            nc_print_status('DB query error', 'error');
            return false;
        }
    }
    if ($countClassif = $db->num_rows) {
        ?>

        <table border=0 cellpadding=0 cellspacing=0 width=100%>
            <tr>
                <td>

                    <table class='nc-table nc--striped nc--hovered nc--small' width=100%>
                        <tr>
                            <th>ID</th>
                            <th width=90%><?php 
        echo CONTENT_CLASSIFICATORS_ELEMENT;
        ?>
</th>
                            <?php 
        if ($admin_cl) {
            ?>
                                <th class='nc-text-center'>
                                    <div class='icons icon_type_bool' title='<?php 
            echo CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ON;
            ?>
'></div>
                                </th>
                                <th class='nc-text-center'>
                                    <div class='icons icon_prior' title='<?php 
            echo CLASSIFICATORS_SORT_PRIORITY_HEADER;
            ?>
'></div>
                                </th>
                                <th class='nc-text-center'>
                                    <div class='icons icon_delete' title='<?php 
            echo CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DELETE;
            ?>
'></div>
                                </th>
                            <?php 
        }
        ?>
                        </tr>

                        <?php 
        foreach ($Result as $Array) {
            $item_name = empty($Array[1]) ? CONTENT_CLASSIFICATORS_NO_NAME : $Array[1];
            print "<tr>";
            print "<td>" . $Array[0] . "</td>";
            print "<td><a onclick='parent.nc_form(this.href); return false;' href={$ADMIN_PATH}classificator.php?phase=10&ClassificatorID=" . $ClassificatorID . "&IdInClassificator=" . $Array[0] . ">" . $item_name . "</a></td>";
            if ($admin_cl) {
                print "<td align=center>" . nc_admin_checkbox_simple("check_" . $Array[0], '', '', $Array[3]) . "</td>";
                print "<td align=center>" . nc_admin_input_simple("Priority" . $Array[0], $Array[2], 3, '', "class='s' maxlength='5'") . "</td>";
                print "<td align=center>" . nc_admin_checkbox_simple("Delete" . $Array[0], $Array[0]) . "</td>";
            }
            print "</tr>\r\n";
        }
        ?>
                    </table>
                </td>
            </tr>
        </table><br>
    <?php 
    } else {
        nc_print_status(CONTENT_CLASSIFICATORS_ERR_ELEMENTNONE, 'info');
    }
    if ($access_to_add) {
        //Показать или нет кнопуку "Добавить элемент"
        $UI_CONFIG->actionButtons[] = array("id" => "addClassificatorItem", "caption" => CONTENT_CLASSIFICATORS_ELEMENTS_ADDONE, "action" => "parent.nc_form('{$ADMIN_PATH}classificator.php?phase=8&ClassificatorID={$ClassificatorID}')", "align" => "left");
    }
    if ($admin_cl) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTENT_CLASSIFICATORS_SAVE, "action" => "mainView.submitIframeForm()");
        ?>
        <?php 
        echo $nc_core->token->get_input();
        ?>
        <input type=hidden name=ClassificatorID value=<?php 
        echo $ClassificatorID;
        ?>
>
        <input type=hidden name=phase value=5>
        <input type='submit' class='hidden'>
        </form>
        </div>
    <?php 
    }
}
예제 #12
0
function nc_user_move_to_group_form()
{
    global $db, $UI_CONFIG;
    $users = array();
    foreach ($_POST as $k => $v) {
        if (substr($k, 0, 4) == 'User') {
            $users[] = intval($v);
        }
    }
    $users = array_unique($users);
    if (empty($users)) {
        return false;
    }
    $groups = $db->get_results("SELECT `PermissionGroup_ID` as id, `PermissionGroup_Name` as name FROM `PermissionGroup` ORDER BY 1 ", ARRAY_A);
    echo "<form action='index.php' method='post' >\r\n";
    echo "<input type='hidden' name='phase' value='18' />\r\n";
    foreach ($users as $v) {
        echo "<input type='hidden' name='User" . $v . "' value='" . $v . "' />\r\n";
    }
    echo "<div style='padding-bottom: 10px;'>" . CONTROL_USER_SELECT_GROUP_TO_MOVE . "</div>";
    foreach ($groups as $v) {
        $id = $v['id'];
        echo nc_admin_checkbox_simple("Group" . $id, $id, $v['name']) . '<br />';
    }
    echo "</form>\r\n";
    return true;
}
예제 #13
0
function ShowForm()
{
    global $db, $ROOT_FOLDER, $INCLUDE_FOLDER;
    global $systemTableID, $systemMessageID, $systemTableName;
    global $SPAM_FROM_NAME, $SPAM_FROM, $ADMIN_PATH;
    $nc_core = nc_Core::get_object();
    ?>
    <form name='main' id='main' method=post action="MessageToAll.php">

        <fieldset>
            <legend><?php 
    echo CONTROL_USER_MAIL_RULES;
    ?>
</legend>
            <table width=100%><tr><td>

                        <?php 
    $Result = $db->get_results("select PermissionGroup_ID, PermissionGroup_Name from PermissionGroup", ARRAY_N);
    print "<font color=gray>" . CONTROL_USER_MAIL_GROUP . ":</font><br><SELECT NAME=PermissionGroupID>";
    print "<OPTION VALUE=0>" . CONTROL_USER_MAIL_ALLGROUPS;
    print "</OPTION>\n";
    foreach ($Result as $GroupArray) {
        print "  <OPTION ";
        print "VALUE=" . $GroupArray[0] . ">";
        print $GroupArray[0] . ": " . $GroupArray[1];
        print "</OPTION>";
    }
    print "</SELECT><br><br>";
    require_once $INCLUDE_FOLDER . "s_files.inc.php";
    require $ROOT_FOLDER . "message_fields.php";
    if ($searchForm = showSearchForm($fldName, $fldType, $fldDoSearch, $fldFmt)) {
        ?>
                            <fieldset>
                                <table width=100%><tr><td>
                                            <?php 
        echo $searchForm;
        ?>
                                        </td></tr></table>
                            </fieldset>
                            <?php 
    }
    ?>
                    </td></tr></table></fieldset>
        <fieldset>
            <legend><?php 
    echo CONTROL_USER_MAIL_CONTENT;
    ?>
</legend>
            <table border=0 cellpadding=6 cellspacing=0 width=100%><tr><td>
                        <?php 
    echo CONTROL_USER_MAIL_FROM;
    ?>
: <b><?php 
    echo $SPAM_FROM_NAME;
    ?>
</b> &lt;<?php 
    echo $SPAM_FROM;
    ?>
&gt; <a href=<?php 
    echo "" . $ADMIN_PATH . "settings.php?phase=1";
    ?>
><?php 
    echo CONTROL_USER_MAIL_CHANGE;
    ?>
</a><br><br>

                        <?php 
    echo CONTROL_USER_MAIL_SUBJECT;
    ?>
:<br><?php 
    echo nc_admin_input_simple('Subject', '', 60);
    ?>
<br><br>
                        <?php 
    echo nc_admin_checkbox_simple('is_html', 1, NETCAT_MODULE_HTML_MAIL, false, 'is_html');
    ?>
<br />

                        <?php 
    echo nc_admin_textarea(CONTROL_USER_MAIL_BODY, 'Message', '', 1, 1, 'width: 100%; height: 20em; line-height: 1em; ');
    ?>
<br><br>
                        
                        <?php 
    echo nc_admin_checkbox_simple('Attach', 1, CONTROL_USER_MAIL_ADDATTACHMENT, false, 'att');
    ?>
                        
                    </td></tr></table>
        </fieldset>

        <?php 
    /* <div align=right><input class=s type=submit value="<?=CONTROL_USER_MAIL_SEND?>"></div> */
    global $UI_CONFIG;
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_USER_MAIL_SEND, "action" => "mainView.submitIframeForm()");
    ?>

        <input type=hidden name=phase value=2>
        <input type='submit' class='hidden'>
    </form>
    <?php 
}
예제 #14
0
function ModuleUpdateForm($ModuleID)
{
    global $db, $MODULE_FOLDER, $nc_core;
    global $ADMIN_PATH, $ADMIN_TEMPLATE;
    $ModuleID = intval($ModuleID);
    $Array = $db->get_row("SELECT * FROM `Module` WHERE `Module_ID` = '" . $ModuleID . "'", ARRAY_A);
    if (!$Array['Checked']) {
        print NETCAT_MODULE_MODULE_UNCHECKED;
        return;
    }
    $keyword = $Array["Keyword"];
    if ($Array["Keyword"] != 'default') {
        if (file_exists($MODULE_FOLDER . $keyword . "/" . MAIN_LANG . ".lang.php")) {
            require_once $MODULE_FOLDER . $keyword . "/" . MAIN_LANG . ".lang.php";
        } else {
            require_once $MODULE_FOLDER . $keyword . "/en.lang.php";
        }
    }
    ?>
    <form method='post' action='index.php'>
        <table class='admin_table' style='width:100%;' id='tableParam'>
            <col style='width:35%'/><col style='width:60%'/><col style='width:5%'/>
            <tbody>
                <tr>
                    <th class='align-center first_col'><?php 
    echo NETCAT_MODULES_PARAM;
    ?>
</th>
                    <th class='align-center' ><?php 
    echo NETCAT_MODULES_VALUE;
    ?>
</th>
                    <td class='align-center last_col'><div class='icons icon_delete' title='<?php 
    echo CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DELETE;
    ?>
'></div></td>
                </tr>

                <?php 
    $ParamArray = ConvertToDiffer($Array["Parameters"]);
    foreach ($ParamArray as $k => $v) {
        print "<tr>\n";
        print " <td class='first_col'>" . nc_admin_input_simple("Name_" . $k . "' style = 'width:100%; font-family: \"Courier New\", Courier, monospace'", $k) . "</td>\n";
        print " <td>" . nc_admin_input_simple("Value_" . $k . "' style = 'width:100%; font-family: \"Courier New\",Courier,monospace'", $v) . "</td>\n";
        print " <td class='last_col'>" . nc_admin_checkbox_simple("Delete_" . $k) . "</td>\n";
        print "</tr>\n";
    }
    print "</tbody></table>\n";
    print "<input type='hidden' name='ModuleID' value=" . $ModuleID . ">\n";
    print "<input type='hidden' name='phase' value='3'>";
    print $nc_core->token->get_input();
    global $UI_CONFIG, $module_name;
    print "<input type='hidden' name='module_name' value='" . $module_name . "'></form>";
    $UI_CONFIG = new ui_config_module($module_name, 'settings');
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "action" => "mainView.submitIframeForm()");
    $UI_CONFIG->actionButtons[] = array("id" => "addparam", "caption" => NETCAT_MODULES_ADDPARAM, "align" => "left", "action" => "document.getElementById('mainViewIframe').contentWindow.ModulesAddNewParam()");
}
예제 #15
0
function ShowFavorites()
{
    global $db, $UI_CONFIG, $nc_core;
    global $EDIT_DOMAIN, $HTTP_ROOT_PATH, $DOMAIN_NAME;
    global $loc, $perm, $ADMIN_PATH, $ADMIN_TEMPLATE, $SUB_FOLDER;
    $favorites = GetFavorites('OBJECT');
    if ($favorites) {
        $totrows = $db->num_rows;
        ?>
        <form method='post' action='favorites.php'>
            <table border='0' cellpadding='0' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <table class='admin_table' width='100%'>
                            <tr>
                                <th>ID</th>
								<th width='100%'><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_SECTION;
        ?>
</th>
								<th><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_SUBSECTIONS;
        ?>
</th>
								<th class='align-center'><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_GOTO;
        ?>
</th>
								<td class='align-center'><div class='icons icon_delete' title='<?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_DELETE;
        ?>
'></div></td>
							</tr>

		<?php 
        $temp_group = "";
        foreach ($favorites as $Array) {
            if ($temp_group != $Array->Catalogue_ID) {
                print "<tr><td'><br></td><td colspan=5><a href=" . $ADMIN_PATH . "subdivision/full.php?CatalogueID=" . $Array->Catalogue_ID . " title='" . CONTROL_CONTENT_CATALOUGE_ONESITE . "'>" . (!$Array->CatalogueChecked ? "" : "") . $Array->Catalogue_Name . (!$Array->CatalogueChecked ? "" : "") . "</a></td></tr>";
            }
            print "<tr>\n                     <td>" . $Array->Subdivision_ID . "</td>\n                     <td><a href=\"index.php?phase=4&SubdivisionID=" . $Array->Subdivision_ID . "\">" . (!$Array->SubChecked ? "" : "") . $Array->Subdivision_Name . "</a></td>\n                     <td><a href=index.php?phase=1&ParentSubID=" . $Array->Subdivision_ID . ">" . (!$Array->SubChecked ? "" : "") . (!ChildrenNumber($Array->Subdivision_ID) ? CONTROL_CONTENT_SUBDIVISION_FUNCS_NONE : CONTROL_CONTENT_SUBDIVISION_FUNCS_LIST . " (" . ChildrenNumber($Array->Subdivision_ID) . ")") . "</a></td>\n                     <td align=center nowrap><a href=index.php?phase=5&SubdivisionID=" . $Array->Subdivision_ID . "><div class='icons icon_settings' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOOPTIONS . "'></div></a>" . (!GetSubClassCount($Array->Subdivision_ID) ? "<img src=" . $ADMIN_TEMPLATE . "img/px.gif width=16 height=16 style='margin:0px 2px 0px 2px;'>" : "<a target=_blank href=http://" . $EDIT_DOMAIN . $HTTP_ROOT_PATH . "?catalogue=" . $Array->Catalogue_ID . "&sub=" . $Array->Subdivision_ID . (session_id() ? "?" . session_name() . "=" . session_id() : "") . "><div class='icons icon_pencil' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOEDIT . "'></div></a>") . "<a href=" . nc_subdivision_preview_link($Array) . " target=_blank><div class='icons icon_preview' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOVIEW . "'></div></a></td>\n                     <td align=center>" . nc_admin_checkbox_simple("Delete[" . $Array->Subdivision_ID . "]", $Array->Subdivision_ID) . "</td>\n\n                   </tr>\n";
            $temp_group = $Array->Catalogue_ID;
        }
        ?>
                                                                        </table>
                                                                        </td>
                                                                        </tr>
                                                                        </table>
                                                                        <input type='hidden' name='phase' value='6'>
                                                                        <input type='submit' class='hidden'>
                                                                        <?php 
        echo $nc_core->token->get_input();
        ?>
                                                                        </form>
                                                                        <?php 
        $UI_CONFIG->actionButtons[] = array("id" => "delete", "caption" => NETCAT_ADMIN_DELETE_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "left", "red_border" => true);
    } else {
        nc_print_status(CONTROL_CONTENT_SUBDIVISION_FUNCS_NOONEFAVORITES, 'info');
    }
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_SUBDIVISION_FUNCS_ADDSECTION, "action" => "window.open('" . $ADMIN_PATH . "subdivision/favorites.php?phase=4','LIST','top=50, left=100,directories=no,height=600,location=no,menubar=no,resizable=no,scrollbars=yes,status=yes,toolbar=no,width=400')");
}
예제 #16
0
function nc_sub_class_get_prefix($SubClassID, $Array, $display = false)
{
    return "<div id='nc_sub_class_{$SubClassID}_div'" . ($display ? '' : " style='display: none;'") . " class='nc_admin_settings_info'>\n                " . ($Array['Created'] || $Array['LastUpdated'] ? "\n                <div class='nc_admin_settings_info_actions'>\n                    <div>\n                        " . ($Array['Created'] ? "<span>" . CLASS_TAB_CUSTOM_ADD . ":</span>" . $Array['Created'] : '') . "\n                    </div>\n                    " . ($Array['LastUpdated'] ? "\n                    <div>\n                        <span>" . CLASS_TAB_CUSTOM_EDIT . ":</span> {$Array['LastUpdated']}\n                    </div>" : '') . "\n                <div>" : '') . "\n                <div class='nc_admin_settings_info_checked'>\n                    " . nc_admin_checkbox_simple('Checked', 1, CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_TURNON, $Array['Checked'], 'turnon') . "\n                </div>";
}
예제 #17
0
function CatalogueForm($CatalogueID, $phase, $action, $type, $bar_action = null)
{
    # type = 1 - это insert
    # type = 2 - это update
    global $ROOT_FOLDER, $HTTP_FILES_PATH, $DOMAIN_NAME;
    global $SUB_FOLDER, $HTTP_ROOT_PATH, $ADMIN_PATH;
    global $systemTableID, $systemTableName, $admin_mode;
    global $FILES_FOLDER, $INCLUDE_FOLDER, $MODULE_FOLDER, $ADMIN_FOLDER;
    global $UI_CONFIG;
    if (!$bar_action) {
        $bar_action = 'edit';
    }
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    $lm_type = $nc_core->page->get_field_name('last_modified_type');
    $sm_field = $nc_core->page->get_field_name('sitemap_include');
    $sm_change_field = $nc_core->page->get_field_name('sitemap_changefreq');
    $sm_priority_field = $nc_core->page->get_field_name('sitemap_priority');
    $lang_field = $nc_core->page->get_field_name('language');
    $CatalogueID = intval($CatalogueID);
    $params = array('Catalogue_Name', 'Domain', 'Template_ID', 'Read_Access_ID', 'Write_Access_ID', 'Edit_Access_ID', 'Subscribe_Access_ID', 'Checked_Access_ID', 'Delete_Access_ID', 'Moderation_ID', 'Checked', 'Priority', 'Mirrors', 'Robots', 'Cache_Access_ID', 'Cache_Lifetime', 'TitleSubIDName', 'TitleSubIDKeyword', 'TitleTemplateID', 'E404SubIDName', 'E404SubIDKeyword', 'E404TemplateID', 'CommentsEditRules', 'CommentAccessID', 'CommentsDeleteRules', 'DisplayType', 'last_modified_type', 'AllowIndexing', $sm_field, $sm_change_field, $sm_priority_field, 'ncOfflineText');
    foreach ($params as $v) {
        ${$v} = $nc_core->input->fetch_get_post($v);
    }
    $st = new nc_Component(0, 1);
    foreach ($st->get_fields(0, 0) as $v) {
        $v = 'f_' . $v;
        ${$v} = $nc_core->input->fetch_get_post($v);
    }
    $showFields = false;
    if ($type == 1) {
        $mandatoryFields = array();
        foreach ($st->get_fields() as $f) {
            if ($f['not_null']) {
                $mandatoryFields[] = $f['name'];
            }
        }
        $showFields = count($mandatoryFields) > 0;
    }
    if ($nc_core->modules->get_by_keyword('calendar', 0)) {
        echo nc_set_calendar(0);
    }
    echo "<form id='adminForm' class='nc-form' enctype='multipart/form-data' method='post' name='adminForm' action='" . $action . "'>";
    if ($type == 1) {
        if ($Priority == "" && $Checked == "") {
            $Checked = 1;
        }
        if ($Priority == "") {
            $Priority = $db->get_var("SELECT MAX(`Priority`)+1 FROM `Catalogue`");
        }
        foreach ($params as $v) {
            $Array[$v] = ${$v};
        }
        $Array['Read_Access_ID'] = 1;
        $Array['Write_Access_ID'] = 3;
        $Array['Edit_Access_ID'] = 3;
        $Array['Checked_Access_ID'] = 3;
        $Array['Delete_Access_ID'] = 3;
    } else {
        if ($type == 2) {
            try {
                $Array = $nc_core->catalogue->get_by_id($CatalogueID);
            } catch (Exception $e) {
                nc_print_status(CONTROL_CONTENT_CATALOUGE_FUNCS_ERROR_NOCATALOGUE, 'info');
                EndHtml();
                exit;
            }
        }
    }
    //по умолчанию: публикация объекта сразу после добавления
    if (!$Array["Moderation_ID"]) {
        $Array["Moderation_ID"] = 1;
    }
    if (!$Array[$lm_type]) {
        $Array[$lm_type] = 1;
    }
    if (!$Array[$sm_change_field]) {
        $Array[$sm_change_field] = 'daily';
    }
    if (!$Array[$sm_priority_field]) {
        $Array[$sm_priority_field] = 0.5;
    }
    $fieldsets = new nc_admin_fieldset_collection();
    $access_actions = array('Read', 'Write', 'Edit', 'Checked', 'Delete');
    foreach ($access_actions as $access_action) {
        $Array["_db_{$access_action}_Access_ID"] = $Array[$access_action . "_Access_ID"];
    }
    $fields_hack = array($nc_core->page->get_field_name('last_modified'), $nc_core->page->get_field_name('last_modified_type'), 'Moderation_ID', 'Cache_Access_ID', 'Cache_Lifetime', 'DisallowIndexing', 'Template_ID');
    if ($nc_core->modules->get_by_keyword('search')) {
        $fields_hack[] = $nc_core->page->get_field_name('sitemap_include');
        $fields_hack[] = $nc_core->page->get_field_name('sitemap_changefreq');
        $fields_hack[] = $nc_core->page->get_field_name('sitemap_priority');
    }
    foreach ($fields_hack as $field_name) {
        $Array['_db_' . $field_name] = $Array[$field_name];
    }
    $Array['_db_inherit_' . $sm_change_field] = $Array['_db_' . $sm_change_field];
    $Array['_db_inherit_Template_ID'] = $Array['Template_ID'];
    $bar_all = $bar_action == 'all';
    $display = array('edit' => $bar_all || $bar_action == 'edit' || $bar_action == 'wizard', 'design' => $bar_action == 'design' || $bar_action == 'wizard', 'seo' => $bar_action == 'seo' || $bar_action == 'wizard', 'system' => $bar_action == 'system' || $bar_action == 'wizard', 'fields' => $bar_action == 'fields' || $bar_action == 'wizard' || $showFields);
    $p_div_bar_action = '';
    $s_div_bar_action = '';
    if ($bar_action == 'all') {
        $p_div_bar_action = "<div style='display: none;'>";
        $s_div_bar_action = '</div>';
    }
    $fieldsets->set_prefix("\n        {$p_div_bar_action}\n        <div id='nc_seo_edit_info'" . ($bar_action != 'edit' ? " style='display:none;'" : "") . " class='nc_admin_settings_info'>\n            <div class='nc_admin_settings_info_actions'>\n                <div>\n                    <span>" . CLASS_TAB_CUSTOM_ADD . ":</span> {$Array['Created']}\n                </div>\n                " . ($Array['LastUpdated'] ? "<div>\n                    <span>" . CLASS_TAB_CUSTOM_EDIT . ":</span> {$Array['LastUpdated']}\n                </div>" : "") . "\n            </div>\n\n            <div class='nc_admin_settings_info_priority'>\n                <div>\n                    " . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_PRIORITY . ":\n                </div>\n\n                <div>\n                    " . nc_admin_input_simple('Priority', intval($Array["Priority"]), 3, '', "maxlength='5'") . "\n                </div>\n            </div>\n\n            <div class='nc_admin_settings_info_checked'>\n                <div>\n                    " . nc_admin_checkbox_simple('Checked', 1, CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ON, $Array["Checked"] == 1 || !$CatalogueID, 'turnon') . "\n                </div>\n            </div>\n        </div>{$s_div_bar_action}");
    $fieldsets->set_suffix($nc_core->token->get_input() . "\n        <input type='hidden' name='CatalogueID' value='{$CatalogueID}' />\n        <input type='hidden' name='phase' value='{$phase}' />\n        <input type='hidden' name='type' value='{$type}' />\n        <input type='hidden' name='posting' value='1' />\n        <input type='hidden' name='action' value='{$bar_action}' />\n        <input type='submit' class='hidden' />\n    </form><br />" . nc_admin_js_resize());
    $fieldsets->new_fieldset('main_info', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MAININFO)->show($display['edit']);
    $fieldsets->new_fieldset('template', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_TEMPLATE)->add(nc_subdivision_form_design($Array, $CatalogueID, false))->show($display['design']);
    //$fieldsets->new_fieldset('mobile', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_SETTINGS)->show($display['edit'] && $bar_action != 'all');
    $fieldsets->new_fieldset('seo', '')->add(nc_subdivision_form_seo($Array, false))->show($display['seo']);
    $fieldsets->new_fieldset('access', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ACCESS)->add(nc_subdivision_show_access($Array, false))->show($display['system']);
    if ($nc_core->modules->get_by_keyword('minishop')) {
        $fieldsets->new_fieldset('shop_mode', $p_div_bar_action ? null : NETCAT_MODULE_MINISHOP_INFOBLOCK_MODE)->add("{$p_div_bar_action}<div>" . NETCAT_MODULE_MINISHOP_INFOBLOCK_GOOD_MODE . ":</div>" . nc_catalogue_form_shop_mode($CatalogueID))->show($display['edit'] . $s_div_bar_action);
    }
    if (nc_module_check_by_keyword("cache")) {
        $fieldsets->new_fieldset('cache', CONTROL_CONTENT_CATALOGUE_FUNCS_CACHE)->add(nc_subdivision_show_cache($Array, false))->show($display['system']);
    }
    if (nc_module_check_by_keyword("comments")) {
        $fieldsets->new_fieldset('comments', CONTROL_CONTENT_CATALOGUE_FUNCS_COMMENTS)->add(nc_subdivision_show_comments($Array, false))->show($display['system']);
    }
    ob_start();
    echo nc_admin_input(CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NAME, 'Catalogue_Name', $Array["Catalogue_Name"], 32) . "\n   " . nc_admin_input(CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_DOMAIN, 'Domain', $Array["Domain"], 32) . "\n   {$p_div_bar_action}\n   <br />" . nc_admin_textarea_simple('Mirrors', $Array["Mirrors"], CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MIRRORS, 4, 10, '', '', 'no_cm') . "<br /><br />\n   " . nc_admin_textarea_simple('Robots', $Array["Robots"] ? $Array["Robots"] : "# NetCat Robots file\nUser-agent: *\nDisallow: /install/", CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ROBOTS, 4, 10) . "<br /><br />\n    " . nc_admin_textarea_simple('ncOfflineText', $Array["ncOfflineText"], CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_OFFLINE, 4, 10) . "<br /><br />\n\n    <table border='0' cellpadding=0 cellspacing=0 width=100%>\n        <tr>\n            <td>\n                " . CONTROL_CONTENT_SUBDIVISION_FUNCS_CATALOGUEFORM_LANG . ":</br>\n                " . nc_admin_input_simple('language', $Array[$lang_field], 50) . "<br/>\n            </td>\n        </tr>";
    if ($type == 2) {
        $subdivisions = $db->get_results("SELECT Subdivision_ID as value,\n                                             CONCAT(Subdivision_ID, '. ', Subdivision_Name) as description,\n                                             Parent_Sub_ID as parent\n                                        FROM Subdivision\n                                       WHERE Catalogue_ID='" . $CatalogueID . "'\n                                    ORDER BY Subdivision_ID", ARRAY_A);
        echo "\n        <tr>\n            <td>\n                <br />\n                <table border='0' cellspacing='0' width='100%' class='border-bottom'>\n                    <col width='40%'/><col/>\n                    <tr>\n                        <td>\n                            " . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_TITLEPAGE . "\n                        </td>\n                    <td>";
        if (!empty($subdivisions)) {
            echo "<select name='TitleSubID'>";
            echo nc_select_options($subdivisions, $Array["Title_Sub_ID"]);
            echo "</select>";
        } else {
            echo CONTROL_USER_NOONESECSINSITE;
        }
        echo "              </td>\n                    </tr>\n                    <tr>\n                        <td>\n                            " . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NOTFOUND . "\n                        </td>\n                        <td>";
        if (!empty($subdivisions)) {
            echo "<select name='E404SubID'>";
            echo nc_select_options($subdivisions, $Array["E404_Sub_ID"]);
            echo "</select>";
        } else {
            echo CONTROL_USER_NOONESECSINSITE;
        }
        echo "</td>\n</tr>\n</table><br><br></td></tr>";
    }
    echo "</table>{$s_div_bar_action}";
    $fieldsets->main_info->add(ob_get_clean());
    $templates = $db->get_results("SELECT Template_ID as value,\n                                        CONCAT(Template_ID, '. ', Description) as description,\n                                        Parent_Template_ID as parent\n                                   FROM Template\n                               ORDER BY Priority, Template_ID", ARRAY_A);
    ob_start();
    echo "<tr><td>";
    if ($type == 1) {
        echo $p_div_bar_action;
        echo WIZARD_SITE_STEP_TWO_DESCRIPTION . "<br/><br/>";
        if ($Array["Title_Sub_ID"]) {
            $title_sub = $db->get_row("SELECT Subdivision_Name, EnglishName FROM Subdivision WHERE Subdivision_ID = '" . intval($Array["Title_Sub_ID"]) . "'", ARRAY_A);
        }
        if ($Array["E404_Sub_ID"]) {
            $e404_sub = $db->get_row("SELECT Subdivision_Name, EnglishName FROM Subdivision WHERE Subdivision_ID = '" . intval($Array["E404_Sub_ID"]) . "'", ARRAY_A);
        }
        echo "<legend><h3>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_TITLEPAGE . "</h3></legend>\n";
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_NAME . ":<br>\n";
        echo nc_admin_input_simple('TitleSubIDName', $title_sub['Subdivision_Name'] ? $title_sub['Subdivision_Name'] : CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_TITLEPAGE) . "<br><br>\n";
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_KEYWORD . ":<br>\n";
        echo nc_admin_input_simple('TitleSubIDKeyword', $title_sub['EnglishName'] ? $title_sub['EnglishName'] : "index") . "<br><br>\n";
        if (!empty($templates)) {
            echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE . ":<br>\n";
            echo "<select name='TitleTemplateID'>\n";
            echo "<option value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE_N . "</option>";
            echo nc_select_options($templates, $Array["Title_Sub_ID"]);
            echo "</select><br>\n";
        } else {
            echo CONTROL_TEMPLATE_NONE;
        }
        echo "<legend><h3>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NOTFOUND . "</h3></legend>\n";
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_NAME . ":<br>\n";
        echo nc_admin_input_simple('E404SubIDName', $title_sub['Subdivision_Name'] ? $title_sub['Subdivision_Name'] : CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NOTFOUND) . "<br><br>\n";
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_KEYWORD . ":<br>\n";
        echo nc_admin_input_simple('E404SubIDKeyword', $title_sub['EnglishName'] ? $title_sub['EnglishName'] : "404") . "<br><br>\n";
        if (!empty($templates)) {
            echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE . ":<br>\n";
            echo "<select name='E404TemplateID'>\n";
            echo "<option value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE_N . "</option>";
            echo nc_select_options($templates, $Array["E404_Sub_ID"]);
            echo "</select><br>\n";
        } else {
            echo CONTROL_TEMPLATE_NONE;
        }
        echo $s_div_bar_action;
    }
    $fieldsets->template->add(ob_get_clean());
    $display_type_fieldset = new nc_admin_fieldset(CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DISPLAYTYPE);
    ob_start();
    echo nc_get_modal_radio('DisplayType', array(array('attr' => array('value' => 'traditional'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_DISPLAYTYPE_TRADITIONAL), array('attr' => array('value' => 'shortpage'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_DISPLAYTYPE_SHORTPAGE), array('attr' => array('value' => 'longpage_vertical'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_DISPLAYTYPE_LONGPAGE_VERTICAL)), $Array['DisplayType']);
    $display_type_fieldset->add(ob_get_clean());
    $fieldsets->template->add($display_type_fieldset->result());
    ob_start();
    echo nc_get_modal_radio('ncMobile', array(array('attr' => array('value' => '0'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SIMPLE), array('attr' => array('value' => '1'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE), array('attr' => array('value' => '2'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ADAPTIVE)), $Array['ncMobile'] ? 1 : ($Array['ncResponsive'] ? 2 : 0));
    require_once $ADMIN_FOLDER . "related/format.inc.php";
    $field = new field_relation_catalogue();
    echo "\n\n    <span id='nc_mobilesrc'>\n        <br />\n        <span id='mobility_text'>\n        <font>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_FOR . ":</font>\n        <span id='cs_ncMobileSrc_caption' style='font-weight:bold;'>" . ($Array['ncMobileSrc'] ? listQuery($field->get_object_query($Array['ncMobileSrc']), $field->get_full_admin_template()) : '[нет]') . "</span>\n        </span>\n        <input id='cs_ncMobileSrc_value' name='ncMobileSrc' type='hidden' value='" . $Array['ncMobileSrc'] . "'>&nbsp;&nbsp;\n        <span class='mobility_notMobile' style='display: none; color: #aaa'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_FOR_NOTICE . "</span>\n        <span class='moblilty_links'>\n        <a href='#' onclick='window.open(\"" . $ADMIN_PATH . "related/select_catalogue.php?cs_type=rel_catalogue&amp;cs_field_name=ncMobileSrc\", \"nc_popup_ncMobileSrc\", \"width=800,height=500,menubar=no,resizable=no,scrollbars=yes,toolbar=no,resizable=yes\"); return false;'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_CHANGE . "</a>&nbsp;&nbsp;\n        <a href='#' onclick='document.getElementById(\"cs_ncMobileSrc_value\").value=\"\";document.getElementById(\"cs_ncMobileSrc_caption\").innerHTML = \"" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_NONE . "\";return false;'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_DELETE . "</a></span> <br /><br />\n        " . nc_admin_checkbox(CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_REDIRECT, 'ncMobileRedirect', $Array["ncMobileRedirect"], "class='ncMobileIdentity'") . "\n    </span>\n    <br />" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_CRITERION . "\n\n\n    <script type='text/javascipt'>\n    function nc_mobile_change() {\n        if (\$nc('input[name=ncMobile]').filter(':checked').val() == 1) {\n            \$nc('.ncMobileIdentity').each(function() {\n                \$nc(this).removeAttr('disabled');\n            })\n            \$nc('.moblilty_links, #cs_ncMobileSrc_caption').css('display', '');\n            \$nc('.mobility_notMobile').css('display', 'none');\n            \$nc('#mobility_text').css('color', '#505050');\n        } else {\n            \$nc('.ncMobileIdentity').each(function() {\n                \$nc(this).attr('disabled', 'disabled');\n            });\n            \$nc('.moblilty_links, #cs_ncMobileSrc_caption').css('display', 'none');\n            \$nc('.mobility_notMobile').css('display', '');\n            \$nc('#mobility_text').css('color', '#aaa');\n        }\n    }\n\n    \$nc(document).ready(function() {\n        nc_mobile_change();\n        \$nc('input[name=ncMobile]').change(function(){\n            nc_mobile_change();\n        });\n    });\n\n    </script>";
    echo nc_get_modal_radio('ncMobileIdentity', array(array('attr' => array('value' => '1', 'class' => 'ncMobileIdentity'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_USERAGENT), array('attr' => array('value' => '2', 'class' => 'ncMobileIdentity', 'id' => 'ncMobileCatalogue'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_SCREEN_RESOLUTION), array('attr' => array('value' => '3', 'class' => 'ncMobileIdentity'), 'desc' => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_ALL_CRITERION)), +$Array['ncMobileIdentity']);
    $mobile_fieldset = new nc_admin_fieldset(CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MOBILE_SETTINGS);
    $mobile_fieldset->add(ob_get_clean());
    $fieldsets->template->add($mobile_fieldset->result());
    if ($type == 1) {
        $action = "add";
    }
    if ($type == 2) {
        $action = "change";
        $message = $CatalogueID;
    }
    require $ROOT_FOLDER . "message_fields.php";
    if ($fldCount) {
        $fieldsets->new_fieldset('ext_fields', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_EXTFIELDS);
        ob_start();
        if ($type == 2) {
            $fieldQuery = join($fld, ",");
            $fldValue = $db->get_row("SELECT " . $fieldQuery . " FROM `Catalogue` WHERE `Catalogue_ID`='" . $CatalogueID . "'", ARRAY_N);
        }
        echo "<table border='0' cellpadding='6' cellspacing='0' width='100%'><tr><td><font>";
        require $ROOT_FOLDER . "message_edit.php";
        echo "</td></tr></table>";
        $fieldsets->ext_fields->add(ob_get_clean())->show($display['fields']);
    }
    echo $fieldsets->to_string();
    if ($type == 1) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_ADDSITE, "action" => "mainView.submitIframeForm()");
    } elseif ($type == 2) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "align" => "right", "action" => "mainView.submitIframeForm()");
    }
    return 0;
}
예제 #18
0
function echo_widgetclass_form($params, $phase = '', $widget_group = '')
{
    global $ADMIN_PATH, $db, $nc_core;
    $params = (array) $params;
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    if (get_fs()) {
        $widget_editor = new nc_widget_editor($nc_core->WIDGET_TEMPLATE_FOLDER, $nc_core->db);
        $widget_editor->load($params['Widget_Class_ID'], null, $params['File_Hash']);
    }
    echo "<form method='post' id='nc_widgetclass_form' action='index.php'>";
    if (get_fs() && $phase != 3) {
        $widget_absolute_path = $widget_editor->get_absolute_path();
        $widget_filemanager_link = $nc_core->SUB_FOLDER . $nc_core->HTTP_ROOT_PATH . "modules/filemanager/admin.php?page=manager&phase=1&dir=" . $nc_core->SUB_FOLDER . $nc_core->HTTP_TEMPLATE_PATH . 'widget' . $widget_editor->get_relative_path();
        ?>
        <br />
        <div><?php 
        echo sprintf(CONTROL_WIDGETCLASS_FILES_PATH, $widget_filemanager_link, $widget_absolute_path);
        ?>
</div>
        <br />
	<?php 
    }
    echo "<input type='hidden' name='fs' value='" . get_fs() . "' /><fieldset>" . "" . WIDGET_ADD_NAME . ":<br />" . nc_admin_input_simple('Name', $params['Name'], 50) . "<br /><br />" . "" . WIDGET_ADD_KEYWORD . ":<br />" . nc_admin_input_simple('Keyword', $params['Keyword'], 50) . "<br /><br />";
    $widgetCategory = $db->get_col("SELECT DISTINCT `Category` FROM `Widget_Class`");
    echo CONTROL_USER_GROUP . ":<br /><select name='Category' style='width:auto;'>\n";
    foreach ($widgetCategory as $wc) {
        if ($params['Category'] == $wc || $widget_group == md5($wc)) {
            echo "\t<option value='" . $wc . "' selected='selected'>" . $wc . "</option>\n";
        } else {
            echo "\t<option value='" . $wc . "'>" . $wc . "</option>\n";
        }
    }
    echo "</select>&nbsp;&nbsp;&nbsp;" . "" . WIDGET_ADD_NEWGROUP . "&nbsp;&nbsp;&nbsp;" . nc_admin_input_simple('Category_New', null, 25, '', "maxlength='64'") . "</fieldset>" . "<table border='0' cellpadding='6' cellspacing='0' width='100%' ><tr style='display: none;'><td colspan='2'>" . "<div id='DescriptionOn' style='display: none'>" . "<p style='cursor: pointer;' onclick='document.getElementById(\"DescriptionOn\").style.display=\"none\";document.getElementById(\"DescriptionOff\").style.display=\"\";'> &#x25BC; " . WIDGET_ADD_DESCRIPTION . ":</p>" . "<br />" . nc_admin_textarea_simple('Description', $params['Description'], '', 8, 60, "id='Description'") . "</div></td></tr></table><br />" . "<legend>" . WIDGET_ADD_OBJECTVIEW . "</legend>" . "<table border='0' cellpadding='6' cellspacing='0' width='100%' >" . "<tr>" . "<td>" . nc_admin_textarea_resize('Template', $params['Template'], "" . WIDGET_ADD_PAGEBODY . ":", 10, 60, 'PageBody') . "</td>" . "</tr>" . "</table>" . "<br />" . "<legend>" . WIDGET_ADD_DOPL . "</legend>" . "<table border='0' cellpadding='0' cellspacing='0' width='100%' >" . "<tr>" . "<td colspan='2'>" . "<font>" . nc_admin_checkbox_simple('InDevelop', 1, WIDGET_ADD_DEVELOP, $params['InDevelop']) . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . "<font>" . nc_admin_checkbox_simple('WidgetDisallow', 1, WIDGET_ADD_DISALLOW, $params['WidgetDisallow']) . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . "<font>" . nc_admin_checkbox_simple('IsStatic', 1, WIDGET_IS_STATIC, isset($params['IsStatic']) ? $params['IsStatic'] : 1) . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . "" . WIDGET_ADD_UPDATE . ":<br />" . nc_admin_input_simple('Update', $params['Update'], 5) . "\n        <br />" . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . nc_admin_textarea_resize('Settings', $params['Settings'], "<br>" . WIDGET_ADD_SYSTEM . ":", 8, 60) . "</td>" . "</tr>" . ($phase == 30 ? "<tr><td colspan='2'><a href='" . $nc_core->SUB_FOLDER . $nc_core->HTTP_ROOT_PATH . "action.php?ctrl=admin.backup&amp;action=export_run&amp;raw=1&amp;type=widget_class&amp;id=" . $params['Widget_Class_ID'] . "&amp;" . $nc_core->token->get_url() . "'>" . WIDGET_LIST_EXPORT . "</a></td></tr>" : "") . "</table>";
    echo_remind_script();
}
예제 #19
0
/**
 * Функция отображает список переадрасаций
 *
 * @return 0
 */
function RedirectList()
{
    global $nc_core, $db, $UI_CONFIG, $ADMIN_TEMPLATE;
    $db->last_error = '';
    $Result = $db->get_results("SELECT `Redirect_ID`,`OldURL`,`NewURL`, `Header` FROM `Redirect` ORDER BY `Redirect_ID`", ARRAY_N);
    // на случай, если поля не существует
    if (strstr($db->last_error, 'Header')) {
        $db->query("ALTER TABLE `Redirect` ADD `Header` INT(3)  NULL DEFAULT '301';");
        return RedirectList();
    }
    if ($countClassif = $db->num_rows) {
        ?>
        <form method=post action=redirect.php>

            <table class='nc-table nc--striped' width='100%'>
                <tr>
                    <th >ID</th>
                    <th width=35%><?php 
        echo TOOLS_REDIRECT_OLDURL;
        ?>
</th>
                    <th width=35%><?php 
        echo TOOLS_REDIRECT_NEWURL;
        ?>
</th>
                    <th class='nc-text-center'><?php 
        echo TOOLS_REDIRECT_HEADER;
        ?>
</th>
                    <th class='nc-text-center'><?php 
        echo TOOLS_REDIRECT_SETTINGS;
        ?>
</th>
                    <th class='nc-text-center'><div class='icons icon_delete'  title='<?php 
        echo CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DELETE;
        ?>
'></div></th>
                </tr>
                <?php 
        foreach ($Result as $Array) {
            print "<tr>";
            print "<td >" . $Array[0] . "</td>\n";
            print "<td>" . $Array[1] . "</a></td>";
            print "<td>" . $Array[2] . "</td>";
            print "<td class='nc-text-center'>" . ($Array[3] ? $Array[3] : 301) . "</td>";
            print "<td class='nc-text-center'><a href=redirect.php?phase=1&RedirectID=" . $Array[0] . "><div class='icons icon_settings' title='" . TOOLS_REDIRECT_CHANGEINFO . "'></div></a></td>";
            print "<td class='nc-text-center'>" . nc_admin_checkbox_simple("Delete" . $Array[0], $Array[0]) . "</td>";
            print "</tr>";
        }
        print "</table><br>";
    } else {
        nc_print_status(TOOLS_REDIRECT_NONE, 'info');
    }
    if ($countClassif) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => NETCAT_ADMIN_DELETE_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "right", "red_border" => true);
        print "<input type=hidden name=phase value=3>";
        print "<input type='submit' class='hidden'>";
        print $nc_core->token->get_input();
        print "</form>";
    }
    $UI_CONFIG->actionButtons[] = array("id" => "add", "caption" => TOOLS_REDIRECT_ADD, "location" => "redirect.add", "align" => "left");
    return 0;
}