Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1160710
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Sep 19, 1:17 PM
Size
48 KB
Mime Type
text/x-diff
Expires
Sun, Sep 21, 1:17 PM (2 h, 39 m)
Engine
blob
Format
Raw Data
Handle
750006
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js
===================================================================
--- branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js (revision 5528)
@@ -0,0 +1,264 @@
+var $is_catalog = true;
+
+function Catalog($url_mask, $cookie_prefix) {
+ this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
+ this.BusyRequest = new Array();
+ this.URLMask = $url_mask;
+ this.Separator = '#separator#';
+ this.ParentCategoryID = 0;
+
+ this.TabRegistry = new Array();
+ this.ActivePrefix = getCookie(this.CookiePrefix + 'active_prefix');
+ this.PreviousPrefix = this.ActivePrefix;
+ $ViewMenus = new Array('c');
+}
+
+Catalog.prototype.Init = function () {
+ var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix');
+ if ($prefix !== this.ActivePrefix && this.TabRegistry.length > 1) {
+ // ActivePrefix not set or has non-existing prefix value
+ this.ActivePrefix = this.TabRegistry[1]['prefix'];
+ }
+ this.SetAlternativeTabs();
+ this.go_to_cat();
+}
+
+Catalog.prototype.SetAlternativeTabs = function () {
+ // set alternative grids between all items (catalog is set when tab is loaded via AJAX first time)
+ var $i = 1;
+ while ($i < this.TabRegistry.length) {
+ // run through all prefixes
+ var $j = 1;
+ while ($j < this.TabRegistry.length) {
+ if (this.TabRegistry[$i]['prefix'] == this.TabRegistry[$j]['prefix']) {
+ $j++;
+ continue;
+ }
+ // and set alternative to all other prefixes
+ $GridManager.AddAlternativeGrid(this.TabRegistry[$i]['prefix'], this.TabRegistry[$j]['prefix']);
+ $j++;
+ }
+ $i++;
+ }
+}
+
+Catalog.prototype.submit_kernel_form = function($tab_id) {
+ var $prefix = 'dummy';
+ var $result_div = '';
+
+ if (isset($tab_id)) {
+ // responce result + progress are required
+ $prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
+ $result_div = $tab_id + '_div';
+ }
+
+ var $kf = document.getElementById($form_name);
+
+ Request.params = Request.serializeForm($kf);
+ Request.method = $kf.method.toUpperCase();
+
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($kf.action, this.BusyRequest[$prefix], $result_div, this.successCallback, this.errorCallback, $result_div, this);
+
+ $form_name = 'kernel_form'; // restore back to main form with current category id of catalog
+};
+
+Catalog.prototype.successCallback = function($request, $params, $object) {
+ var $text = $request.responseText;
+ var $match_redirect = new RegExp('^#redirect#(.*)').exec($text);
+ if ($match_redirect != null) {
+ // redirect to external template requested
+ window.location.href = $match_redirect[1];
+ return false;
+ }
+
+ $params = $params.split(',');
+
+
+ var $js_end = $text.indexOf($object.Separator);
+ if ($js_end != -1) {
+ // allow to detect if output is permitted by ajax request parameters
+ var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n";
+ if ($params[0].length) {
+ document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length);
+ eval($request_visible + $text.substring(0, $js_end));
+ }
+ else {
+ // eval JS only & set mark that js should not use HTML as usual in grids
+ eval($request_visible + $text.substring(0, $js_end));
+ }
+ }
+ else if ($params[0].length) {
+ document.getElementById($params[0]).innerHTML = $text;
+ }
+
+
+ if (typeof($Debugger) != 'undefined') {
+ $Debugger.Clear();
+ }
+}
+
+Catalog.prototype.errorCallback = function($request, $params, $object) {
+ alert('AJAX ERROR: ' + Request.getErrorHtml($request));
+}
+
+Catalog.prototype.submit_event = function($prefix_special, $event, $t) {
+ var $prev_template = get_hidden_field('t');
+ if (!isset($prefix_special)) $prefix_special = this.getCurrentPrefix();
+ var $tab_id = this.queryTabRegistry('prefix', $prefix_special, 'tab_id');
+
+ $form_name = $tab_id + '_form'; // set firstly, because set_hidden_field uses it
+ if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
+ if (isset($t)) set_hidden_field('t', $t);
+
+ this.submit_kernel_form($tab_id);
+ set_hidden_field('t', $prev_template);
+}
+
+
+Catalog.prototype.go_to_cat = function($cat_id) {
+ if (!isset($cat_id)) {
+ // gets current category
+ $cat_id = get_hidden_field('m_cat_id');
+ }
+ else {
+ // sets new category to kernel_form in case if item tab
+ // loads faster and will check if it's category is same
+ // as parent category of categories list
+
+ if (get_hidden_field('m_cat_id') == $cat_id) {
+ // it's the same category, then don't reload category list
+ return true;
+ }
+ set_hidden_field('m_cat_id', $cat_id);
+ }
+
+ // set all item tabs counters to "?" before quering catagories
+ var $i = 1;
+ while ($i < this.TabRegistry.length) {
+ this.setItemCount(this.TabRegistry[$i]['prefix'], '?');
+ $i++;
+ }
+
+ // query sub categories of $cat_id
+ var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'xml/categories_list').replace('#CATEGORY_ID#', $cat_id);
+
+ var $prefix = this.TabRegistry[0]['prefix'];
+ var $tab_id = this.TabRegistry[0]['tab_id'];
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($url, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div', this);
+ this.switchTab(); // refresh current item tab
+}
+
+
+Catalog.prototype.switchTab = function($prefix) {
+ if (this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix') != this.ActivePrefix) {
+ // active prefix is not registred -> cookie left, but not modules installed/enabled at the moment
+ return false;
+ }
+
+ if (!isset($prefix)) $prefix = this.ActivePrefix;
+
+ if (this.BusyRequest[$prefix]) {
+ alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
+ }
+
+ if (this.ActivePrefix != $prefix) {
+ // hide source tab
+ this.PreviousPrefix = this.ActivePrefix;
+ document.getElementById(this.PreviousPrefix + '_tab').className = 'catalog-tab-unselected';
+ document.getElementById(this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div').style.display = 'none';
+ this.HideDependentButtons(this.PreviousPrefix);
+ }
+
+ // show destination tab
+ this.ActivePrefix = $prefix;
+ document.getElementById(this.ActivePrefix + '_tab').className = 'catalog-tab-selected';
+ var $div_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id') + '_div'; // destination tab
+ document.getElementById($div_id).style.display = 'block';
+ this.ShowDependentButtons(this.ActivePrefix);
+ this.setViewMenu(this.ActivePrefix);
+ setCookie(this.CookiePrefix + 'active_prefix', this.ActivePrefix);
+
+ this.refreshTab($prefix, $div_id);
+}
+
+Catalog.prototype.refreshTab = function($prefix, $div_id) {
+ var $cat_id = get_hidden_field('m_cat_id');
+ var $tab_cat_id = document.getElementById($div_id).getAttribute('category_id');
+ if ($cat_id != $tab_cat_id) {
+ // query tab content only in case if not queried or category don't match
+ var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/catalog_tab');
+ $url = $url.replace('#CATEGORY_ID#', $cat_id);
+
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
+ }
+ /*else {
+ alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'}');
+ }*/
+}
+
+// adds information about tab to tab_registry
+Catalog.prototype.registerTab = function($tab_id) {
+ var $tab = document.getElementById($tab_id + '_div');
+ var $index = this.TabRegistry.length;
+ this.TabRegistry[$index] = new Array();
+ this.TabRegistry[$index]['tab_id'] = $tab_id;
+ this.TabRegistry[$index]['prefix'] = $tab.getAttribute('prefix');
+ this.TabRegistry[$index]['module_path'] = $tab.getAttribute('edit_template').substring(0, $tab.getAttribute('edit_template').indexOf('/'));
+ this.TabRegistry[$index]['view_template'] = $tab.getAttribute('view_template');
+ this.TabRegistry[$index]['edit_template'] = $tab.getAttribute('edit_template');
+ this.TabRegistry[$index]['dep_buttons'] = $tab.getAttribute('dep_buttons').split(',');
+ this.TabRegistry[$index]['index'] = $index;
+}
+
+// allows to get any information about tab
+Catalog.prototype.queryTabRegistry = function($search_key, $search_value, $return_key) {
+ var $i = 0;
+ while ($i < this.TabRegistry.length) {
+ if (this.TabRegistry[$i][$search_key] == $search_value) {
+ return this.TabRegistry[$i][$return_key];
+ break;
+ }
+ $i++;
+ }
+ return false;
+}
+
+Catalog.prototype.ShowDependentButtons = function($prefix) {
+ var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
+ var $i = 0;
+ while ($i < $dep_buttons.length) {
+ a_toolbar.ShowButton($dep_buttons[$i]);
+ $i++;
+ }
+}
+
+Catalog.prototype.HideDependentButtons = function($prefix) {
+ var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
+ var $i = 0;
+ while ($i < $dep_buttons.length) {
+ a_toolbar.HideButton($dep_buttons[$i]);
+ $i++;
+ }
+}
+
+Catalog.prototype.setItemCount = function($prefix, $count) {
+ setInnerHTML($prefix + '_item_count', $count);
+}
+
+Catalog.prototype.getCurrentPrefix = function() {
+ if (isset(Grids[this.ActivePrefix]) && (Grids[this.ActivePrefix].SelectedCount > 0)) {
+ // item tab grid exists and some items are selected
+ return this.ActivePrefix;
+ }
+ else {
+ // return prefix of first registred tab -> categories
+ return this.TabRegistry[0]['prefix'];
+ }
+}
+
+Catalog.prototype.setViewMenu = function($item_prefix) {
+ $ViewMenus = isset($item_prefix) ? new Array('c', $item_prefix) : new Array('c');
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/incs/catalog.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.27
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.27.2/kernel/admin/include/navmenu.php
===================================================================
--- branches/unlabeled/unlabeled-1.27.2/kernel/admin/include/navmenu.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.27.2/kernel/admin/include/navmenu.php (revision 5528)
@@ -0,0 +1,393 @@
+<?php
+##############################################################
+## In-portal :: Section & Navigation Structure Library ##
+##############################################################
+## In-portal ##
+## Intechnic Corporation ##
+## All Rights Reserved, 1998-2002 ##
+## ##
+## No portion of this code may be copied, reproduced or ##
+## otherwise redistributed without proper written ##
+## consent of Intechnic Corporation. Violation will ##
+## result in revocation of the license and support ##
+## privileges along maximum prosecution allowed by law.. ##
+##############################################################
+
+$module_images = 'kernel/admin_templates/img';
+
+$objSections->AddSection("in-portal:install","la_tab_Install","la_title_Install",$admin."/", "",
+ $admin."/images/icon_install.gif","",
+ NULL,"in-portal:site",NULL,null,0,"",1,NULL,NULL,NULL,"");
+
+
+// Catalog - browse data tree items
+$objSections->AddSection("in-portal:browse","la_tab_Browse","la_title_Browse",$admin."/", "browse.php",
+ $admin."/icons/icon46_catalog.gif",$admin."/icons/icon24_catalog.gif",
+ NULL,"in-portal:site",NULL,"in-portal:advanced_view",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_catalog.gif");
+
+// Advanced View
+$objSections->AddSection("in-portal:advanced_view","la_tab_AdvancedView","la_title_AdvancedView",$admin."/", "advanced_view.php",
+ $admin."/icons/icon46_advanced_view.gif",$admin."/icons/icon24_advanced_view.gif",
+ NULL,"in-portal:site",NULL,"in-portal:reviews",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_advanced_view.gif");
+
+// Pending Reviews
+$objSections->AddSection("in-portal:reviews","la_tab_Reviews","la_title_Reviews",$admin."/", "reviews.php",
+ $admin."/icons/icon46_reviews.gif",$admin."/icons/icon24_reviews.gif",
+ NULL,"in-portal:site",NULL,"in-portal:configure_categories",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_reviews.gif");
+
+$objSections->AddSection("in-portal:configure_categories", "la_tab_Settings", "la_tab_Settings",
+ $admin."/config/", "edit_config.php?&module=In-Portal§ion=in-portal:configure_categories",
+// $admin.'/index4.php?section=in-portal:configure_categories&module=In-Portal','kernel4:config/config_universal',
+ $admin."/icons/icon46_cat_settings.gif", $admin."/icons/icon24_cat_settings.gif",
+ NULL, "in-portal:site","in-portal:advanced_view", "in-portal:configuration_search",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_cat_settings.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:configuration_search", "la_tab_ConfigSearch", "la_tab_ConfigSearch",
+ $admin.'/index4.php?module=In-Portal§ion=in-portal:configuration_search&module_key=category','kernel4:config/config_search',
+ $admin."/icons/icon46_settings_search.gif",$admin."/icons/icon24_settings_search.gif",
+ NULL, "in-portal:site", "in-portal:configure_categories","in-portal:configuration_email",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_search.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:configuration_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/",
+ "module_email.php?&module=In-Portal:Category§ion=in-portal:configuration_email&lpn=1",
+ $admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
+ NULL,"in-portal:site", "in-portal:configuration_search", "in-portal:configuration_custom",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:configuration_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin.'/index4.php',
+ 'kernel4:custom_fields/custom_fields_list:cf----1-',
+ $admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
+ NULL, "in-portal:site", "in-portal:configuration_email", NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
+
+/* check datatype either 1 or 0 */
+
+$objSections->AddSection("in-portal:tools","la_tab_Tools","la_title_Tools",$admin."/","subitems.php",
+ $admin."/icons/icon46_tools.gif",$admin."/icons/icon24_tools.gif",
+ "in-portal:backup","in-portal:root","in-portal:system","in-portal:help",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_tools.gif","la_section_overview");
+
+$objSections->AddSection("in-portal:backup","la_tab_Backup","la_tab_Backup",$admin."/backup/","backup1.php",
+ $admin."/icons/icon46_tool_backup.gif",$admin."/icons/icon24_tool_backup.gif",
+ NULL,"in-portal:tools",NULL,"in-portal:restore",0,"",1,
+ NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_backup.gif","la_performing_backup");
+
+$objSections->AddSection("in-portal:backup_toolbar","la_tab_Backup","la_tab_Backup",NULL,NULL,
+ $admin."/icons/icon46_tool_backup.gif",$admin."/icons/icon24_tool_backup.gif",
+ NULL,NULL,NULL,NULL,0,"",1,
+ NULL,NULL,NULL,NULL);
+
+$objSections->AddSection("in-portal:restore_toolbar",NULL,NULL,NULL,NULL,
+ NULL,NULL,
+ NULL,NULL,NULL,NULL,0,"",1,
+ NULL,NULL,NULL,NULL);
+
+
+$objSections->AddSection("in-portal:restore","la_tab_Restore","la_tab_Restore",$admin."/backup/","restore1.php",
+ $admin."/icons/icon46_tool_restore.gif",$admin."/icons/icon24_tool_restore.gif",
+ NULL,"in-portal:tools","in-portal:backup","in-portal:export",0,"",1,
+ NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_restore.gif","la_performing_restore");
+
+$objSections->AddSection("in-portal:export","la_tab_ExportData","la_tab_ExportData",$admin."/backup/","export1.php",
+ $admin."/icons/icon46_tool_export.gif",$admin."/icons/icon24_tool_export.gif",
+ NULL,"in-portal:tools","in-portal:restore","in-portal:main_import",0,"",1,
+ NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_export.gif","la_performing_export");
+
+ $objSections->AddSection("in-portal:main_import","la_tab_ImportData","la_tab_ImportData",$admin."/import/","step1.php",
+ $admin."/icons/icon46_tool_import.gif",$admin."/icons/icon24_tool_import.gif",
+ NULL,"in-portal:tools","in-portal:export","in-portal:sql_query",1,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_tool_import.gif","la_performing_import");
+
+ $objSections->AddSection("in-portal:sql_query","la_tab_QueryDB","la_tab_QueryDB",$admin."/tools/","sql_query.php",
+ $admin."/icons/icon46_tool_import.gif",$admin."/icons/icon24_tool_import.gif",
+ NULL,"in-portal:tools","in-portal:inlink_inport","in-portal:server_info",0,"",1,
+ NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_import.gif","la_running_query");
+
+ $objSections->AddSection("in-portal:server_info","la_tab_ServerInfo","la_tab_ServerInfo",$admin."/tools/","server_info.php",
+ $admin."/icons/icon46_server_info.gif",$admin."/icons/icon24_server_info.gif",
+ NULL,"in-portal:tools","in-portal:sql_query",NULL,0,"",1,
+ NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_server_info.gif","la_tab_ServerInfo");
+
+$objSections->AddSection("in-portal:system","la_tab_Sys_Config","la_title_Sys_Config",$admin."/","subitems.php",
+ $admin."/icons/icon46_conf.gif",$admin."/icons/icon24_conf.gif",NULL,
+ "in-portal:root","in-portal:reports","in-portal:tools",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_conf.gif","la_section_overview");
+
+$objSections->AddSection("in-portal:tag_library","la_tab_TagLibrary","la_tab_TagLibrary",$admin."/","tag_listing.php",
+ $admin."/icons/icon46_modules.gif",$admin."/icons/icon24_modules.gif",
+ NULL,NULL,NULL,NULL,0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_modules.gif","la_tag_library");
+
+/* system configuration tree items */
+$objSections->AddSection("in-portal:configure_general", "la_tab_General", "la_tab_General", $admin."/config/",
+ "edit_config.php?&module=In-Portal§ion=in-portal:configure_general",
+ $admin."/icons/icon46_conf_general.gif", $admin."/icons/icon24_conf_general.gif",
+ NULL, "in-portal:system", NULL, "in-portal:configure_themes",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_conf_general.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:configure_themes", "la_tab_Themes", "la_tab_Themes", $admin."/config/","config_theme.php",
+ $admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
+ NULL, "in-portal:system", "in-portal:configure_general", "in-portal:configure_styles",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_conf_themes.gif");
+
+$objSections->AddSection( "in-portal:template_editor",
+ "la_tab_Themes",
+ "la_tab_Themes",
+ '',
+ '',
+ $admin."/icons/icon46_conf_themes.gif",
+ $admin."/icons/icon24_conf_themes.gif",
+ NULL, NULL, NULL, NULL, 1,'',1,
+ 0,1,0,$admin."/icons/icon46_list_conf_themes.gif");
+
+
+$objSections->AddSection("in-portal:configure_styles", "la_tab_Stylesheets", "la_tab_Stylesheets",
+ $admin.'/index4.php','kernel4:stylesheets/stylesheets_list.tpl',
+ $module_images.'/icons/icon46_style.gif', $module_images.'/icons/icon24_style.gif',
+ NULL, "in-portal:system", "in-portal:configure_themes", 'in-portal:configure_lang',0,"",1,
+ NULL,NULL,NULL,$module_images.'/icons/icon46_list_style.gif');
+
+$objSections->AddSection("in-portal:configure_lang", "la_tab_Regional", "la_tab_Regional",
+ $admin.'/index4.php','kernel4:regional/languages_list.tpl',
+ $admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
+ NULL, "in-portal:system", "in-portal:configure_lang", NULL,0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_conf_regional.gif");
+
+/* theme tabs */
+
+$objSections->AddSection("in-portal:theme_general", "la_tab_General", NULL, $admin."/config/",
+ "javascript:edit_submit('theme','ThemeEditStatus','".$admin."/config/addtheme.php',0);",
+ $admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
+ NULL, "in-portal:configure_themes", NULL, "in-portal:theme_templates",-1);
+
+$objSections->AddSection("in-portal:theme_templates", "la_tab_Templates", NULL, $admin."/config/",
+ "javascript:edit_submit('theme','ThemeEditStatus','".$admin."/config/addtheme_templates.php',0);",
+ $admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
+ NULL, "in-portal:configure_themes", "in-portal:theme_general",NULL,-1);
+
+/*Community Section tree items */
+$objSections->AddSection("in-portal:user_list","la_tab_User_List","la_tab_User_List",$admin."/users/","user_list.php?resetpage=1",
+ $admin."/icons/icon46_users.gif",$admin."/icons/icon24_users.gif",
+ NULL, "in-portal:users", NULL, "in-portal:user_groups",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_users.gif");
+
+$objSections->AddSection("in-portal:user_groups","la_tab_User_Groups","la_tab_User_Groups", $admin."/users/", "user_groups.php?resetpage=1", $admin."/icons/icon46_usergroups.gif",$admin."/icons/icon24_usergroups.gif",
+ NULL, "in-portal:users", "in-portal:user_list","in-portal:configure_users",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_usergroups.gif");
+
+$objSections->AddSection("in-portal:configure_users", "la_tab_ConfigSettings", "la_tab_ConfigSettings", $admin."/config/",
+ "edit_config.php?&module=In-Portal:Users§ion=in-portal:configure_users",
+ $admin."/icons/icon46_users_settings.gif", $admin."/icons/icon24_users_settings.gif",
+ NULL, "in-portal:users","in-portal:user_groups", "in-portal:user_email",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_users_settings.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:user_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/",
+ "module_email.php?&module=In-Portal:Users§ion=in-portal:user_email&lpn=1",
+ $admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
+ NULL,"in-link", "in-portal:configure_users", "in-portal:user_custom",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:user_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin.'/index4.php',
+ 'kernel4:custom_fields/custom_fields_list:cf----6-',
+ $admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
+ NULL, "in-portal:users", "in-portal:user_email", "in-portal:user_banlist",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
+
+$objSections->AddSection("in-portal:user_banlist","la_tab_BanList","la_tab_UserBanList",$admin."/config/",
+ "edit_banlist.php?§ion=in-portal:user_banlist&DataType=6",
+ $admin."/icons/icon46_banlist.gif",$admin."/icons/icon24_banlist.gif",
+ NULL, "in-portal:users", "in-portal:user_custom",NULL,0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_banlist.gif","la_updating_rules");
+
+/*Edit Category Section*/
+$home_category = $objSession->GetVariable('IsHomeCategory');
+
+if(!$home_category) {
+ $objSections->AddSection("in-portal:editcategory_general","la_tab_General",NULL,$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory.php',0, '&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, "in-portal:browse",NULL, "in-portal:editcategory_items",-1);
+
+$objSections->AddSection("in-portal:editcategory_items","la_tab_Properties",NULL, $admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/index4_direct.php',0, '&t=category/category_items&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,"in-portal:browse","in-portal:editcategory_general","in-portal:editcategory_relations",-1);
+
+ $objSections->AddSection("in-portal:editcategory_relations","la_tab_Relations",NULL, $admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0, '&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,"in-portal:browse","in-portal:editcategory_items","in-portal:editcategory_images",-1);
+
+ $objSections->AddSection("in-portal:editcategory_images","la_tab_Images", NULL,$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0, '&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, "in-portal:browse", "in-portal:editcategory_relations", "in-portal:editcategory_permissions",-1);
+
+
+ $objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',0, '&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, "in-portal:browse", 'in-portal:editcategory_images', 'in-portal:editcategory_custom', -1);
+
+ $objSections->AddSection("in-portal:editcategory_custom", "la_tab_Custom", NULL, $admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_custom.php',0, '&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", NULL,
+ "in-portal:browse", "in-portal:editcategory_permissions", NULL,-1);
+}
+else {
+ $objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',0, '&prefix=c');",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, "in-portal:browse", null, null, -1);
+}
+
+/* category edit subitems */
+$objSections->AddSection("in-portal:cat_imageedit","la_tab_Images","la_title_edit_category",$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addimage.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+$objSections->AddSection("in-portal:editcategory_relation","la_tab_Relations","la_title_edit_category",$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addrelation.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+/* permission edit subtabs */
+$objSections->AddSection("in-portal:catperm_modules","la_tab_Permissions","la_title_edit_category",$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+$objSections->AddSection("in-portal:catperm_setperm","la_tab_Permissions","la_title_edit_category",$admin."/category/",
+ "javascript:edit_submit('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+
+/*user list toolbar - edit user*/
+
+
+/*$objSections->AddSection("in-portal:user_rule_edit","la_tab_UserBan","la_title_edit_ban",$admin."/users/",
+ "javascript:edit_submit('rule','RuleEditStatus','".$admin."/config/edit_banlist.php',1,'$addSection&DataType=6');",
+ $admin."/icons/icon46_banlist.gif", $admin."/icons/icon24_banlist.gif",
+ NULL, NULL, NULL,NULL,-1);*/
+
+$objSections->AddSection("in-portal:edituser_general", "la_tab_General", NULL, $admin."/users/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, "in-portal:user_list", NULL, 'in-portal:edituser_groups',-1);
+
+$objSections->AddSection("in-portal:edituser_groups", "la_tab_Groups", NULL, $admin."/users/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_groups.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, "in-portal:user_list", "in-portal:edituser_general", "in-portal:edituser_images",-1);
+
+$objSections->AddSection("in-portal:edituser_images", "la_tab_Images", NULL, $admin."/users/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_images.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, "in-portal:user_list", "in-portal:edituser_groups", "in-portal:edituser_permissions",-1);
+
+$objSections->AddSection("in-portal:edituser_permissions", "la_tab_Permissions", NULL, $admin."/users/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_permissions.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, "in-portal:user_list", "in-portal:edituser_images", "in-portal:edituser_items",-1);
+
+$objSections->AddSection("in-portal:edituser_items", "la_tab_Items", NULL, $admin."/users/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_items.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, "in-portal:user_list", "in-portal:edituser_permissions", "in-portal:edituser_custom",-1);
+
+
+$objSections->AddSection("in-portal:edituser_custom","la_tab_Custom", NULL, $admin."/users/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_custom.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, "in-portal:user_list", "in-portal:edituser_permissions", NULL,-1);
+
+/* user edit subitems */
+$objSections->AddSection("in-portal:edituser_image","la_tab_Images","la_title_edit_user",$admin."/category/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_addimage.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+$objSections->AddSection("in-portal:edituser_group","la_tab_Images","la_title_edit_user",$admin."/category/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_editgroup.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, NULL, NULL,NULL,-1,'',1);
+
+$objSections->AddSection("in-portal:edituser_permission","la_tab_Permissions","la_title_edit_user",$admin."/category/",
+ "javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_addpermission.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+/* group list toolbar - edit group */
+
+$objSections->AddSection("in-portal:editgroup_general", "la_tab_General",NULL, $admin."/users/",
+ "javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup.php',0);",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
+ NULL, "in-portal:user_groups", NULL, "in-portal:editgroup_users",-1);
+
+$objSections->AddSection("in-portal:editgroup_users", "la_tab_Users", NULL,$admin."/users/",
+ "javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_users.php',0)",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
+ NULL, "in-portal:user_groups", "in-portal:editgroup_general","in-portal:editgroup_permissions",-1);
+
+$objSections->AddSection("in-portal:editgroup_permissions", "la_tab_Permissions", NULL,$admin."/users/",
+ "javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/index4_direct.php', 0, '&t=groups/groups_edit_permissions&prefix=g')",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
+ NULL, "in-portal:user_groups", "in-portal:editgroup_users",NULL,-1);
+
+/* reports tree items */
+/*
+
+*/
+
+//$notree=0,$onClick = "",$notabs=0,$nonavbar=0,$notitle=0,$toolbar=0
+$objSections->AddSection("in-portal:editcategory_relationselect","la_tab_Category_RelationSelect",
+ "la_title_Category_RelationSelect", $admin."/","relation_select.php",$admin."/icons/icon46_navigate.gif",
+ $admin."/icons/icon24_navigate.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
+
+$objSections->AddSection("in-portal:catselect","la_tab_Category_Select","la_title_Category_Select",
+ $admin."/","relation_select.php",$admin."/icons/icon46_navigate.gif",$admin."/icons/icon24_navigate.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
+
+$objSections->AddSection("in-portal:groupselect","la_tab_GroupSelect","la_title_GroupSelect",
+ $admin."/users","group_select.php",
+ $admin."/icons/icon46_navigate.gif",$admin."/icons/icon24_usergroups.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
+
+$objSections->AddSection("in-portal:userselect","la_tab_UserSelect","la_title_UserSelect",
+ $admin."/users","user_select.php",
+ $admin."/icons/icon46_community.gif",$admin."/icons/icon24_usergroups.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
+
+$objSections->AddSection("in-portal:phrase_editor","la_tab_Label","la_title_Label",
+ $admin."/config","edit_label.php",
+ $admin."/icons/icon46_conf_regional.gif",$admin."/icons/icon24_conf_regional.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
+
+$objSections->AddSection("in-portal:sendmail","la_tab_SendMail","la_title_SendMail",
+ $admin."/email","sendmail.php",
+ $admin."/icons/icon46_conf_regional.gif",$admin."/icons/icon24_conf_regional.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
+
+$objSections->AddSection("in-portal:user_rule_edit","la_tab_UserBan","la_tab_UserBan",
+ $admin."/users","addrule.php",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,0,1);
+
+
+$objSections->AddSection("in-portal:banuser","la_Text_BanUserFields","la_Text_BanUserFields",
+ $admin."/users","banuser.php",
+ $admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
+ NULL,NULL,NULL,NULL,-1,"",1,0,0,1);
+
+$objSections->AddSection("in-portal:editreview_direct", "la_tab_Reviews", null,"",
+ "",
+ $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, null, null, null, 1, '', 1, 0, 1);
+
+$objSections->AddSection("in-portal:visits","la_tab_Visits","la_title_Visits",$admin."/index4.php","kernel4:visits/visits_list",
+ $module_images."/icons/icon46_visits.gif",$module_images."/icons/icon24_visits.gif",
+ NULL,"in-portal:reports",NULL,NULL,0,"",1,NULL,NULL,NULL,$module_images."/icons/icon46_list_visits.gif");
+
+
+?>
Property changes on: branches/unlabeled/unlabeled-1.27.2/kernel/admin/include/navmenu.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.27
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js
===================================================================
--- branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js (revision 5528)
@@ -0,0 +1,264 @@
+var $is_catalog = true;
+
+function Catalog($url_mask, $cookie_prefix) {
+ this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
+ this.BusyRequest = new Array();
+ this.URLMask = $url_mask;
+ this.Separator = '#separator#';
+ this.ParentCategoryID = 0;
+
+ this.TabRegistry = new Array();
+ this.ActivePrefix = getCookie(this.CookiePrefix + 'active_prefix');
+ this.PreviousPrefix = this.ActivePrefix;
+ $ViewMenus = new Array('c');
+}
+
+Catalog.prototype.Init = function () {
+ var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix');
+ if ($prefix !== this.ActivePrefix && this.TabRegistry.length > 1) {
+ // ActivePrefix not set or has non-existing prefix value
+ this.ActivePrefix = this.TabRegistry[1]['prefix'];
+ }
+ this.SetAlternativeTabs();
+ this.go_to_cat();
+}
+
+Catalog.prototype.SetAlternativeTabs = function () {
+ // set alternative grids between all items (catalog is set when tab is loaded via AJAX first time)
+ var $i = 1;
+ while ($i < this.TabRegistry.length) {
+ // run through all prefixes
+ var $j = 1;
+ while ($j < this.TabRegistry.length) {
+ if (this.TabRegistry[$i]['prefix'] == this.TabRegistry[$j]['prefix']) {
+ $j++;
+ continue;
+ }
+ // and set alternative to all other prefixes
+ $GridManager.AddAlternativeGrid(this.TabRegistry[$i]['prefix'], this.TabRegistry[$j]['prefix']);
+ $j++;
+ }
+ $i++;
+ }
+}
+
+Catalog.prototype.submit_kernel_form = function($tab_id) {
+ var $prefix = 'dummy';
+ var $result_div = '';
+
+ if (isset($tab_id)) {
+ // responce result + progress are required
+ $prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
+ $result_div = $tab_id + '_div';
+ }
+
+ var $kf = document.getElementById($form_name);
+
+ Request.params = Request.serializeForm($kf);
+ Request.method = $kf.method.toUpperCase();
+
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($kf.action, this.BusyRequest[$prefix], $result_div, this.successCallback, this.errorCallback, $result_div, this);
+
+ $form_name = 'kernel_form'; // restore back to main form with current category id of catalog
+};
+
+Catalog.prototype.successCallback = function($request, $params, $object) {
+ var $text = $request.responseText;
+ var $match_redirect = new RegExp('^#redirect#(.*)').exec($text);
+ if ($match_redirect != null) {
+ // redirect to external template requested
+ window.location.href = $match_redirect[1];
+ return false;
+ }
+
+ $params = $params.split(',');
+
+
+ var $js_end = $text.indexOf($object.Separator);
+ if ($js_end != -1) {
+ // allow to detect if output is permitted by ajax request parameters
+ var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n";
+ if ($params[0].length) {
+ document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length);
+ eval($request_visible + $text.substring(0, $js_end));
+ }
+ else {
+ // eval JS only & set mark that js should not use HTML as usual in grids
+ eval($request_visible + $text.substring(0, $js_end));
+ }
+ }
+ else if ($params[0].length) {
+ document.getElementById($params[0]).innerHTML = $text;
+ }
+
+
+ if (typeof($Debugger) != 'undefined') {
+ $Debugger.Clear();
+ }
+}
+
+Catalog.prototype.errorCallback = function($request, $params, $object) {
+ alert('AJAX ERROR: ' + Request.getErrorHtml($request));
+}
+
+Catalog.prototype.submit_event = function($prefix_special, $event, $t) {
+ var $prev_template = get_hidden_field('t');
+ if (!isset($prefix_special)) $prefix_special = this.getCurrentPrefix();
+ var $tab_id = this.queryTabRegistry('prefix', $prefix_special, 'tab_id');
+
+ $form_name = $tab_id + '_form'; // set firstly, because set_hidden_field uses it
+ if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
+ if (isset($t)) set_hidden_field('t', $t);
+
+ this.submit_kernel_form($tab_id);
+ set_hidden_field('t', $prev_template);
+}
+
+
+Catalog.prototype.go_to_cat = function($cat_id) {
+ if (!isset($cat_id)) {
+ // gets current category
+ $cat_id = get_hidden_field('m_cat_id');
+ }
+ else {
+ // sets new category to kernel_form in case if item tab
+ // loads faster and will check if it's category is same
+ // as parent category of categories list
+
+ if (get_hidden_field('m_cat_id') == $cat_id) {
+ // it's the same category, then don't reload category list
+ return true;
+ }
+ set_hidden_field('m_cat_id', $cat_id);
+ }
+
+ // set all item tabs counters to "?" before quering catagories
+ var $i = 1;
+ while ($i < this.TabRegistry.length) {
+ this.setItemCount(this.TabRegistry[$i]['prefix'], '?');
+ $i++;
+ }
+
+ // query sub categories of $cat_id
+ var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'xml/categories_list').replace('#CATEGORY_ID#', $cat_id);
+
+ var $prefix = this.TabRegistry[0]['prefix'];
+ var $tab_id = this.TabRegistry[0]['tab_id'];
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($url, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div', this);
+ this.switchTab(); // refresh current item tab
+}
+
+
+Catalog.prototype.switchTab = function($prefix) {
+ if (this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix') != this.ActivePrefix) {
+ // active prefix is not registred -> cookie left, but not modules installed/enabled at the moment
+ return false;
+ }
+
+ if (!isset($prefix)) $prefix = this.ActivePrefix;
+
+ if (this.BusyRequest[$prefix]) {
+ alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
+ }
+
+ if (this.ActivePrefix != $prefix) {
+ // hide source tab
+ this.PreviousPrefix = this.ActivePrefix;
+ document.getElementById(this.PreviousPrefix + '_tab').className = 'catalog-tab-unselected';
+ document.getElementById(this.queryTabRegistry('prefix', this.PreviousPrefix, 'tab_id') + '_div').style.display = 'none';
+ this.HideDependentButtons(this.PreviousPrefix);
+ }
+
+ // show destination tab
+ this.ActivePrefix = $prefix;
+ document.getElementById(this.ActivePrefix + '_tab').className = 'catalog-tab-selected';
+ var $div_id = this.queryTabRegistry('prefix', this.ActivePrefix, 'tab_id') + '_div'; // destination tab
+ document.getElementById($div_id).style.display = 'block';
+ this.ShowDependentButtons(this.ActivePrefix);
+ this.setViewMenu(this.ActivePrefix);
+ setCookie(this.CookiePrefix + 'active_prefix', this.ActivePrefix);
+
+ this.refreshTab($prefix, $div_id);
+}
+
+Catalog.prototype.refreshTab = function($prefix, $div_id) {
+ var $cat_id = get_hidden_field('m_cat_id');
+ var $tab_cat_id = document.getElementById($div_id).getAttribute('category_id');
+ if ($cat_id != $tab_cat_id) {
+ // query tab content only in case if not queried or category don't match
+ var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/catalog_tab');
+ $url = $url.replace('#CATEGORY_ID#', $cat_id);
+
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id, this);
+ }
+ /*else {
+ alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'}');
+ }*/
+}
+
+// adds information about tab to tab_registry
+Catalog.prototype.registerTab = function($tab_id) {
+ var $tab = document.getElementById($tab_id + '_div');
+ var $index = this.TabRegistry.length;
+ this.TabRegistry[$index] = new Array();
+ this.TabRegistry[$index]['tab_id'] = $tab_id;
+ this.TabRegistry[$index]['prefix'] = $tab.getAttribute('prefix');
+ this.TabRegistry[$index]['module_path'] = $tab.getAttribute('edit_template').substring(0, $tab.getAttribute('edit_template').indexOf('/'));
+ this.TabRegistry[$index]['view_template'] = $tab.getAttribute('view_template');
+ this.TabRegistry[$index]['edit_template'] = $tab.getAttribute('edit_template');
+ this.TabRegistry[$index]['dep_buttons'] = $tab.getAttribute('dep_buttons').split(',');
+ this.TabRegistry[$index]['index'] = $index;
+}
+
+// allows to get any information about tab
+Catalog.prototype.queryTabRegistry = function($search_key, $search_value, $return_key) {
+ var $i = 0;
+ while ($i < this.TabRegistry.length) {
+ if (this.TabRegistry[$i][$search_key] == $search_value) {
+ return this.TabRegistry[$i][$return_key];
+ break;
+ }
+ $i++;
+ }
+ return false;
+}
+
+Catalog.prototype.ShowDependentButtons = function($prefix) {
+ var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
+ var $i = 0;
+ while ($i < $dep_buttons.length) {
+ a_toolbar.ShowButton($dep_buttons[$i]);
+ $i++;
+ }
+}
+
+Catalog.prototype.HideDependentButtons = function($prefix) {
+ var $dep_buttons = this.queryTabRegistry('prefix', $prefix, 'dep_buttons');
+ var $i = 0;
+ while ($i < $dep_buttons.length) {
+ a_toolbar.HideButton($dep_buttons[$i]);
+ $i++;
+ }
+}
+
+Catalog.prototype.setItemCount = function($prefix, $count) {
+ setInnerHTML($prefix + '_item_count', $count);
+}
+
+Catalog.prototype.getCurrentPrefix = function() {
+ if (isset(Grids[this.ActivePrefix]) && (Grids[this.ActivePrefix].SelectedCount > 0)) {
+ // item tab grid exists and some items are selected
+ return this.ActivePrefix;
+ }
+ else {
+ // return prefix of first registred tab -> categories
+ return this.TabRegistry[0]['prefix'];
+ }
+}
+
+Catalog.prototype.setViewMenu = function($item_prefix) {
+ $ViewMenus = isset($item_prefix) ? new Array('c', $item_prefix) : new Array('c');
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.27.2/core/admin_templates/js/catalog.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.27
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment