echo '</div>'; } else { include ADMINPATH . 'toolbar.php'; } } // Include the Stylesheet $vm_mainframe->addStyleSheet(VM_THEMEURL . 'admin.styles.css'); $vm_mainframe->addStyleSheet(VM_THEMEURL . 'theme.css'); $vm_mainframe->addScript($mosConfig_live_site . '/components/' . VM_COMPONENT_NAME . '/js/functions.js'); if ($no_menu != 1 && $vmLayout != 'extended') { echo '<table style="width:100%;table-layout:fixed;"><tr><td style="vertical-align:top;">'; include ADMINPATH . 'header.php'; echo '</td>'; } if ($only_page != 1 && $vmLayout == 'extended') { vmCommonHTML::loadExtjs(); $vm_mainframe->addScript($_SERVER['SCRIPT_NAME'] . '?option=' . $option . '&task=extlayout'); $phpscript_url = str_replace('index2.php', 'index3.php', str_replace('index.php', 'index3.php', $_SERVER['SCRIPT_NAME'])); echo '<iframe id="vmPage" src="' . $phpscript_url . '?option=com_virtuemart&page=' . $_SESSION['last_page'] . '&only_page=1&no_menu=1" style="width:100%; height: 100%; overflow:auto; border: none;padding-left:4px;" name="vmPage"></iframe>'; } else { if ($vmLayout == 'extended') { echo '<div id="vm-toolbar"></div>'; if ($no_toolbar != 1) { $bar =& vmToolBar::getInstance('virtuemart'); $bar->render(); } echo '<div id="vmPage">'; } else { echo '<td id="vmPage" style="width:78%;vertical-align:top;">'; } // Load PAGE
/** * The function to handle all default page situations * not responsible for lists! */ function FORMS_MENU_SAVE_CANCEL() { global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $VM_LANG, $product_id, $page, $limitstart, $mosConfig_editor, $vmIcons; $bar =& JToolBar::getInstance('toolbar'); $product_id = vmGet($_REQUEST, 'product_id', 0); $no_menu = vmGet($_REQUEST, 'no_menu', 0); $is_iframe = vmGet($_REQUEST, 'is_iframe', 0); $product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0); $script = ''; $clone_product = vmRequest::getInt('clone_product', 0); if (is_array($product_id)) { $product_id = ""; } // These editor arrays tell the toolbar to load correct "getEditorContents" script parts // This is necessary for WYSIWYG Editors like TinyMCE / mosCE / FCKEditor $editor1_array = array('product.product_form' => 'product_desc', 'shopper.shopper_group_form' => 'shopper_group_desc', 'product.product_category_form' => 'category_description', 'manufacturer.manufacturer_form' => 'mf_desc', 'store.store_form' => 'vendor_store_desc', 'product.product_type_parameter_form' => 'parameter_description', 'product.product_type_form' => 'product_type_description', 'vendor.vendor_form' => 'vendor_store_desc'); $editor2_array = array('store.store_form' => 'vendor_terms_of_service', 'vendor.vendor_form' => 'vendor_terms_of_service'); $editor1 = isset($editor1_array[$page]) ? $editor1_array[$page] : ''; $editor2 = isset($editor2_array[$page]) ? $editor2_array[$page] : ''; if ($no_menu) { vmCommonHTML::loadExtjs(); } $script .= '<script type="text/javascript"> function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == \'cancel\') { submitform( pressbutton ); return; } '; if ($editor1 != '') { if (vmIsJoomla(1.5)) { jimport('joomla.html.editor'); $editor_type = $GLOBALS['mainframe']->getCfg('editor'); if ($editor_type != 'none') { $editor = JEditor::getInstance(); $script .= $editor->getContent($editor1); } } else { ob_start(); getEditorContents('editor1', $editor1); $script .= ob_get_contents(); ob_end_clean(); } } if ($editor2 != '') { if (vmIsJoomla(1.5)) { jimport('joomla.html.editor'); $editor_type = $GLOBALS['mainframe']->getCfg('editor'); if ($editor_type != 'none') { $editor = JEditor::getInstance(); $script .= $editor->getContent($editor2); } } else { ob_start(); getEditorContents('editor2', $editor2); $script .= ob_get_contents(); ob_end_clean(); } } if ($no_menu) { $admin = defined('_VM_IS_BACKEND') ? '/administrator' : ''; $script .= "\n\t\t\t\n // define some private variables\n var dialog, showBtn;\n\n // the second argument is true to indicate file upload.\n YAHOO.util.Connect.setForm(form, true);\n \n var showDialog = function( content ) {\n \tExt.MessageBox.show( { \n \t\ttitle: '" . $VM_LANG->_('PEAR_LOG_NOTICE') . "',\n \t\tmsg: content,\n \t\tautoCreate: true,\n width:400,\n height:180,\n modal: false,\n resizable: false,\n buttons: Ext.MessageBox.OK,\n shadow:true,\n animEl:Ext.get( 'vm-toolbar' )\n });\n setTimeout('Ext.MessageBox.hide()', 3000);\n };\n \n // return a public interface\n var callback = {\n \tsuccess: function(o) {\n \t\t//Ext.DomHelper.insertHtml( document.body, o.responseText );\n \t\tshowDialog( o.responseText );\n \t},\n \tfailure: function(o) {\n \t\tExt.DomHelper.append( document.body, { tag: 'div', id: 'vmLogResult', html: 'Save action failed: ' + o.statusText } );\n \t\tshowDialog( o.responseText );\n \t},\n upload : function(o){\n //Ext.DomHelper.insertHtml( 'beforeEnd', document.body, o.responseText );\n \t\tshowDialog( o.responseText );\n }\n };\n \n \tvar cObj = YAHOO.util.Connect.asyncRequest('POST', '{$_SERVER['PHP_SELF']}', callback);\n\t\n\t\t\t\n"; } else { $script .= "\n\t\t\tsubmitform( pressbutton );\n"; } $script .= "\t\t}\n\t\t</script>"; $bar->appendButton('Custom', $script); vmMenuBar::startTable(); if ($page == "product.product_form" && !empty($product_id) && $clone_product != 1) { if (empty($product_parent_id)) { // add new attribute $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_attribute_form&product_id=" . $product_id . "&limitstart=" . $limitstart . "&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_ATTRIBUTE_FORM_MNU'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); } else { // back to parent product $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_RETURN_LBL'); vmMenuBar::customHref($href, $vmIcons['back_icon'], $vmIcons['back_icon2'], $alt); vmMenuBar::spacer(); // new child product $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ADD_ANOTHER_ITEM_MNU'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); } // Go to Price list $href = $_SERVER['PHP_SELF'] . "?page=product.product_price_list&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&return_args=&option=com_virtuemart&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_PRICE_LIST_MNU'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); // add product type $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_product_type_form&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_PRODUCT_PRODUCT_TYPE_FORM_MNU'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); /*** Adding an item is only pssible, if the product has attributes ***/ if (ps_product::product_has_attributes($product_id)) { // Add Item $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_id}&limitstart={$limitstart}&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_NEW_ITEM_LBL'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); } vmMenuBar::divider(); } elseif ($page == "admin.country_form") { if (!empty($_REQUEST['country_id'])) { $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_state_form&country_id=" . intval($_REQUEST['country_id']) . "&limitstart={$limitstart}&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_ADD_STATE'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_state_list&country_id=" . intval($_REQUEST['country_id']) . "&limitstart={$limitstart}&no_menu={$no_menu}"; $alt = " " . $VM_LANG->_('PHPSHOP_LIST_STATES'); vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt); vmMenuBar::spacer(); vmMenuBar::divider(); } } vmMenuBar::spacer(); vmMenuBar::save('save', $VM_LANG->_('CMN_SAVE')); if ($no_menu == 0) { vmMenuBar::spacer(); vmMenuBar::apply('apply', $VM_LANG->_('E_APPLY')); } if ((strstr(@$_SERVER['HTTP_REFERER'], $page) || strstr(@$_SERVER['HTTP_REFERER'], $_SERVER['PHP_SELF'])) && $no_menu && !$is_iframe) { // offer a back button vmMenuBar::spacer(); vmMenuBar::back(); } vmMenuBar::spacer(); vmMenuBar::cancel(); vmMenuBar::spacer(); vmMenuBar::endTable(); }
/** * Renders the Ext Toolbar for VirtueMart * means: it assembles the javascript to add the buttons/separators/links to the toolbar * */ function render() { if ($this->buttons != '') { vmCommonHTML::loadExtjs(); $toolbarscript = "var renderVMTb = function() {\r\n\t\t\t\tvar vmTb = new Ext.Toolbar({renderTo: \"vm-toolbar\"});\n" . $this->buttons . "\nvmTb.addSeparator();\n vmTb.addButton({text: '<div style=\"float:left;background: url(" . VM_THEMEURL . "images/administration/menu/icon-16-reload.png) 50% 0 no-repeat;height:17px;width:17px;\" border=\"0\" alt=\"" . $GLOBALS['VM_LANG']->_('RELOAD') . "\"> </div>" . $GLOBALS['VM_LANG']->_('RELOAD') . "', handler: new Function('location.reload();') });\r\n\t\t\t\t};\r\n\t\t\t\tif( Ext.isIE6 || Ext.isIE7 ) {\r\n\t\t\t\t\tExt.EventManager.addListener( window, 'load', renderVMTb );\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tExt.onReady( renderVMTb );\r\n\t\t\t\t}"; echo vmCommonHTML::scriptTag('', $toolbarscript); } // }
/** * Constructor * Includes files needed for displaying tabs and sets cookie options * @param int useCookies, if set to 1 cookie will hold last used tab between page refreshes * @param int show_js, if set to 1 the Javascript Link and Stylesheet will not be printed */ function vmTabPanel($useCookies, $show_js, $panel_id) { vmCommonHTML::loadExtjs(); $this->useCookies = $useCookies; $this->panel_id = $panel_id; $this->tabs = array(); }
function render() { vmCommonHTML::loadExtjs(); if ($this->buttons != '') { $this->buttons = "var vmTb = new Ext.Toolbar('vm-toolbar');\n" . $this->buttons . "\nvmTb.addSeparator();\n vmTb.addButton({text: '<div style=\"float:left;background: url(" . VM_THEMEURL . "images/administration/menu/icon-16-reload.png) 50% 0 no-repeat;height:17px;width:17px;\" border=\"0\" alt=\"" . $GLOBALS['VM_LANG']->_('RELOAD') . "\"> </div>" . $GLOBALS['VM_LANG']->_('RELOAD') . "', handler: new Function('location.reload();') });"; } echo vmCommonHTML::scriptTag('', $this->buttons); }