protected function _toHtml() { $javascriptsMain = <<<JAVASCRIPT <script type="text/javascript"> if (typeof ListingGridHandlerObj != 'undefined') { ListingGridHandlerObj.afterInitPage(); } Event.observe(window, 'load', function() { setTimeout(function() { ListingGridHandlerObj.afterInitPage(); }, 350); }); </script> JAVASCRIPT; return parent::_toHtml() . $javascriptsMain; }
protected function _toHtml() { if ($this->getRequest()->isXmlHttpRequest()) { $javascriptsMain = <<<HTML <script type="text/javascript"> EbayListingEbayGridHandlerObj.afterInitPage(); EbayListingEbayGridHandlerObj.getGridMassActionObj().setGridIds('{$this->getGridIdsJson()}'); </script> HTML; return parent::_toHtml() . $javascriptsMain; } // todo next (change) $listingData = Mage::helper('M2ePro/Data_Global')->getValue('temp_data'); /** @var $helper Ess_M2ePro_Helper_Data */ $helper = Mage::helper('M2ePro'); $component = Ess_M2ePro_Helper_Component_Ebay::NICK; // static routes $urls = array('adminhtml_ebay_log/listing' => $this->getUrl('*/adminhtml_ebay_log/listing', array('id' => $listingData['id']))); $path = 'adminhtml_ebay_listing/getEstimatedFees'; $urls[$path] = $this->getUrl('*/' . $path, array('listing_id' => $listingData['id'])); $path = 'adminhtml_ebay_listing/getCategoryChooserHtml'; $urls[$path] = $this->getUrl('*/' . $path, array('listing_id' => $listingData['id'])); $path = 'adminhtml_ebay_listing/getCategorySpecificHtml'; $urls[$path] = $this->getUrl('*/' . $path, array('listing_id' => $listingData['id'])); $path = 'adminhtml_ebay_listing/saveCategoryTemplate'; $urls[$path] = $this->getUrl('*/' . $path, array('listing_id' => $listingData['id'])); $urls = json_encode($urls); $temp = Mage::helper('M2ePro/Data_Session')->getValue('products_ids_for_list', true); $productsIdsForList = empty($temp) ? '' : $temp; $gridId = $component . 'ListingViewGrid' . $listingData['id']; $ignoreListings = json_encode(array($listingData['id'])); $logViewUrl = $this->getUrl('*/adminhtml_ebay_log/listing', array('id' => $listingData['id'], 'back' => $helper->makeBackUrlParam('*/adminhtml_ebay_listing/view', array('id' => $listingData['id'])))); $checkLockListing = $this->getUrl('*/adminhtml_listing/checkLockListing', array('component' => $component)); $lockListingNow = $this->getUrl('*/adminhtml_listing/lockListingNow', array('component' => $component)); $unlockListingNow = $this->getUrl('*/adminhtml_listing/unlockListingNow', array('component' => $component)); $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary'); $runListProducts = $this->getUrl('*/adminhtml_ebay_listing/runListProducts'); $runReviseProducts = $this->getUrl('*/adminhtml_ebay_listing/runReviseProducts'); $runRelistProducts = $this->getUrl('*/adminhtml_ebay_listing/runRelistProducts'); $runStopProducts = $this->getUrl('*/adminhtml_ebay_listing/runStopProducts'); $runStopAndRemoveProducts = $this->getUrl('*/adminhtml_ebay_listing/runStopAndRemoveProducts'); $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...')); $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%task_title%" task has successfully completed.')); // M2ePro_TRANSLATIONS // %task_title%" task has completed with warnings. <a target="_blank" href="%url%">View log</a> for details. $tempString = '"%task_title%" task has completed with warnings. '; $tempString .= '<a target="_blank" href="%url%">View log</a> for details.'; $taskCompletedWarningMessage = $helper->escapeJs($helper->__($tempString)); // M2ePro_TRANSLATIONS // "%task_title%" task has completed with errors. <a target="_blank" href="%url%">View log</a> for details. $tempString = '"%task_title%" task has completed with errors. '; $tempString .= '<a target="_blank" href="%url%">View log</a> for details.'; $taskCompletedErrorMessage = $helper->escapeJs($helper->__($tempString)); $sendingDataToEbayMessage = $helper->escapeJs($helper->__('Sending %product_title% product(s) data on eBay.')); $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.')); $listingLockedMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('The listing was locked by another process. Please try again later.')); $listingEmptyMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing is empty.')); $listingAllItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing All Items On eBay')); $listingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing Selected Items On eBay')); $revisingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Revising Selected Items On eBay')); $relistingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Relisting Selected Items On eBay')); $stoppingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Selected Items On eBay')); $stoppingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping On eBay And Removing From Listing Selected Items')); $selectItemsMessage = $helper->escapeJs($helper->__('Please select the products you want to perform the action on.')); $selectActionMessage = $helper->escapeJs($helper->__('Please select action.')); $successWord = $helper->escapeJs($helper->__('Success')); $noticeWord = $helper->escapeJs($helper->__('Notice')); $warningWord = $helper->escapeJs($helper->__('Warning')); $errorWord = $helper->escapeJs($helper->__('Error')); $closeWord = $helper->escapeJs($helper->__('Close')); $prepareData = $this->getUrl('*/adminhtml_listing_moving/prepareMoveToListing'); $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_ebay_listing_moving/moveToListingGrid'); $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing_moving/getFailedProductsGrid'); $tryToMoveToListing = $this->getUrl('*/adminhtml_listing_moving/tryToMoveToListing'); $moveToListing = $this->getUrl('*/adminhtml_listing_moving/moveToListing'); $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully moved.')); $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Product(s) was not moved. <a target="_blank" href="%url%">View log</a> for details.')); $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some product(s) was not moved. <a target="_blank" href="%url%">View log</a> for details.')); $popupTitle = $helper->escapeJs($helper->__('Moving eBay Items.')); $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move')); $translations = json_encode(array('eBay Categories' => Mage::helper('M2ePro')->__('eBay Categories'), 'Specifics' => Mage::helper('M2ePro')->__('Specifics'), 'Estimated Fee Details' => Mage::helper('M2ePro')->__('Estimated Fee Details'))); $isSimpleViewMode = json_encode(Mage::helper('M2ePro/View_Ebay')->isSimpleMode()); $showAutoAction = json_encode((bool) $this->getRequest()->getParam('auto_actions')); $showMotorNotification = json_encode((bool) $this->isShowMotorNotification()); // M2ePro_TRNSLATIONS // Please check eBay Motors compatibility attribute.You can find it in %menu_label% > Configuration > <a target="_blank" href="%url%">General</a>. $motorNotification = $helper->escapeJs($helper->__('Please check eBay Motors compatibility attribute.' . 'You can find it in %menu_label% > Configuration > <a target="_blank" href="%url%">General</a>.', Mage::helper('M2ePro/View_Ebay')->getMenuRootNodeLabel(), $this->getUrl('*/adminhtml_ebay_configuration'))); $javascriptsMain = <<<HTML <script type="text/javascript"> M2ePro.url.add({$urls}); M2ePro.translator.add({$translations}); M2ePro.productsIdsForList = '{$productsIdsForList}'; M2ePro.url.logViewUrl = '{$logViewUrl}'; M2ePro.url.checkLockListing = '{$checkLockListing}'; M2ePro.url.lockListingNow = '{$lockListingNow}'; M2ePro.url.unlockListingNow = '{$unlockListingNow}'; M2ePro.url.getErrorsSummary = '{$getErrorsSummary}'; M2ePro.url.runListProducts = '{$runListProducts}'; M2ePro.url.runReviseProducts = '{$runReviseProducts}'; M2ePro.url.runRelistProducts = '{$runRelistProducts}'; M2ePro.url.runStopProducts = '{$runStopProducts}'; M2ePro.url.runStopAndRemoveProducts = '{$runStopAndRemoveProducts}'; M2ePro.url.prepareData = '{$prepareData}'; M2ePro.url.getGridHtml = '{$getMoveToListingGridHtml}'; M2ePro.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}'; M2ePro.url.tryToMoveToListing = '{$tryToMoveToListing}'; M2ePro.url.moveToListing = '{$moveToListing}'; M2ePro.text.popup_title = '{$popupTitle}'; M2ePro.text.failed_products_popup_title = '{$failedProductsPopupTitle}'; M2ePro.text.task_completed_message = '{$taskCompletedMessage}'; M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}'; M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}'; M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}'; M2ePro.text.sending_data_message = '{$sendingDataToEbayMessage}'; M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}'; M2ePro.text.listing_locked_message = '{$listingLockedMessage}'; M2ePro.text.listing_empty_message = '{$listingEmptyMessage}'; M2ePro.text.listing_all_items_message = '{$listingAllItemsMessage}'; M2ePro.text.listing_selected_items_message = '{$listingSelectedItemsMessage}'; M2ePro.text.revising_selected_items_message = '{$revisingSelectedItemsMessage}'; M2ePro.text.relisting_selected_items_message = '{$relistingSelectedItemsMessage}'; M2ePro.text.stopping_selected_items_message = '{$stoppingSelectedItemsMessage}'; M2ePro.text.stopping_and_removing_selected_items_message = '{$stoppingAndRemovingSelectedItemsMessage}'; M2ePro.text.select_items_message = '{$selectItemsMessage}'; M2ePro.text.select_action_message = '{$selectActionMessage}'; M2ePro.text.success_word = '{$successWord}'; M2ePro.text.notice_word = '{$noticeWord}'; M2ePro.text.warning_word = '{$warningWord}'; M2ePro.text.error_word = '{$errorWord}'; M2ePro.text.close_word = '{$closeWord}'; M2ePro.text.successfully_moved = '{$successfullyMovedMessage}'; M2ePro.text.products_were_not_moved = '{$productsWereNotMovedMessage}'; M2ePro.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}'; M2ePro.customData.componentMode = '{$component}'; M2ePro.customData.gridId = '{$gridId}'; M2ePro.customData.ignoreListings = '{$ignoreListings}'; Event.observe(window, 'load', function() { EbayListingEbayGridHandlerObj = new EbayListingEbayGridHandler( '{$this->getId()}', {$listingData['id']} ); EbayListingEbayGridHandlerObj.afterInitPage(); EbayListingEbayGridHandlerObj.getGridMassActionObj().setGridIds('{$this->getGridIdsJson()}'); EbayListingEbayGridHandlerObj.actionHandler.setOptions(M2ePro); EbayListingEbayGridHandlerObj.movingHandler.setOptions(M2ePro); ListingProgressBarObj = new ProgressBar('listing_view_progress_bar'); GridWrapperObj = new AreaWrapper('listing_view_content_container'); if (M2ePro.productsIdsForList) { EbayListingEbayGridHandlerObj.getGridMassActionObj().checkedString = M2ePro.productsIdsForList; EbayListingEbayGridHandlerObj.actionHandler.listAction(); } if (!{$isSimpleViewMode} && {$showAutoAction}) { EbayListingAutoActionHandlerObj.loadAutoActionHtml(); } if ({$showMotorNotification}) { EbayListingEbayGridHandlerObj.showMotorsNotificationPopUp('{$motorNotification}'); } }); </script> HTML; return parent::_toHtml() . $javascriptsMain; }
protected function _toHtml() { $helper = Mage::helper('M2ePro'); if ($this->getRequest()->isXmlHttpRequest()) { return parent::_toHtml(); } $listingId = (int) $this->getRequest()->getParam('listing_id'); $listing = Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Listing', $listingId); $listingAdditionalData = $listing->getData('additional_data'); $listingAdditionalData = json_decode($listingAdditionalData, true); //------------------------------ $urls = Mage::helper('M2ePro')->getControllerActions('adminhtml_ebay_listing_autoAction', array('listing_id' => $listingId)); $path = 'adminhtml_ebay_listing_productAdd/add'; $urls[$path] = $this->getUrl('*/' . $path, array('_current' => true)); $path = 'adminhtml_ebay_listing_productAdd/setShowSettingsStep'; $urls[$path] = $this->getUrl('*/' . $path, array('_current' => true)); $path = 'adminhtml_ebay_listing_productAdd/setAutoActionPopupShown'; $urls[$path] = $this->getUrl('*/' . $path, array('_current' => true)); $path = 'adminhtml_ebay_listing_productAdd'; $urls[$path] = $this->getUrl('*/' . $path, array('_current' => true, 'step' => null)); $path = 'adminhtml_ebay_listing_categorySettings'; $urls[$path] = $this->getUrl('*/' . $path, array('_current' => true, 'step' => null)); $urls = json_encode($urls); //------------------------------ //------------------------------ $translations = json_encode(array('eBay Categories' => Mage::helper('M2ePro')->__('eBay Categories'), 'of Product' => Mage::helper('M2ePro')->__('of Product'), 'Specifics' => Mage::helper('M2ePro')->__('Specifics'), 'Auto Add/Remove Rules' => Mage::helper('M2ePro')->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => Mage::helper('M2ePro')->__('Based on Magento Categories'), 'You must select at least 1 Category.' => Mage::helper('M2ePro')->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => Mage::helper('M2ePro')->__('Rule with the same Title already exists.'), 'Listing Settings Customization' => Mage::helper('M2ePro')->__('Listing Settings Customization'))); //------------------------------ //------------------------------ $showAutoActionPopup = !Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/view/ebay/advanced/autoaction_popup/', 'shown'); Mage::helper('M2ePro/View_Ebay')->isSimpleMode() && ($showAutoActionPopup = false); $showAutoActionPopup = json_encode($showAutoActionPopup); $productAddSessionData = Mage::helper('M2ePro/Data_Session')->getValue('ebay_listing_product_add'); if (isset($productAddSessionData['show_settings_step'])) { $showSettingsStep = (bool) $productAddSessionData['show_settings_step']; } elseif (isset($listingAdditionalData['show_settings_step'])) { $showSettingsStep = (bool) $listingAdditionalData['show_settings_step']; } else { $showSettingsStep = true; } $showSettingsPopup = !isset($listingAdditionalData['show_settings_step']); Mage::helper('M2ePro/View_Ebay')->isSimpleMode() && ($showSettingsStep = false); Mage::helper('M2ePro/View_Ebay')->isSimpleMode() && ($showSettingsPopup = false); $showSettingsStep = json_encode($showSettingsStep); $showSettingsPopup = json_encode($showSettingsPopup); //------------------------------ $js = <<<HTML <script type="text/javascript"> M2ePro.url.add({$urls}); M2ePro.translator.add({$translations}); Event.observe(window, 'load', function() { WrapperObj = new AreaWrapper('add_products_container'); ProgressBarObj = new ProgressBar('add_products_progress_bar'); ListingProductAddHandlerObj = new EbayListingProductAddHandler({ show_settings_step: {$showSettingsStep}, show_settings_popup: {$showSettingsPopup}, show_autoaction_popup: {$showAutoActionPopup}, get_selected_products: {$this->getSelectedProductsCallback()} }); ListingAutoActionHandlerObj = new EbayListingAutoActionHandler(); VideoTutorialHandlerObj = new VideoTutorialHandler( 'video_tutorial_pop_up', '{$helper->escapeJs($helper->__('eBay/Magento Integration: Products Management'))}', function() {} ); VideoTutorialHandlerObj.closeCallback = function() { return true; } }); </script> HTML; return parent::_toHtml() . $js; }
protected function _toHtml() { if ($this->getRequest()->isXmlHttpRequest()) { $javascriptsMain = <<<HTML <script type="text/javascript"> EbayListingTranslationGridHandlerObj.afterInitPage(); EbayListingTranslationGridHandlerObj.getGridMassActionObj().setGridIds('{$this->getGridIdsJson()}'); </script> HTML; return parent::_toHtml() . $javascriptsMain; } $listingData = Mage::helper('M2ePro/Data_Global')->getValue('temp_data'); /** @var $helper Ess_M2ePro_Helper_Data */ $helper = Mage::helper('M2ePro'); $component = Ess_M2ePro_Helper_Component_Ebay::NICK; // static routes $urls = array('adminhtml_ebay_log/listing' => $this->getUrl('*/adminhtml_ebay_log/listing', array('id' => $listingData['id']))); $path = 'adminhtml_ebay_listing/getTranslationHtml'; $urls[$path] = $this->getUrl('*/' . $path, array('listing_id' => $listingData['id'])); $urls = json_encode($urls); $gridId = $component . 'ListingViewGrid' . $listingData['id']; $ignoreListings = json_encode(array($listingData['id'])); $logViewUrl = $this->getUrl('*/adminhtml_ebay_log/listing', array('id' => $listingData['id'], 'back' => $helper->makeBackUrlParam('*/adminhtml_ebay_listing/view', array('id' => $listingData['id'])))); $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary'); $runStartTranslateProducts = $this->getUrl('*/adminhtml_ebay_listing/runStartTranslateProducts'); $runStopTranslateProducts = $this->getUrl('*/adminhtml_ebay_listing/runStopTranslateProducts'); $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...')); $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%task_title%" Task has successfully completed.')); // M2ePro_TRANSLATIONS // %task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details. $tempString = '"%task_title%" Task has completed with warnings.' . ' <a target="_blank" href="%url%">View Log</a> for details.'; $taskCompletedWarningMessage = $helper->escapeJs($helper->__($tempString)); // M2ePro_TRANSLATIONS // "%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details. $tempString = '"%task_title%" Task has completed with errors.' . ' <a target="_blank" href="%url%">View Log</a> for details.'; $taskCompletedErrorMessage = $helper->escapeJs($helper->__($tempString)); $sendingDataToEbayMessage = $helper->escapeJs($helper->__('Sending %product_title% Product(s) data on eBay.')); $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.')); $listingLockedMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('The Listing was locked by another process. Please try again later.')); $listingEmptyMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing is empty.')); $startTranslateSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Translation in Progress')); $stopTranslateSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Translation')); $selectItemsMessage = $helper->escapeJs($helper->__('Please select Items.')); $selectActionMessage = $helper->escapeJs($helper->__('Please select Action.')); $successWord = $helper->escapeJs($helper->__('Success')); $noticeWord = $helper->escapeJs($helper->__('Notice')); $warningWord = $helper->escapeJs($helper->__('Warning')); $errorWord = $helper->escapeJs($helper->__('Error')); $closeWord = $helper->escapeJs($helper->__('Close')); $translations = json_encode(array('Payment for Translation Service' => $helper->__('Payment for Translation Service'), 'Payment for Translation Service. Help' => $helper->__('Payment for Translation Service'), 'Specify a sum to be credited to an Account.' => $helper->__('Specify a sum to be credited to an Account.' . ' If you are planning to order more Items for Translation in future,' . ' you can credit the sum greater than the one needed for current Translation.' . ' Click <a href="%url%" target="_blank">here</a> to find out more.', Mage::helper('M2ePro/Module_Support')->getDocumentationUrl(NULL, NULL, 'x/BQAJAQ#SellonanothereBaySite-Account')), 'Amount to Pay.' => $helper->__('Amount to Pay'), 'Insert amount to be credited to an Account' => $helper->__('Insert amount to be credited to an Account.'), 'Confirm' => $helper->__('Confirm'))); $javascriptsMain = <<<HTML <script type="text/javascript"> M2ePro.url.add({$urls}); M2ePro.translator.add({$translations}); M2ePro.url.logViewUrl = '{$logViewUrl}'; M2ePro.url.getErrorsSummary = '{$getErrorsSummary}'; M2ePro.url.runStartTranslateProducts = '{$runStartTranslateProducts}'; M2ePro.url.runStopTranslateProducts = '{$runStopTranslateProducts}'; M2ePro.text.task_completed_message = '{$taskCompletedMessage}'; M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}'; M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}'; M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}'; M2ePro.text.sending_data_message = '{$sendingDataToEbayMessage}'; M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}'; M2ePro.text.listing_locked_message = '{$listingLockedMessage}'; M2ePro.text.listing_empty_message = '{$listingEmptyMessage}'; M2ePro.text.start_translate_selected_items_message = '{$startTranslateSelectedItemsMessage}'; M2ePro.text.stop_translate_selected_items_message = '{$stopTranslateSelectedItemsMessage}'; M2ePro.text.select_items_message = '{$selectItemsMessage}'; M2ePro.text.select_action_message = '{$selectActionMessage}'; M2ePro.text.success_word = '{$successWord}'; M2ePro.text.notice_word = '{$noticeWord}'; M2ePro.text.warning_word = '{$warningWord}'; M2ePro.text.error_word = '{$errorWord}'; M2ePro.text.close_word = '{$closeWord}'; M2ePro.customData.componentMode = '{$component}'; M2ePro.customData.gridId = '{$gridId}'; M2ePro.customData.ignoreListings = '{$ignoreListings}'; Event.observe(window, 'load', function() { EbayListingTranslationGridHandlerObj = new EbayListingTranslationGridHandler( '{$this->getId()}', {$listingData['id']} ); EbayListingTranslationGridHandlerObj.afterInitPage(); EbayListingTranslationGridHandlerObj.getGridMassActionObj().setGridIds('{$this->getGridIdsJson()}'); EbayListingTranslationGridHandlerObj.actionHandler.setOptions(M2ePro); ListingProgressBarObj = new ProgressBar('listing_view_progress_bar'); GridWrapperObj = new AreaWrapper('listing_view_content_container'); EbayListingTransferringTranslateHandlerObj = new EbayListingTransferringTranslateHandler(); EbayListingTransferringPaymentHandlerObj = new EbayListingTransferringPaymentHandler(); EbayListingTransferringInfoHandlerObj = new EbayListingTransferringInfoHandler(); }); </script> HTML; return parent::_toHtml() . $javascriptsMain; }
protected function _toHtml() { $urls = json_encode(array('adminhtml_ebay_template/editListingProduct' => $this->getUrl('*/adminhtml_ebay_template/editListingProduct'), 'adminhtml_ebay_template/saveListingProduct' => $this->getUrl('*/adminhtml_ebay_template/saveListingProduct'))); $translations = json_encode(array('Edit Payment and Shipping Settings' => $this->__('Edit Payment and Shipping Settings'), 'Edit Selling Settings' => $this->__('Edit Selling Settings'), 'Edit Synchronization Settings' => $this->__('Edit Synchronization Settings'), 'Edit Settings' => $this->__('Edit Settings'), 'for' => $this->__('for'))); $commonJs = <<<HTML <script type="text/javascript"> M2ePro.url.add({$urls}); M2ePro.translator.add({$translations}); EbayListingSettingsGridHandlerObj.afterInitPage(); EbayListingSettingsGridHandlerObj.getGridMassActionObj().setGridIds('{$this->getGridIdsJson()}'); </script> HTML; $additionalJs = ''; if (!$this->getRequest()->isXmlHttpRequest()) { $additionalJs = <<<HTML <script type="text/javascript"> EbayListingSettingsGridHandlerObj = new {$this->getGridHandlerJs()}( '{$this->getId()}', '{$this->getListing()->getId()}' ); </script> HTML; } return parent::_toHtml() . $additionalJs . $commonJs; }