function echo_2_reports($caption, $table1, $table2) { $fieldset = new nc_admin_fieldset($caption, 'off'); $fieldset->add("<div style='width:48%;float:left'>\n " . $table1['caption'] . " <i>(" . NETCAT_MODULE_STATS_OPENSTAT_TOP_5 . ")</i><br />\n <table border=0 cellpadding=0 cellspacing=0 width=100%>\n <tr><td bgcolor=cccccc>\n\n <table border=0 cellpadding=4 cellspacing=1 width=100%>\n <tr>\n <td bgcolor=eeeeee width=3%><font size=-2><b>" . $table1['col_captions'][0] . "</font></td>\n <td bgcolor=eeeeee width=3%><font size=-2><b>" . $table1['col_captions'][1] . "</font></td>\n </tr>"); if (isset($table1['val'])) { foreach ($table1['val'] as $val) { $fieldset->add(" <tr>\n <td bgcolor='white'><font size='-2'>" . $val[0] . "</font></td>\n <td bgcolor='white'><font size='-2'>" . $val[1] . "</font></td>\n </tr>"); } } else { $fieldset->add(" <tr>\n <td bgcolor='white' align='center' colspan='2'><font size='-2'><i>(" . NETCAT_MODULE_STATS_OPENSTAT_NO_DATA . ")</i></font></td>\n </tr>"); } $fieldset->add(" </table></td></tr></table>"); if (isset($table1['msg'])) { $fieldset->add("<i>" . $table1['msg'] . "</i>"); } $fieldset->add("</div>"); $fieldset->add("<div style='width:48%;float:right'>\n " . $table2['caption'] . " <i>(" . NETCAT_MODULE_STATS_OPENSTAT_TOP_5 . ")</i><br />\n <table border=0 cellpadding=0 cellspacing=0 width=100%>\n <tr><td bgcolor=cccccc>\n\n <table border=0 cellpadding=4 cellspacing=1 width=100%>\n <tr>\n <td bgcolor=eeeeee width=3%><font size=-2><b>" . $table2['col_captions'][0] . "</font></td>\n <td bgcolor=eeeeee width=3%><font size=-2><b>" . $table2['col_captions'][1] . "</font></td>\n </tr>"); if (isset($table2['val'])) { foreach ($table2['val'] as $val) { $fieldset->add(" <tr>\n <td bgcolor='white'><font size='-2'>" . $val[0] . "</font></td>\n <td bgcolor='white'><font size='-2'>" . $val[1] . "</font></td>\n </tr>"); } } else { $fieldset->add(" <tr>\n <td bgcolor='white' align='center' colspan='2'><font size='-2'><i>(" . NETCAT_MODULE_STATS_OPENSTAT_NO_DATA . ")</i></font></td>\n </tr>"); } $fieldset->add(" </table></td></tr></table>"); if (isset($table2['msg'])) { $fieldset->add("<i>" . $table2['msg'] . "</i>"); } $fieldset->add("</div>"); echo $fieldset->result(); unset($fieldset); }
<?php /* $Id: get_class_custom_settings.php 7620 2012-07-11 12:55:12Z alive $ */ $_POST["NC_HTTP_REQUEST"] = true; $NETCAT_FOLDER = join(strstr(__FILE__, "/") ? "/" : "\\", array_slice(preg_split("/[\\/\\\\]+/", __FILE__), 0, -4)) . (strstr(__FILE__, "/") ? "/" : "\\"); include_once $NETCAT_FOLDER . "vars.inc.php"; require $ADMIN_FOLDER . "function.inc.php"; $custom_settings_template = $db->get_var("SELECT `CustomSettingsTemplate` FROM `Class` WHERE `Class_ID` = '" . (int) $class_id . "'"); if ($custom_settings_template) { require_once $GLOBALS['ADMIN_FOLDER'] . "array_to_form.inc.php"; require $GLOBALS['ADMIN_FOLDER'] . 'subdivision/subclass.inc.php'; $a2f = new nc_a2f($custom_settings_template, 'CustomSettings'); $fieldset = new nc_admin_fieldset(CONTROL_CONTENT_SUBDIVISION_CUSTOM_SETTINGS_TEMPLATE); $fieldset->add(nc_sub_class_get_CustomSettings($a2f)); echo $fieldset->result(); }
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'] . "'> \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&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> \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; }
function show_sites_without_counter_ddlist($counters, $selected_id = NULL) { global $nc_core; if (isset($selected_id)) { $selected_id = intval($selected_id); } $all_catalogues = $nc_core->catalogue->get_all(); $field_common = new nc_admin_fieldset(NETCAT_MODULE_STATS_OPENSTAT_COMMON_SETTINGS); // выбор сайта (CatalogueId) $field_common->add("<p>" . NETCAT_MODULE_STATS_ADMIN_TAB_OPENSTAT_CATALOGUE . "<br />\n <select name='CounterCatalogueId'>"); if (!$counters || $selected_id === 0 || count($counters) == 1 && $selected_id) { $field_common->add("<option selected value='0'>" . NETCAT_MODULE_STATS_OPENSTAT_ALL_SITES . "</option>\n"); } elseif ($selected_id === NULL && (current($counters)->Catalogue_Id == 0 || count($counters) == count($all_catalogues))) { return; } else { foreach ($counters as $counter) { if ($counter->Catalogue_Id != $selected_id) { $used_catalogues[$counter->Catalogue_Id] = $counter->Catalogue_Id; } } } foreach ($all_catalogues as $catalogue) { if (!isset($used_catalogues[$catalogue['Catalogue_ID']])) { $field_common->add("<option " . ($selected_id == $catalogue['Catalogue_ID'] ? "selected " : "") . "value='" . $catalogue['Catalogue_ID'] . "'>" . $catalogue['Catalogue_ID'] . ". " . $catalogue['Catalogue_Name'] . "</option>\n"); } } $field_common->add("</select></p>\n"); return $field_common->result(); }
function nc_subdivision_show_component($catalogue_id = 0) { $nc_core = nc_Core::get_object(); $Class_ID = intval($nc_core->input->fetch_get_post('Class_ID')); $Class_Template_ID = intval($nc_core->input->fetch_get_post('Class_Template_ID')); $CatalogueID = intval($nc_core->input->fetch_get_post('CatalogueID')) ? intval($nc_core->input->fetch_get_post('CatalogueID')) : $catalogue_id; $db = $nc_core->db; $sql = "SELECT `Class_ID` as value, " . "CONCAT(`Class_ID`, '. ', `Class_Name`) as description, " . "`Class_Group` as optgroup " . "FROM `Class` " . "WHERE `ClassTemplate` = 0 AND File_Mode = 0 " . "ORDER BY `Class_Group`, `Priority`, `Class_ID`"; $classesV4 = (array) $db->get_results($sql, ARRAY_A); $sql = "SELECT `Class_ID` as value, " . "CONCAT(`Class_ID`, '. ', `Class_Name`) as description, " . "`Class_Group` as optgroup " . "FROM `Class` " . "WHERE `ClassTemplate` = 0 AND File_Mode = 1 " . "ORDER BY `Class_Group`, `Priority`, `Class_ID`"; $classesV5 = (array) $db->get_results($sql, ARRAY_A); $field_class = new nc_admin_fieldset(CONTROL_USER_FUNCS_CLASSINSECTION); $html = "\t<table border='0' cellpadding='6' cellspacing='0' width='100%'><tr><td>\n"; $html .= "\t<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>\n"; if (!empty($classesV4) || !empty($classesV5)) { $html .= "<font color=gray>" . CONTROL_CLASS_CLASS . ":<br>"; $html .= "<select id='Class_ID' name='Class_ID' onchange='if (this.options[this.selectedIndex].value) {loadClassDescription(this.options[this.selectedIndex].value); loadClassCustomSettings(this.options[this.selectedIndex].value); loadClassTemplates(this.options[this.selectedIndex].value" . ($CatalogueID ? ", 0, " . $CatalogueID : "") . ");}'>"; $html .= "<option value='0'" . (!$Class_ID ? " selected" : "") . ">" . NOT_ELSEWHERE_SPECIFIED . "</option>\n"; if (!empty($classesV5)) { $html .= "<option disabled='disabled'>" . CONTROL_CLASS . " v5</option>\n"; $html .= nc_select_options($classesV5, $Class_ID); } if (!empty($classesV4)) { $html .= "<option disabled='disabled'>" . CONTROL_CLASS . " v4</option>\n"; $html .= nc_select_options($classesV4, $Class_ID); } $html .= "</select>"; $html .= "<div id='loadClassDescription'></div>"; $html .= "<script type='text/javascript'>if (" . ($Class_ID + 0) . ") loadClassDescription(" . $Class_ID . ")</script>"; $html .= "<div id='loadClassTemplates'></div>"; $html .= "<script type='text/javascript'>if (" . ($Class_ID + 0) . ") {loadClassTemplates(" . $Class_ID . ($Class_Template_ID ? ", " . $Class_Template_ID : ", 0") . ($CatalogueID ? ", " . $CatalogueID : "") . ");}</script>"; } else { $html .= CONTROL_CLASS_NONE; } $html .= "\t</table>\n"; $html .= "\t</td></tr></table>\n"; $html .= "</fieldset><br>\n"; if (!empty($classesV4) || !empty($classesV5)) { $html .= "<div id='loadClassCustomSettings'></div>"; $html .= "<script type='text/javascript'>if (" . ($Class_ID + 0) . ") loadClassCustomSettings(" . ($Class_Template_ID ? $Class_Template_ID : $Class_ID) . ")</script>"; } $field_class->add($html); return $field_class->result($html); }