function createProductMenu() { prod_menu = menuMgr.createMenu(rs('new_prod_menu')); prod_menu.applyBorder(false, false, false, false); prod_menu.dropShadow("none"); prod_menu.showIcon = true; prod_menu.addItem(rs('product.type.'),'','javascript:new_product();'); } a_toolbar.AddButton( new ToolBarButton( 'new_item', '::', function() { renderMenus(); nls_showMenu(rs('new_prod_menu'), a_toolbar.GetButtonImage('new_item')); }, true ) ); function new_product($type) { $form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form'; set_hidden_field('_new_type', $type); std_precreate_item($Catalog.ActivePrefix, $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'edit_template')); var $kf = document.getElementById($form_name); var $prev_action = $kf.action; $kf.action = ''; set_hidden_field('remove_specials[' + $Catalog.ActivePrefix + ']', 1); std_precreate_item( $Catalog.ActivePrefix, $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'edit_template'), function() { $kf.action = $prev_action; } ); } createProductMenu();
" view_template="in-commerce/catalog_tab" edit_template="in-commerce/products/products_edit" category_id="-1" dep_buttons="new_item" class="catalog-tab">
$Catalog.setItemCount('', ''); $Catalog.setItemCount('', ''); $Catalog.setCurrentCategory('', ); $Catalog.saveSearch('', '', ''); / Grids[''].AddAlternativeGrid('', true); Grids[''].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); $Catalog.reflectPasteButton(); $Catalog.setViewMenu(''); Grids[''].DblClick = function() {return false}; #separator# _new_type" id="_new_type" value="">