public function getFormHtml() { $viewHeaderBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $this->listing]]); $tabs = $this->getChildBlock('tabs'); $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\\Listing\\AutoAction', ['id' => $this->getRequest()->getParam('id')])); $this->jsTranslator->addTranslations(['Remove Category' => $this->__('Remove Category'), 'Add New Group' => $this->__('Add New Group'), 'Add/Edit Categories Rule' => $this->__('Add/Edit Categories Rule'), 'Auto Add/Remove Rules' => $this->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => $this->__('Based on Magento Categories'), 'You must select at least 1 Category.' => $this->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => $this->__('Rule with the same Title already exists.')]); $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Model\\Listing')); $this->js->addOnReadyJs(<<<JS require([ 'M2ePro/Amazon/Listing/AutoAction' ], function(){ window.ListingAutoActionObj = new AmazonListingAutoAction(); }); JS ); return $viewHeaderBlock->toHtml() . $tabs->toHtml() . parent::getFormHtml(); }
public function getFormHtml() { $html = ''; $tabs = $this->getChildBlock('tabs'); // --------------------------------------- $html .= $this->createBlock('Ebay\\Listing\\Template\\Switcher\\Initialization')->toHtml(); // --------------------------------------- // // --------------------------------------- // $data = array( // 'display_tab_buttons' => false // ); // $block = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_floatingToolbarFixer'); // $block->addData($data); // $html .= $block->toHtml(); // // --------------------------------------- // --------------------------------------- $listing = $this->getHelper('Data\\GlobalData')->getValue('ebay_listing'); $headerHtml = ''; if ($listing) { $headerBlock = $this->createBlock('Listing\\View\\Header', '', ['data' => ['listing' => $listing]]); $headerBlock->setListingViewMode(true); $headerHtml = $headerBlock->toHtml(); } // --------------------------------------- // hide tabs selector if only one tab is allowed for displaying // --------------------------------------- if (count($this->getAllowedTabs()) == 1) { $this->js->add(<<<JS require([], function(){ \$('{$tabs->getId()}').hide(); }); JS ); } // --------------------------------------- return $html . $headerHtml . $tabs->toHtml() . parent::getFormHtml(); }