if (!class_exists("nc_system")) { die; } $ui = $this->get_ui(); $ui->add_settings_toolbar(); $ui->add_submit_button(NETCAT_MODULE_SEARCH_ADMIN_SAVE); $ui->add_back_button(); $rule = $this->data_form('nc_search_rule', 'rules'); if ($this->get_input('copy')) { $rule->load($this->get_input('copy')); // ->set_id(null); } $form_description = array('name' => array('type' => 'string', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_RULE_NAME . ':'), 'site_id' => array('type' => 'select', 'values' => $search_providers, 'subtype' => 'sql', 'sqlquery' => "SELECT `Catalogue_ID` as `id`, " . " CONCAT(`Catalogue_Name`, ' ', IF(LENGTH(`Domain`)>0, CONCAT('(', `Domain`, ')'), '')) as `name`" . " FROM `Catalogue`", 'caption' => NETCAT_MODULE_SEARCH_ADMIN_RULE_SITE . ':', 'default_value' => 1)); $form = new nc_a2f($form_description, "data"); $form->set_value($rule); $area = $rule->get('area_string'); $interval = $rule->get('interval'); $type = $rule->get('interval_type'); $time_input = "<span class='rule_time'>" . "<input type='text' name='data[hour][]' value='" . sprintf("%02d", $rule->get('hour')) . "' maxlength='2' />:" . "<input type='text' name='data[minute][]' value='" . sprintf("%02d", $rule->get('minute')) . "' maxlength='2' />" . "</span>"; $int_input = "<input type='text' class='rule_interval_input' name='data[interval][]' value='{$interval}' />"; ?> <fieldset> <legend><?php echo NETCAT_MODULE_SEARCH_ADMIN_RULE; ?> </legend> <?php echo $form->render("<div>", "", "</div>", ""); ?>
/** * @param $cc_env * @param int $nc_ctpl * @param $type * @return null */ protected function inherit($cc_env, $nc_ctpl = 0, $type) { // system superior object $nc_core = nc_Core::get_object(); if (empty($cc_env)) { global $perm; // error message if (is_object($perm) && $perm->isSupervisor()) { // backtrace info $debug_backtrace_info = debug_backtrace(); // choose error if (isset($debug_backtrace_info[2]['function']) && $debug_backtrace_info[2]['function'] == "nc_objects_list") { // error info for the supervisor trigger_error(sprintf(NETCAT_FUNCTION_OBJECTS_LIST_CC_ERROR, $debug_backtrace_info[2]['args'][1]), E_USER_WARNING); } else { // error info for the supervisor trigger_error(sprintf(NETCAT_FUNCTION_LISTCLASSVARS_ERROR_SUPERVISOR, $cc), E_USER_WARNING); } } return null; } $nc_tpl_in_cc = 0; if ($cc_env['Class_Template_ID'] && !$nc_ctpl) { $nc_tpl_in_cc = $cc_env['Class_Template_ID']; } $class_env = $nc_core->component->get_for_cc($cc_env['Sub_Class_ID'], $cc_env['Class_ID'], $nc_ctpl, $nc_tpl_in_cc, $type); foreach ((array) $class_env as $key => $val) { if (!array_key_exists($key, $cc_env) || $cc_env[$key] == "") { $cc_env[$key] = $val; } } if ($cc_env["NL2BR"] == -1) { $cc_env["NL2BR"] = $class_env["NL2BR"]; } if ($cc_env["AllowTags"] == -1) { $cc_env["AllowTags"] = $class_env["AllowTags"]; } if ($cc_env["UseCaptcha"] == -1) { $cc_env["UseCaptcha"] = $class_env["UseCaptcha"]; } if ($nc_core->modules->get_by_keyword("cache")) { if ($cc_env["CacheForUser"] == -1) { $cc_env["CacheForUser"] = $class_env["CacheForUser"]; } } if ($class_env['CustomSettingsTemplate']) { require_once $nc_core->ADMIN_FOLDER . "array_to_form.inc.php"; $a2f = new nc_a2f($class_env['CustomSettingsTemplate'], 'CustomSettings'); $a2f->set_value($cc_env['CustomSettings']); $cc_env["Sub_Class_Settings"] = $a2f->get_values_as_array(); } $cc_env['sysTbl'] = intval($class_env['System_Table_ID']); $sub_env = $nc_core->subdivision->get_by_id($cc_env["Subdivision_ID"]); $inherited_params = array('Read_Access_ID', 'Write_Access_ID', 'Edit_Access_ID', 'Checked_Access_ID', 'Delete_Access_ID', 'Subscribe_Access_ID', 'Moderation_ID'); if ($nc_core->modules->get_by_keyword("cache")) { $inherited_params[] = 'Cache_Access_ID'; $inherited_params[] = 'Cache_Lifetime'; } foreach ($inherited_params as $v) { if (!$cc_env[$v]) { $cc_env[$v] = $sub_env[$v]; } } $cc_env['Subdivision_Name'] = $sub_env['Subdivision_Name']; $cc_env['Hidden_URL'] = $sub_env['Hidden_URL']; $Domain = $nc_core->catalogue->get_by_id($cc_env['Catalogue_ID'], 'Domain'); $cc_env['Hidden_Host'] = $Domain ? $Domain : $nc_core->DOMAIN_NAME; return $cc_env; }
if ($nc_core->get_settings('QuickBar') && !isset($_GET['rand'])) { $cookie_domain = $nc_core->modules->get_vars('auth', 'COOKIES_WITH_SUBDOMAIN') ? str_replace("www.", "", $nc_core->get_variable("HTTP_HOST")) : NULL; if ($nc_core->input->fetch_cookie('QUICK_BAR_CLOSED') == 0 || $nc_core->input->fetch_cookie('QUICK_BAR_CLOSED') == -1) { require_once $nc_core->get_variable("INCLUDE_FOLDER") . "quickbar.inc.php"; $template_header = nc_quickbar_in_template_header($template_header, $File_Mode); $quick_mode = true; setcookie("QUICK_BAR_CLOSED", -1, time() + $nc_core->get_variable("ADMIN_AUTHTIME"), "/", $cookie_domain); } else { setcookie("QUICK_BAR_CLOSED", 1, time() + $nc_core->get_variable("ADMIN_AUTHTIME"), "/", $cookie_domain); } } } if ($nc_core->template->get_current("CustomSettings") && $nc_core->subdivision->get_current('Template_ID') == $template) { require_once $nc_core->ADMIN_FOLDER . "array_to_form.inc.php"; $nc_a2f = new nc_a2f($nc_core->template->get_current("CustomSettings")); $nc_a2f->set_value($nc_core->subdivision->get_current("TemplateSettings")); $template_settings = $nc_a2f->get_values_as_array(); } if ($nc_core->template->get_current("CustomSettings") && $nc_core->subdivision->get_current('Template_ID') != $template) { require_once $nc_core->ADMIN_FOLDER . "array_to_form.inc.php"; $nc_a2f = new nc_a2f($nc_core->template->get_current("CustomSettings"), array()); $template_settings = $nc_a2f->get_values_as_array(); } if ($nc_core->inside_admin) { // output interface settings (add 'em to the footer before </body>) $UI_CONFIG = new ui_config_objects($cc); $js_code = '".$UI_CONFIG->to_json()."'; if ($template_footer && nc_preg_match("/(<\\/body>)/i", $template_footer, $regs)) { $template_footer = str_replace($regs[1], $js_code . $regs[1], $template_footer); } else { $template_footer .= $js_code;
function ActionForm_for_modal($SubClassID) { global $CatalogueID, $SubdivisionID, $loc, $perm; global $SUB_FOLDER, $HTTP_ROOT_PATH, $MODULE_FOLDER, $ADMIN_FOLDER, $ADMIN_PATH; $nc_core = nc_Core::get_object(); $db = $nc_core->db; $type = 2; $SubdivisionID = $SubdivisionID ? +$SubdivisionID : $nc_core->sub_class->get_by_id($SubClassID, 'Subdivision_ID'); $CatalogueID = $CatalogueID ? +$CatalogueID : $nc_core->subdivision->get_by_id($SubdivisionID, 'Catalogue_ID'); $SubEnv = $nc_core->sub_class->get_by_id($SubClassID); $ClassEnv = $db->get_row("SELECT * FROM `Class` WHERE `Class_ID` = '" . intval($SubEnv["Class_ID"]) . "'", ARRAY_A); if (nc_module_check_by_keyword("cache")) { $cache_select_fields = "s.`Cache_Access_ID`, s.`Cache_Lifetime`, s.`CacheForUser`,"; } else { $cache_select_fields = ""; } $select = "SELECT " . $cache_select_fields . "\n s.`Sub_Class_Name`,\n s.`Subdivision_ID`,\n s.`Priority`,\n s.`Read_Access_ID`,\n s.`Write_Access_ID`,\n s.`Edit_Access_ID`,\n s.`Checked_Access_ID`,\n s.`Delete_Access_ID`,\n s.`Moderation_ID`,\n s.`EnglishName`,\n s.`Checked`,\n s.`Subscribe_Access_ID`,\n s.`DaysToHold`,\n s.`AllowTags`,\n s.`NL2BR`,\n s.`RecordsPerPage`,\n s.`SortBy`,\n s.`Created`,\n s.`LastUpdated`,\n c.`Class_Name`,\n c.`Class_ID`,\n c.`System_Table_ID`,\n s.`DefaultAction`,\n s.`UseCaptcha`,\n c.`CustomSettingsTemplate`,\n s.`CustomSettings`,\n s.`Class_Template_ID`,\n s.`isNaked`,\n s.`SrcMirror`,\n s.`AllowRSS`,\n s.`Edit_Class_Template`\n FROM `Sub_Class` as s,\n `Class` as c\n WHERE `Sub_Class_ID` = " . +$SubClassID . "\n AND c.`Class_ID` = s.`Class_ID`"; $Array = $db->get_row($select, ARRAY_A); if ($db->is_error) { throw new nc_Exception_DB_Error($db->last_query, $db->last_error); } if (empty($Array)) { nc_print_status(CONTROL_CONTENT_CATALOUGE_FUNCS_ERROR_NOSUBCLASS, 'info'); return; } if ($Array['Class_Template_ID']) { $Array['CustomSettingsTemplate'] = $db->get_var("SELECT `CustomSettingsTemplate`\n FROM `Class`\n WHERE `Class_ID` = " . $Array['Class_Template_ID']); } $mobile = $nc_core->catalogue->get_by_id($CatalogueID, 'ncMobile'); $classTemplatesArr = $db->get_results("SELECT `Class_Name`,\n `Class_ID`\n FROM `Class`\n WHERE `ClassTemplate` = '" . $Array['Class_ID'] . "'\n AND `Type` " . (!$mobile ? "IN ('useful', 'title', 'mobile')" : "= 'mobile'"), ARRAY_A); $class_array = nc_get_class_template_array_by_id($Array['Class_Template_ID'] ? $Array['Class_Template_ID'] : $Array['Class_ID']); $edit_class_select = null; if (count($class_array) > 1) { $edit_class_select = nc_get_class_template_form_select_by_array($class_array, $Array['Edit_Class_Template']); } $classInfo = nc_sub_class_get_classInfo($perm, $Array, $classTemplatesArr, $edit_class_select); if ($loc->SubdivisionID) { $wsts = CONTROL_CONTENT_SUBCLASS_ONSECTION; } else { $wsts = CONTROL_CONTENT_SUBCLASS_ONSITE; } $wsts_msg = nc_sub_class_get_wsts_msg($wsts); require_once $ADMIN_FOLDER . "related/format.inc.php"; $field = new field_relation_subclass(); $fieldsets = new nc_admin_fieldset_collection(); $fieldsets->set_prefix(nc_sub_class_get_prefix($SubClassID, $Array)); $fieldsets->set_static_prefix(nc_sub_class_get_style_prefix()); $fieldsets->set_suffix("\n </div>\n " . $nc_core->token->get_input() . "\n <input type='hidden' name='phase' value='4' />\n <input type='hidden' name='SubClassID' value='{$SubClassID}' />\n <input type='hidden' name='SubdivisionID' value='{$loc->SubdivisionID}' />\n <input type='hidden' name='CatalogueID' value='{$loc->CatalogueID}' />\n <input type='submit' style='display: none;' />\n "); $fieldsets->new_fieldset('main_info', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MAININFO)->add(nc_sub_class_get_main_info($Array, $classInfo, $wsts_msg, $field)); $fieldsets->new_fieldset('objlist', CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_HOWSHOW)->add(nc_sub_class_get_objlist($Array)); if ($Array['CustomSettingsTemplate']) { require_once $ADMIN_FOLDER . 'array_to_form.inc.php'; $values = $CustomSettings ? $CustomSettings : $Array['CustomSettings']; $a2f = new nc_a2f($Array['CustomSettingsTemplate'], 'CustomSettings'); $a2f->set_value($values); $fieldsets->new_fieldset('CustomSettings', CONTROL_CONTENT_SUBDIVISION_CUSTOM_SETTINGS_TEMPLATE)->add(nc_sub_class_get_CustomSettings($a2f)); } $fieldsets->new_fieldset('access', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ACCESS)->add(nc_subdivision_show_access($SubEnv)); #$fieldsets->new_fieldset('rss', 'RSS')->add(nc_subclass_show_export('rss', $SubdivisionID, $SubClassID)); #$fieldsets->new_fieldset('xml', 'XML')->add(nc_subclass_show_export('xml', $SubdivisionID, $SubClassID)); if (nc_module_check_by_keyword('cache')) { $fieldsets->new_fieldset('cache', CONTROL_CONTENT_SUBCLASS_FUNCS_CACHE)->add(nc_subdivision_show_cache($SubEnv)); } if (nc_module_check_by_keyword('comments')) { $fieldsets->new_fieldset('comments', CONTROL_CONTENT_SUBCLASS_FUNCS_COMMENTS)->add(nc_subdivision_show_comments($SubEnv)); } echo $fieldsets->to_string(); }
settype($catalogue_id, "integer"); settype($sub_id, "integer"); settype($template_id, "integer"); if ($template_id == 0 || $_REQUEST['is_parent_template'] == 'true') { // наследование print CONTROL_TEMPLATE_CUSTOM_SETTINGS_INHERITED; exit; } $qry_join = ""; if ($catalogue_id && !$sub_id) { $qry_join = "LEFT JOIN Catalogue as this ON (this.Catalogue_ID={$catalogue_id} AND this.Template_ID=t.Template_ID)"; } else { if ($sub_id) { $qry_join = "LEFT JOIN Subdivision as this ON (this.Subdivision_ID={$sub_id} AND this.Template_ID=t.Template_ID)"; } else { trigger_error("No catalogue_id nor sub_id", E_USER_ERROR); } } $tpl_data = $db->get_row("SELECT t.CustomSettings, this.TemplateSettings\n FROM Template as t\n {$qry_join}\n WHERE t.Template_ID={$template_id}", ARRAY_A); if (!$tpl_data['CustomSettings']) { print CONTROL_TEMPLATE_CUSTOM_SETTINGS_NOT_AVAILABLE; exit; } $a2f = new nc_a2f($tpl_data['CustomSettings'], 'TemplateSettings'); $a2f->set_value($tpl_data['TemplateSettings']); // this is only for inside_admin mode $vs_template_header = "<table class='admin_table' style='width: 100%;'><tr><th>%CAPTION</th><th>%VALUE</th><th>%DEFAULT</th></tr>"; $vs_template_object = "<tr><td>%CAPTION </td><td>%VALUE </td><td>%DEFAULT </td></tr>"; $vs_template_footer = "</table>"; $vs_template_divider = "<tr><td colspan='3'>%CAPTION</td></tr>"; print $a2f->render($vs_template_header, $vs_template_object, $vs_template_footer, $vs_template_divider);
<?php if (!class_exists("nc_system")) { die; } $ui = $this->get_ui(); $ui->add_lists_toolbar(); $ui->add_submit_button(NETCAT_MODULE_SEARCH_ADMIN_SAVE); $ui->add_back_button(); $stopword = $this->data_form('nc_search_language_stopword', 'stopwords_save', false); $form_description = array('language' => array('type' => 'select', 'subtype' => 'static', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_LANGUAGE . ':', 'values' => $this->get_language_list(), 'default_value' => nc_Core::get_object()->lang->detect_lang(true)), 'word' => array('type' => 'string', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_STOPWORD_FIELD_CAPTION . ':')); $form = new nc_a2f($form_description, "data"); $form->set_value($stopword); echo "<fieldset><legend>", NETCAT_MODULE_SEARCH_ADMIN_STOPWORD, "</legend>", $form->render("<div>", "", "</div>", ""), "</fieldset>"; ?> <script type="text/javascript"> // :( $nc('form').attr('onsubmit', "return ($nc(this).find(\"input[name='data[word]']\").val().length > 0)"); </script>
<?php if (!class_exists("nc_system")) { die; } $ui = $this->get_ui(); $ui->add_settings_toolbar(); $ui->add_back_button(); $extension = $this->data_form('nc_search_extension_rule', 'extensions'); $registered_providers = $this->get_db()->get_col("SELECT `ExtensionClass` FROM `Search_Extension`" . " WHERE `ExtensionInterface` = 'nc_search_provider'"); $search_providers = array('' => NETCAT_MODULE_SEARCH_ADMIN_SEARCH_PROVIDER_ANY); foreach ($registered_providers as $p) { $search_providers[$p] = $p; } $form_description = array('extension_interface' => array('type' => 'select', 'subtype' => 'static', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_INTERFACE . ':', 'values' => array('nc_search_language_analyzer' => 'nc_search_language_analyzer', 'nc_search_language_corrector' => 'nc_search_language_corrector', 'nc_search_language_filter' => 'nc_search_language_filter', 'nc_search_document_parser' => 'nc_search_document_parser'), 'default_value' => 'nc_search_language_filter'), 'extension_class' => array('type' => 'string', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_CLASS . ':'), 'search_provider' => array('type' => 'select', 'values' => $search_providers, 'caption' => NETCAT_MODULE_SEARCH_ADMIN_SEARCH_PROVIDER . ':', 'default_value' => ' '), 'action' => array('type' => 'select', 'subtype' => 'static', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_ACTION . ':', 'values' => array('' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_ACTION_ANY, 'searching' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_ACTION_SEARCHING, 'indexing' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_ACTION_INDEXING), 'default_value' => ' '), 'language' => array('type' => 'select', 'subtype' => 'static', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_LANGUAGE . ':', 'values' => $this->get_language_list(true), 'default_value' => ' '), 'content_type' => array('type' => 'string', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_CONTENT_TYPE . ':'), 'priority' => array('type' => 'int', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_PRIORITY . ':', 'min' => 0, 'max' => 255, 'default' => 127)); $form = new nc_a2f($form_description, "data"); $form->set_value($extension); echo "<fieldset><legend>", NETCAT_MODULE_SEARCH_ADMIN_EXTENSION, "</legend>", $form->render("<div>", "", "</div>", ""), "<input type='hidden' name='data[enabled]' value='0' />\n", "<div class='extension_cb_row'><input type='checkbox' name='data[enabled]' value='1'", $extension->get('enabled') ? " checked='checked'" : "", " id='cb_enabled' /> <label for='cb_enabled'>", NETCAT_MODULE_SEARCH_ADMIN_EXTENSION_ENABLED, "</label></div>\n", "</fieldset>"; $ui->add_submit_button(NETCAT_MODULE_SEARCH_ADMIN_SAVE);
<?php if (!class_exists("nc_system")) { die; } $ui = $this->get_ui(); $ui->add_lists_toolbar(); $ui->add_submit_button(NETCAT_MODULE_SEARCH_ADMIN_SAVE); $ui->add_back_button(); $synonyms = $this->data_form('nc_search_language_synonyms', 'synonyms'); $form_description = array('language' => array('type' => 'select', 'subtype' => 'static', 'caption' => NETCAT_MODULE_SEARCH_ADMIN_LANGUAGE . ':', 'values' => $this->get_language_list(), 'default_value' => nc_Core::get_object()->lang->detect_lang(true))); $form = new nc_a2f($form_description, "data"); $form->set_value($synonyms); echo "<fieldset><legend>", NETCAT_MODULE_SEARCH_ADMIN_SYNONYMS, "</legend>", $form->render("<div>", "", "</div>", ""), "<div class='ncf_row'><div class='ncf_caption'>", NETCAT_MODULE_SEARCH_ADMIN_SYNONYMS_FIELD_CAPTION, ":</div>", "<div id='synonym_list'></div>", "<div id='add_synonym_row'><span>", nc_admin_img("i_obj_add.gif", NETCAT_MODULE_SEARCH_ADMIN_ADD), NETCAT_MODULE_SEARCH_ADMIN_ADD, "</span></div>", "<div id='synonym_filter_row'><input type='checkbox' name='data[dont_filter]' id='dont_filter' /> ", "<label for='dont_filter'>", NETCAT_MODULE_SEARCH_ADMIN_SYNONYMS_DO_NOT_APPLY_FILTERS, "</label> ", "<span class='inline_help_mark' id='filters_help'>[ ? ]</span>", "<div class='inline_help' id='filters_help_hover'>", NETCAT_MODULE_SEARCH_ADMIN_SYNONYMS_DO_NOT_APPLY_FILTERS_HELP, "</div>", "</div>", "</fieldset>"; ?> <script type="text/javascript"> (function($, words) { var tpl = $("<div class='word'><input type='text' name='data[words][]' />" + "<span class='delete_word'>" + "<?php echo nc_admin_img("delete", NETCAT_MODULE_SEARCH_ADMIN_DELETE); ?> " + "</span>" + "</div>"); var add_word = function(word) { var row = tpl.clone(); row.find("input").val(word || ''); row.find(".delete_word").click(function() { $(this).parent().remove();