コード例 #1
0
ファイル: redirect.inc.php プロジェクト: Blu2z/implsk
function RedirectForm($RedirectID)
{
    global $nc_core, $db, $UI_CONFIG;
    $RedirectID = intval($RedirectID);
    $OldURL = $db->escape($_POST['OldURL']);
    $NewURL = $db->escape($_POST['NewURL']);
    $HeaderCode = intval($_POST['HeaderCode']);
    if ($RedirectID) {
        list($OldURL, $NewURL, $HeaderCode) = $db->get_row("SELECT `OldURL`,`NewURL`, `Header` FROM `Redirect` WHERE `Redirect_ID`='" . $RedirectID . "'", ARRAY_N);
    }
    if ($HeaderCode != 301 && $HeaderCode != 302) {
        $HeaderCode = 301;
    }
    echo "\n    <form method='post' action='redirect.php'>\n       <font color='gray'>\n  " . TOOLS_REDIRECT_OLDLINK . ":<br/>" . nc_admin_input_simple('OldURL', $OldURL, 70, '', "maxlength='255'") . "<br/><br/>\n  " . TOOLS_REDIRECT_NEWLINK . ":<br/>" . nc_admin_input_simple('NewURL', $NewURL, 70, '', "maxlength='255'") . "<br/><br/>\n  " . TOOLS_REDIRECT_HEADERSEND . ":<br/>" . nc_admin_select_simple('', 'HeaderCode', array(301 => 301, 302 => 302), $HeaderCode) . "\n  <hr size='1' color='cccccc'> ";
    if (!$RedirectID) {
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => TOOLS_REDIRECT_ADDONLY, "action" => "mainView.submitIframeForm()");
    } else {
        echo "\n      <input type='hidden' name='RedirectID' value='" . $RedirectID . "' />";
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "action" => "mainView.submitIframeForm()");
    }
    echo $nc_core->token->get_input();
    echo "<input type='hidden' name='phase' value='2'>";
    echo "<input type='submit' class='hidden' /> </form>";
    return 0;
}
コード例 #2
0
ファイル: 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;
}
コード例 #3
0
ファイル: function.inc.php プロジェクト: Blu2z/implsk
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()");
}
コード例 #4
0
ファイル: function.inc.php プロジェクト: Blu2z/implsk
function nc_trash_search_form($subs = array(), $classes = array(), $options = array())
{
    $nc_core = nc_Core::get_object();
    echo nc_set_calendar(0);
    if ($options['date_b']) {
        $b_d = $options['date_b_dd'];
        if ($b_d < 10) {
            $b_d = '0' . $b_d;
        }
        $b_m = $options['date_b_mm'];
        if ($b_m < 10) {
            $b_m = '0' . $b_m;
        }
        $b_y = $options['date_b_yyyy'];
        $b_h = $options['date_b_hh'];
        if ($b_h < 10) {
            $b_h = '0' . $b_h;
        }
        $b_i = $options['date_b_min'];
        if ($b_i < 10) {
            $b_i = '0' . $b_i;
        }
    }
    if ($options['date_e']) {
        $e_d = $options['date_e_dd'];
        if ($e_d < 10) {
            $e_d = '0' . $e_d;
        }
        $e_m = $options['date_e_mm'];
        if ($e_m < 10) {
            $e_m = '0' . $e_m;
        }
        $e_y = $options['date_e_yyyy'];
        $e_h = $options['date_e_hh'];
        if ($e_h < 10) {
            $e_h = '0' . $e_h;
        }
        $e_i = $options['date_e_min'];
        if ($e_i < 10) {
            $e_i = '0' . $e_i;
        }
    }
    $html .= "\n\n    <div id='RecycleSearchOn'>\n      <fieldset class='trash_fldst'>\n        <legend>" . NETCAT_TRASH_FILTER . ":\n        </legend>\n        <form method='post' action='index.php'>\n          <table id='trash_search'  class='admin_table'>\n            <tr>\n              <td class='left'>" . NETCAT_TRASH_FILTER_DATE_FROM . " <i>(" . NETCAT_TRASH_FILTER_DATE_FORMAT . ")</i></td>\n              <td class='right'>" . nc_admin_input_simple('options[date_b_dd]', $b_d, 2, '', "maxlength='2'") . "-" . nc_admin_input_simple('options[date_b_mm]', $b_m, 2, '', "maxlength='2'") . "-" . nc_admin_input_simple('options[date_b_yyyy]', $b_y, 4, '', "maxlength='4'") . "&nbsp;&nbsp;" . nc_admin_input_simple('options[date_b_hh]', $b_h, 2, '', "maxlength='2'") . ":" . nc_admin_input_simple('options[date_b_min]', $b_i, 2, '', "maxlength='2'") . "\n                </td>\n\t\t\t\t<td class= 'right'>\n\t\t\t\t<div class='calendar'>\n                    <a href='#' id='nc_calendar_popup_img_options[date_b_dd]' onclick='nc_calendar_popup(\"options[date_b_dd]\",\"options[date_b_mm]\", \"options[date_b_yyyy]\", \"0\"); return false'>\n                        <i class='nc-icon nc--calendar'></i>\n                    </a>\n                </div>\n                <div class='_cl'  id='nc_calendar_popup_options[date_b_dd]'></div>\n\n              </td>\n            </tr><tr>\n\n              <td class='left'>" . NETCAT_TRASH_FILTER_DATE_TO . " <i>(" . NETCAT_TRASH_FILTER_DATE_FORMAT . ")</i></td>\n              <td class='right'>" . nc_admin_input_simple('options[date_e_dd]', $e_d, 2, '', "maxlength='2'") . "-" . nc_admin_input_simple('options[date_e_mm]', $e_m, 2, '', "maxlength='2'") . "-" . nc_admin_input_simple('options[date_e_yyyy]', $e_y, 4, '', "maxlength='4'") . "&nbsp;&nbsp;" . nc_admin_input_simple('options[date_e_hh]', $e_h, 2, '', "maxlength='2'") . ":" . nc_admin_input_simple('options[date_e_min]', $e_i, 2, '', "maxlength='2'") . "\n                </div>\n                </td>\n\t\t\t\t<td class= 'right'>\n                    <div class='calendar'>\n                        <a href='#' id='nc_calendar_popup_img_options[date_e_dd]' onclick='nc_calendar_popup(\"options[date_e_dd]\",\"options[date_e_mm]\", \"options[date_e_yyyy]\", \"0\"); return false'>\n                            <i class='nc-icon nc--calendar'></i>\n                        </a>\n                    </div>\n\t\t\t\t</td>\n                <div class='_cl' id='nc_calendar_popup_options[date_e_dd]'></div>\n           </tr><tr>";
    if (!empty($subs)) {
        $html .= "\n              <td class='left'>" . NETCAT_TRASH_FILTER_SUBDIVISION . "</td>\n              <td class='right' colspan='2'>\n              <select  name='options[sub]' class='select'>\n              <option value='0'>" . NETCAT_TRASH_FILTER_ALL . "</option>";
        foreach ($subs as $id => $v) {
            $html .= "<option value='" . $id . "' " . ($options['sub'] == $id ? "selected='selected'" : "") . ">" . $id . ". " . $v['name'] . "</option>\r\n";
        }
        $html .= "\n              </select>\n              </td>\n              </tr><tr>";
    }
    if (!empty($classes)) {
        $html .= "\n              <td class='left'>" . NETCAT_TRASH_FILTER_COMPONENT . "</td>\n              <td class='right' colspan='2'>\n              <select  name='options[class_id]' class='select'>\n              <option value='0'>" . NETCAT_TRASH_FILTER_ALL . "</option>";
        foreach ($classes as $id => $v) {
            if ($id) {
                $html .= "<option value='" . $id . "' " . ($options['class_id'] == $id ? "selected='selected'" : "") . ">" . $id . ". " . $v['name'] . "</option>\r\n";
            }
        }
        $html .= "\n              </select>\n              </td>\n              </tr>";
    }
    $html .= "\n        </table>\n        <div style='text-align:right; padding-right:30px'>\n            <input style='background: #EEE; padding: 8px 6px 12px 6px; font-size: 15px; color: #333; border: 2px solid #1A87C2;' type='submit' class='s' value='" . NETCAT_TRASH_FILTER_APPLY . "' title='" . NETCAT_TRASH_FILTER_APPLY . "' />\n      </form>\n    </fieldset>\n  </div>";
    return $html;
}
コード例 #5
0
ファイル: crontasks.inc.php プロジェクト: Blu2z/implsk
function CronForm($CronID)
{
    global $db, $Cron_Minutes, $Cron_Hours, $Cron_Days, $Cron_Script_URL;
    global $UI_CONFIG, $nc_core;
    if ($CronID) {
        $rs = $db->get_row("SELECT * FROM CronTasks WHERE Cron_ID='" . intval($CronID) . "' LIMIT 1", ARRAY_A);
    }
    ?>
    <form method=post action=crontasks.php>

        <font color=gray>
      <?php 
    echo TOOLS_CRON_MINUTES;
    ?>
:&nbsp;<?php 
    echo nc_admin_input_simple('Cron_Minutes', $rs['Cron_Minutes'], 2, '', "maxlength='3'");
    ?>
&nbsp;&nbsp;
      <?php 
    echo TOOLS_CRON_HOURS;
    ?>
:&nbsp;<?php 
    echo nc_admin_input_simple('Cron_Hours', $rs['Cron_Hours'], 2, '', "maxlength='3'");
    ?>
&nbsp;&nbsp;
  <?php 
    echo TOOLS_CRON_DAYS;
    ?>
:&nbsp;<?php 
    echo nc_admin_input_simple('Cron_Days', $rs['Cron_Days'], 2, '', "maxlength='3'");
    ?>
<br><br>
  <!--  <?php 
    echo TOOLS_CRON_MONTHS;
    ?>
:<br><?php 
    echo nc_admin_input_simple('Cron_Months', $rs['Cron_Months'], 70, '', "maxlength='255'");
    ?>
<br><br>
  <?php 
    echo TOOLS_CRON_WEEKDAYS;
    ?>
:<br><?php 
    echo nc_admin_input_simple('Cron_Weekdays', $rs['Cron_Weekdays'], 70, '', "maxlength='255'");
    ?>
<br><br> -->
  <?php 
    echo TOOLS_CRON_SCRIPTURL;
    ?>
:<br><?php 
    echo nc_admin_input_simple('Cron_Script_URL', $rs['Cron_Script_URL'], 70, '', "maxlength='255'");
    ?>
        <hr size=1 color=cccccc>

        <?php 
    if (!$CronID) {
        print "<input type=hidden name=phase value=2>";
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => TOOLS_REDIRECT_ADDONLY, "action" => "mainView.submitIframeForm()");
    } else {
        ?>
            <input type=hidden name=CronID value=<?php 
        echo $CronID;
        ?>
>
        <input type=hidden name=phase value=5>

        <input type='submit' class='hidden'>
        <?php 
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_SAVE, "action" => "mainView.submitIframeForm()");
    }
    print $nc_core->token->get_input();
    print "</form>";
}
コード例 #6
0
ファイル: wizard.inc.php プロジェクト: Blu2z/implsk
function nc_site_wizard_main_sub_form($phase, $site_id)
{
    global $db, $UI_CONFIG;
    $site_id = intval($site_id);
    $site = $db->get_row("SELECT Title_Sub_ID,\n  \t\t                       E404_Sub_ID,\n  \t\t                       Template_ID\n  \t\t                  FROM Catalogue\n  \t\t                 WHERE Catalogue_ID = '" . $site_id . "'", ARRAY_A);
    $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);
    $inherit_template = $db->get_row("SELECT a.Template_ID,\n  \t\t                                   b.Description as TemplateName\n  \t\t                              FROM Catalogue as a,\n  \t\t                                   Template as b\n  \t\t                             WHERE Catalogue_ID = '" . $site_id . "' AND\n  \t\t                                   b.Template_ID = a.Template_ID", ARRAY_A);
    echo "<form method='post' action='wizard_site.php'>\n";
    echo "<fieldset>\n";
    echo "<legend>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_TITLEPAGE . "</legend>\n";
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_NAME . ":<br>\n";
    echo nc_admin_input_simple('TitleSubIDName', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_TITLEPAGE_PAGE) . "<br><br>\n";
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_KEYWORD . ":<br>\n";
    echo nc_admin_input_simple('TitleSubIDKeyword', 'index') . "<br><br>\n";
    if (!empty($templates)) {
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE . ":<br>\n";
        echo "<select name='TitleTemplateID'>\n";
        echo "<option " . ($site['Template_ID'] ? "" : "selected ") . "value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE_N . " [" . $inherit_template['Template_ID'] . ". " . $inherit_template['TemplateName'] . "]</option>";
        echo nc_select_options($templates, $site['Title_Sub_ID']);
        echo "</select><br>\n";
    } else {
        echo CONTROL_TEMPLATE_NONE;
    }
    echo "</fieldset>\n";
    echo "<fieldset>\n";
    echo "<legend>" . CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NOTFOUND . "</legend>\n";
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_NAME . ":<br>\n";
    echo nc_admin_input_simple('E404SubIDName', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_NOTFOUND_PAGE) . "<br><br>\n";
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_KEYWORD . ":<br>\n";
    echo nc_admin_input_simple('E404SubIDKeyword', '404') . "<br><br>\n";
    if (!empty($templates)) {
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE . ":<br>\n";
        echo "<select name='E404TemplateID'>\n";
        echo "<option " . ($site['Template_ID'] ? "" : "selected ") . "value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE_N . " [" . $inherit_template['Template_ID'] . ". " . $inherit_template['TemplateName'] . "]</option>";
        echo nc_select_options($templates, $site['Title_Sub_ID']);
        echo "</select><br>\n";
    } else {
        echo CONTROL_TEMPLATE_NONE;
    }
    echo "</fieldset>\n";
    // Создание разделов для модулей
    /*
     $modules = $db->get_results("SELECT Keyword,
     Module_Name
     FROM Module
     ORDER BY Keyword", ARRAY_A);
    
     if ($modules) {
     echo "<fieldset>\n";
     echo "<legend>".WIZARD_SITE_FORM_WHICH_MODULES."</legend>\n";
     foreach ($modules as $module) {
     echo "<input type='checkbox' name='modules[".$module['Keyword']."]' value='1'>&nbsp;".constant($module['Module_Name'])."<br>\n";
     }
     echo "</fieldset><br>\n";
     }
    */
    echo "<input type='hidden' name='posting' value='1'>";
    echo "<input type='hidden' name='phase' value='" . $phase . "'>";
    echo "<input type='hidden' name='CatalogueID' value='" . $site_id . "'>";
    echo "<input type='submit' class='hidden'>";
    echo "</form>\n";
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => WIZARD_SITE_BUTTON_ADD_SUBS, "action" => "mainView.submitIframeForm()");
}
コード例 #7
0
ファイル: function.inc.php プロジェクト: Blu2z/implsk
/**
 * 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;
}
コード例 #8
0
ファイル: function.inc.php プロジェクト: Blu2z/implsk
function echo_widget_form($params, $alter = 0, $action = '')
{
    global $ADMIN_PATH, $db;
    if ($action) {
        $action = "action='{$ADMIN_PATH}{$action}'";
    }
    if (!$alter) {
        $html .= "\n            <legend>" . WIDGETS_PARAMS . "</legend>" . "<form id='adminForm' class='nc-form' method='post' {$action}><br />" . "" . WIDGET_ADD_NAME . ":<br />" . nc_admin_input_simple('Name', isset($params['Name']) ? $params['Name'] : '', 50) . "<br /><br />" . "" . WIDGET_ADD_KEYWORD . ":<br />" . nc_admin_input_simple('Keyword', isset($params['Keyword']) ? $params['Keyword'] : '', 50) . "<br /><br />";
    }
    $widgets = $db->get_results("SELECT `Widget_Class_ID` AS value, CONCAT(`Widget_Class_ID`, '. ', `Name`) AS description, `Category` AS optgroup FROM `Widget_Class` WHERE `InDevelop`='0' ORDER BY `Category`, `Widget_Class_ID`", ARRAY_A);
    $html .= "" . WIDGET_ADD_WK . ":<br />" . "<select name='Widget_Class_ID' id='Widget_Class_ID' onchange='nc_widget_obj.change();return false;'>";
    if (!empty($widgets)) {
        $html .= nc_select_options($widgets, isset($params['Widget_Class_ID']) ? $params['Widget_Class_ID'] : '');
    }
    $html .= "</select><br /><br /><div id='widget_fields'></div>";
    if ($params) {
        foreach ($params as $param_name => $param_value) {
            if (nc_substr($param_name, 0, 1) == 'f') {
                // и в fieldNNN и в f_XXXXXX первая буква f
                $old_values .= "&" . urlencode($param_name) . "=" . urlencode($param_value);
            }
        }
        if ($old_values) {
            $html .= "<input type='hidden' id='__old_values' value='" . $old_values . "&old_widget_class_id=" . urlencode($params['Widget_Class_ID']) . "'>";
        }
    }
    if (!$alter) {
        echo $html;
    } else {
        return $html;
    }
}
コード例 #9
0
ファイル: function.inc.php プロジェクト: Blu2z/implsk
/**
 * Вывод формы ввода данных для активации
 *
 */
