recallObject('PermissionsHelper'); if ($perm_helper->TagPermissionCheck(Array('permissions' => 'PRODUCT.VIEW'), 'in-commerce/admin/include/toolbar/browse.php')) { $session =& $application->recallObject('Session'); $products_list =& $application->recallObject('p', 'p_List'); $ItemTabs->AddTab(language("la_ItemTab_Products"),"products", $products_list->RecordsCount, 0, $products_list->NoFilterCount); $Products_Paste = $application->RecallVar('p_clipboard') ? 1 : 0; $options = $application->getUnitOption('p','Fields'); $product_types = $options['Type']['options']; print << var Products_Paste = $Products_Paste; PasteButton = PasteButton || Products_Paste; function set_new_product_menu() { window.NewProdMenu = new Menu("new_product"); END; $tpl = 'NewProdMenu.addMenuItem(\'%s\',"new_item(%s,\'p\');", 0);'."\n"; foreach($product_types as $type_id => $label) { echo sprintf($tpl, $application->Phrase($label),$type_id); } print << END1; } ?>