function nc_activation_show_form()
{
    global $nc_core, $UI_CONFIG;
    // показ формы активации по ссылке (например, когда срок уже истек)
    $not_ia = (isset($_GET['not_ia']) ? $_GET['not_ia'] : $_POST['not_ia']) + 0;
    $system_settings = $nc_core->get_settings();
    $html = '';
    if ($not_ia) {
        $html .= '<style>body {padding: 20px;}</style>';
        $html .= nc_print_status(sprintf(NETCAT_DEMO_NOTICE, $system_settings['VersionNumber']), 'error', null, true);
    }
    $html .= nc_print_status(TOOLS_ACTIVATION_FORM, 'info', null, true);
    // activation form
    $html .= "<form name='adminForm' id='adminForm' class='nc-form' method='post' action='activation.php'>\n          <table border='0'>\n             <tr><td>" . CONTROL_SETTINGSFILE_BASIC_REGCODE . ":</td>\n                 <td>" . nc_admin_input_simple('license', $_POST['license'] ? $_POST['license'] : $system_settings['ProductNumber'], 8, '', "maxlength='8'") . "</td></tr>\n             <tr><td>" . TOOLS_ACTIVATION_CODE . ":</td>\n                 <td>" . nc_admin_input_simple('activation_code', $_POST['activation_code'] ? $_POST['activation_code'] : $system_settings['Code'], 28, '', "maxlength='28'") . "</td></tr>\n           </table>\n          <input type='hidden' name='phase' value='2' />\n          <input type='hidden' name='not_ia' value='" . $not_ia . "' />\n          <input type='submit' class='hidden' />\n          " . ($not_ia ? "<tr><td colspan='2' align='center'><input type='submit' value='" . TOOLS_ACTIVATION_VERB . "' title='" . TOOLS_ACTIVATION_VERB . "' style='background: #1A87C2; color: #FFF; padding: 5px; border: none;' /></td></tr>" : "") . "\n          </form><br />";
    $html .= TOOLS_ACTIVATION_DESC;
    echo $html;
    // ui_config
    $UI_CONFIG->actionButtons[] = array("id" => "activation", "caption" => TOOLS_ACTIVATION_VERB, "action" => "mainView.submitIframeForm()");
    return 0;
}
コード例 #10
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 
}
コード例 #11
0
ファイル: settings.inc.php プロジェクト: Blu2z/implsk
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 
}
コード例 #12
0
ファイル: classificator.inc.php プロジェクト: Blu2z/implsk
function ImportClassificator_modal()
{
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    $s_t0 = $s_t1 = $s_t2 = $s_d0 = $s_d1 = "";
    if ($SortType == 0) {
        $s_t0 = ' selected';
    }
    if ($SortType == 1) {
        $s_t1 = ' selected';
    }
    if ($SortType == 2) {
        $s_t2 = ' selected';
    }
    if ($SortDirection == 0) {
        $s_d0 = ' selected';
    }
    if ($SortDirection == 1) {
        $s_d1 = ' selected';
    }
    echo nc_get_simple_modal_header(CLASSIFICATORS_IMPORT_HEADER);
    ?>

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

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

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

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

                        </script>





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

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

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

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

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

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

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

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

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

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

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

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

                                                <br>

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

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

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

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

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

                                            </fieldset>
                                        </div>




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

                        <script type="text/javascript" src='<?php 
    echo $ADMIN_PATH;
    ?>
js/user.js'></script>
                        <script type="text/javascript">
                            nc_user_obj = new nc_user_perm();
                            nc_user_obj.setType(<?php 
    echo $AdminType;
    ?>
);
                            nc_user_obj.disable_livetime(<?php 
    echo $unlimit;
    ?>
);
                            nc_user_obj.setStartType(<?php 
    echo $start_time;
    ?>
);
                            nc_user_obj.setEndType(<?php 
    echo $end_time;
    ?>
);
                        </script>
                        <?php 
    if ($UserID) {
        $UI_CONFIG->headerText = CONTROL_USER_RIGHT_ADDPERM . " " . addslashes($user_login);
    } else {
        $UI_CONFIG->headerText = CONTROL_USER_RIGHT_ADDPERM_GROUP . " " . GetPermissionGroupName($PermissionGroupID);
    }
    $UI_CONFIG->actionButtons[] = array("id" => "addright", "caption" => CONTROL_USER_RIGHT_ADDNEWRIGHTS, "action" => "mainView.submitIframeForm()");
}
コード例 #14
0
ファイル: MessageToAll.php プロジェクト: Blu2z/implsk
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 
}
コード例 #15
0
ファイル: subclass.inc.php プロジェクト: Blu2z/implsk
function nc_sub_class_get_objlist($Array)
{
    $checked_html = " checked='checked'";
    $td_checked = " nc-bg-lighten";
    return "\n        <table class='nc-table' id='objlist_table'>\n            <tr>\n                <th style='width:180px'></th>\n                <th class='nc-text-center' style='min-width:80px'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_ACCESS_INHERIT . "</th>\n                <th class='nc-text-center' style='min-width:80px'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_YES . "</th>\n                <th class='nc-text-center' style='min-width:80px'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_NO . "</th>\n            </tr>\n\n            <tr>\n                <td class='col_1 nc-text-right'>\n                    " . CONTROL_CLASS_CLASS_OBJECTSLIST_SHOWOBJ_HTML . "\n                </td>\n                <td class='col_2" . ($Array['AllowTags'] == -1 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='AllowTags' value='-1'" . ($Array['AllowTags'] == -1 ? $checked_html : '') . " /></label>\n                </td>\n                <td class='col_3" . ($Array['AllowTags'] == 1 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='AllowTags' value='1'" . ($Array['AllowTags'] == 1 ? $checked_html : '') . " /></label>\n                </td>\n                <td class='col_4" . ($Array['AllowTags'] == 0 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='AllowTags' value='0'" . ($Array['AllowTags'] == 0 ? $checked_html : '') . " /></label>\n                </td>\n            </tr>\n            <tr>\n                <td class='col_1 nc-text-right'>\n                    " . CONTROL_CLASS_CLASS_OBJECTSLIST_SHOWOBJ_BR . "\n                </td>\n                <td class='col_2" . ($Array['NL2BR'] == -1 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='NL2BR' value='-1'" . ($Array['NL2BR'] == -1 ? $checked_html : '') . " /></label>\n                </td>\n                <td class='col_3" . ($Array['NL2BR'] == 1 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='NL2BR' value='1'" . ($Array['NL2BR'] == 1 ? $checked_html : '') . " /></label>\n                </td>\n                <td class='col_4" . ($Array['NL2BR'] == 0 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='NL2BR' value='0'" . ($Array['NL2BR'] == 0 ? $checked_html : '') . " /></label>\n                </td>\n            </tr>\n            <tr>\n                <td class='col_1 nc-text-right'>\n                    " . CONTROL_CLASS_USE_CAPTCHA . "\n                </td>\n                <td class='col_2" . ($Array['UseCaptcha'] == -1 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='UseCaptcha' value='-1'" . ($Array['UseCaptcha'] == -1 ? $checked_html : '') . " /></label>\n                </td>\n                <td class='col_3" . ($Array['UseCaptcha'] == 1 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='UseCaptcha' value='1'" . ($Array['UseCaptcha'] == 1 ? $checked_html : '') . " /></label>\n                </td>\n                <td class='col_4" . ($Array['UseCaptcha'] == 0 ? $td_checked : '') . "'>\n                    <label class='nc--blocked nc-text-center'><input type='radio' name='UseCaptcha' value='0'" . ($Array['UseCaptcha'] == 0 ? $checked_html : '') . " /></label>\n                </td>\n            </tr>\n        </table>\n        <br>\n        <div>\n            " . CONTROL_CLASS_CLASS_OBJECTSLIST_SHOW . "\n            " . nc_admin_input_simple('RecordsPerPage', $Array['RecordsPerPage'], 3, '', "maxlength='32'") . "\n            " . CONTROL_CLASS_CLASS_OBJECTSLIST_SHOWOBJ . "\n        </div>\n        <br>\n        <div>\n            " . CONTROL_CLASS_CLASS_OBJECTSLIST_SORT . ":\n        </div>\n\n        <div>\n            " . nc_admin_input_simple('SortBy', $Array['SortBy'], 50, '', "maxlength='255'") . "\n        </div>";
}
コード例 #16
0
ファイル: site_info.php プロジェクト: Blu2z/implsk
        </style>
    </head>
    <body bgcolor="#FFFFFF">
        <?php 
print "<h1>" . htmlspecialchars($_GET['url']) . "</h1>";
?>
        <script type="text/javascript" src="audit.js"></script>
        <form id="siteAuditForm" onsubmit="audit_start(); return false;">
            <div id='nc_site_seo_form'>
                <div class='nc_clear'></div>
                <div id='nc_site_seo'>
    <?php 
echo NETCAT_MODULE_AUDITOR_URL;
?>
 &nbsp; <?php 
echo nc_admin_input_simple("url", $_GET['url'], 20, '', "id='url_to_audit'");
?>
                </div>
                <div id='nc_site_seo_status'>
                    <div id='please_wait_div' style='display:none'><?php 
echo NETCAT_MODULE_AUDITOR_WAIT;
?>
 <a href='javascript:audit_stop()'><?php 
echo NETCAT_MODULE_AUDITOR_STOP;
?>
</a></div>
                    <div id='loading_done' style='display:none'><?php 
echo NETCAT_MODULE_AUDITOR_DONE;
?>
</div>
                </div>
コード例 #17
0
ファイル: function.inc.php プロジェクト: Blu2z/implsk
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.inc.php プロジェクト: Blu2z/implsk
/**
 * Функция рисует форму редактирования макета дизайна через fron-end
 *
 * @param unknown_type $TemplateID
 * @param unknown_type $File_Mode
 */
function TemplateForm_for_modal($TemplateID, $File_Mode)
{
    global $ROOT_FOLDER, $HTTP_FILES_PATH, $DOMAIN_NAME;
    global $systemTableID, $systemMessageID, $systemTableName;
    global $ParentTemplateID, $admin_mode;
    global $INCLUDE_FOLDER;
    global $UI_CONFIG, $ADMIN_PATH;
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    if ($File_Mode) {
        $template_editor = new nc_template_editor($nc_core->TEMPLATE_FOLDER, $nc_core->db);
    }
    $TemplateID = intval($TemplateID);
    $params = array('Description', 'Settings', 'Header', 'Footer', 'CustomSettings', 'ParentTemplateID');
    foreach ($params as $v) {
        global ${$v};
    }
    $st = new nc_Component(0, 4);
    foreach ($st->get_fields(0, 0) as $v) {
        $v = 'f_' . $v;
        ${$v} = $nc_core->input->fetch_get_post($v);
    }
    require_once $INCLUDE_FOLDER . "s_files.inc.php";
    $is_there_any_files = getFileCount(0, $systemTableID);
    $SQL = "SELECT `Description`, `Settings`, `Header`, `Footer`, `CustomSettings`\n\t\tFROM `Template`\n\t\tWHERE `Template_ID` = " . $TemplateID;
    $Array = $db->get_row($SQL, ARRAY_A);
    if ($File_Mode) {
        $template_editor->load_template($TemplateID);
        $template_editor->fill_fields();
        $new_template = $template_editor->get_standart_fields();
        $Array = array_merge($Array, $new_template);
    }
    if ($GLOBALS["AJAX_SAVER"]) {
        ?>
		<script>
			var formAsyncSaveEnabled = true;
			var NETCAT_HTTP_REQUEST_SAVING = "<?php 
        echo str_replace('"', "&quot;", NETCAT_HTTP_REQUEST_SAVING);
        ?>
";
			var NETCAT_HTTP_REQUEST_SAVED  = "<?php 
        echo str_replace('"', "&quot;", NETCAT_HTTP_REQUEST_SAVED);
        ?>
";
			var NETCAT_HTTP_REQUEST_ERROR  = "<?php 
        echo str_replace('"', "&quot;", NETCAT_HTTP_REQUEST_ERROR);
        ?>
";
		</script>
	<?php 
    } else {
        ?>
		<script>var formAsyncSaveEnabled = false;</script>
	<?php 
    }
    ?>

	<div class='nc_admin_form_menu' style='padding-top: 20px;'>
		<h2><?php 
    echo CONTROL_TEMPLATE_EDIT;
    ?>
</h2>
		<div id='nc_object_slider_menu' class='slider_block_2' style='padding-top: 0px; padding-bottom: 15px;'>
			<ul>
				<li id='nc_template_form_edit' class=''></li>
			</ul>
		</div>
		<div class='nc_admin_form_menu_hr'></div>
	</div>

	<div class='nc_admin_form_body nc-admin'>
		<form id='adminForm' class='TemplateForm nc-form' <?php 
    echo $is_there_any_files ? "enctype=multipart/form-data" : "";
    ?>
 method=post action='<?php 
    echo $nc_core->ADMIN_PATH;
    ?>
template/index.php'>
			<input type='hidden' name='fs' value='<?php 
    echo $File_Mode;
    ?>
'>
			<div>
				<div>
					<div>
						<?php 
    echo CONTROL_TEMPLATE_TEPL_NAME;
    ?>
:
					</div>
					<div>
						<?php 
    echo nc_admin_input_simple('Description', $Array["Description"], 50, '', "maxlength='64'");
    ?>
					</div>
				</div>
				<br />
				<div>
					<?php 
    echo nc_admin_textarea_simple('Settings', $Array["Settings"], CONTROL_TEMPLATE_TEPL_MENU . ':', 12, 60, "Settings");
    ?>
				</div>
				<br />
				<div>
					<?php 
    echo nc_admin_textarea_simple('Header', $Array["Header"], CONTROL_TEMPLATE_TEPL_HEADER . ':', 20, 60, "TemplateHeader");
    ?>
				</div>
				<br />
				<div>
					<?php 
    echo nc_admin_textarea_simple('Footer', $Array["Footer"], CONTROL_TEMPLATE_TEPL_FOOTER . ':', 20, 60, "TemplateFooter");
    ?>
				</div>
				<br />
				<div id='cstOff' style='cursor: pointer;' onclick='this.style.display="none"; document.getElementById("cstOn").style.display="";'>
					<font color='gray'> &#x25BA; <?php 
    echo CONTROL_TEMPLATE_CUSTOM_SETTINGS;
    ?>
</font>
				</div>
				<div id='cstOn' style='display: none'>
					<font color='gray' style='cursor: pointer;' onclick='document.getElementById("cstOn").style.display="none";document.getElementById("cstOff").style.display="";'> &#x25BC;
						<?php 
    echo CONTROL_TEMPLATE_CUSTOM_SETTINGS;
    ?>
					</font>
					<?php 
    echo nc_admin_textarea_simple('CustomSettings', $Array["CustomSettings"], '', 8, 60, "CustomSettings");
    ?>
				</div>
			</div>
<?php 
    $action = "change";
    $message = $TemplateID;
    require $ROOT_FOLDER . "message_fields.php";
    if ($fldCount) {
        $fieldQuery = '`' . join($fld, "`,`") . '`';
        $fldValue = $db->get_row("SELECT " . $fieldQuery . " FROM `Template` WHERE `Template_ID` = '" . $systemMessageID . "'", ARRAY_N);
        ?>
			<br />
<?php 
        /*
        				<a href=<?= "" . $ADMIN_PATH . "field/index.php?isSys=1&amp;Id=" . $systemTableID ?>><font color=gray><b><?= CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_EXTFIELDS ?></b></font></a>
        */
        ?>
			<table border='0' cellpadding='6' cellspacing='0' width='100%'>
				<tr>
					<td><font color='gray'>
						<?php 
        require $ROOT_FOLDER . "message_edit.php";
        ?>
					</td>
				</tr>
			</table>
			<br />
<?php 
    }
    ?>
			<input type='hidden' name='posting' value='1' />
			<input type='hidden' name='isNaked' value='1' />
			<input type='hidden' name='type' value='2' />
			<input type='hidden' name='phase' value='5' />
			<input type='hidden' name='TemplateID' value='<?php 
    echo $TemplateID;
    ?>
' />
			<input type='hidden' name='ParentTemplateID' value='<?php 
    echo $ParentTemplateID;
    ?>
' />
			<?php 
    echo $nc_core->token->get_input();
    ?>
            <?php 
    if ($nc_core->get_settings('TextareaResize')) {
        ?>
            <script type="text/javascript">bindTextareaResizeButtons();</script>
            <?php 
    }
    ?>
		</form>
<?php 
    echo include_cd_files();
    ?>

	</div>

	<div class='nc_admin_form_buttons'>
        <button type='button' class='nc_admin_metro_button nc-btn nc--blue' disable><?php 
    echo NETCAT_REMIND_SAVE_SAVE;
    ?>
</button>
        <button type='button' class='nc_admin_metro_button_cancel nc-btn nc--red nc--bordered nc--right'><?php 
    echo CONTROL_BUTTON_CANCEL;
    ?>
</button>
	</div>

	<style>
		a { color:#1a87c2; }
		a:hover { text-decoration:none; }
		a img { border:none; }
		p { margin:0px; padding:0px 0px 18px 0px; }
		h2 { font-size:20px; font-family:'Segoe UI', SegoeWP, Arial; color:#333333; font-weight:normal; margin:0px; padding:20px 0px 10px 0px; line-height:20px; }
		form { margin:0px; padding:0px; }
		input { outline:none; }
		.clear { margin:0px; padding:0px; font-size:0px; line-height:0px; height:1px; clear:both; float:none; }
		select, input, textarea { border:1px solid #dddddd; }
		:focus { outline:none;}
		.input { outline:none; border:1px solid #dddddd; }
	</style>

	<script>
		var nc_admin_metro_buttons = $nc('.nc_admin_metro_button');
		$nc(function() {
			$nc('#adminForm').html('<div class="nc_admin_form_main">' + $nc('#adminForm').html() + '</div>');
		});
		nc_admin_metro_buttons.click(function() {
			$nc('#adminForm').submit();
		});
		$nc('.nc_admin_metro_button_cancel').click(function() {
			$nc.modal.close();
		});
	</script>
<?php 
}
コード例 #19
0
ファイル: subdivision_add_form.php プロジェクト: Blu2z/implsk
            $watch_templ = $db->get_row("SELECT a.Template_ID, b.Description as TemplateName  FROM Catalogue as a, Template as b WHERE Catalogue_ID=" . $catalogue_id . " AND b.Template_ID=a.Template_ID", ARRAY_A);
            break;
            // exit from loop
        }
    }
} else {
    $watch_templ = $db->get_row("SELECT a.Template_ID, b.Description as TemplateName FROM Catalogue as a, Template as b WHERE Catalogue_ID=" . $catalogue_id . " AND b.Template_ID=a.Template_ID", ARRAY_A);
}
#/выясним, какой макет наследовать
echo "<br>";
echo "<fieldset>\n";
echo "<legend>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_ADDSECTION . "</legend>\n";
echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_NAME . ":<br>\n";
echo nc_admin_input_simple('Subdivision_Name', '', 50, '', "maxlength='255'") . "<br><br>\n";
echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_KEYWORD . ":<br>\n";
echo nc_admin_input_simple('EnglishName', '', 50, '', "maxlength='255'") . "<br><br>\n";
if (!empty($templates)) {
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE . ":<br>\n";
    echo "<select name='TemplateID'>\n";
    echo "<option " . ($subdivision['Parent_Sub_ID'] ? "" : "selected ") . "value='0'>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE_N . " [" . $watch_templ['Template_ID'] . ". " . $watch_templ['TemplateName'] . "]</OPTION>";
    echo nc_select_options($templates, $site['Title_Sub_ID']);
    echo "</select><br>";
} else {
    echo CONTROL_TEMPLATE_NONE;
}
echo "<br>\n";
if (!empty($classes)) {
    echo CONTROL_CLASS_CLASS . ":<br>\n";
    echo "<select name='ClassID'>\n";
    echo "<option value='0'>" . NOT_ELSEWHERE_SPECIFIED . "</option>\n";
    echo nc_select_options($classes);