Exemplo n.º 1
0
    protected function _toHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            return parent::_toHtml();
        }
        $this->jsUrl->addUrls(array_merge($this->getHelper('Data')->getControllerActions('Ebay\\Listing'), $this->getHelper('Data')->getControllerActions('Ebay\\Listing\\Product\\Add'), $this->getHelper('Data')->getControllerActions('Ebay\\Listing\\Log'), $this->getHelper('Data')->getControllerActions('Ebay\\Listing\\Product\\Log'), $this->getHelper('Data')->getControllerActions('Ebay\\Template')));
        $this->jsUrl->add($this->getUrl('*/listing/edit'), 'listing/edit');
        $this->jsTranslator->add('Edit Listing Title', $this->__('Edit Listing Title'));
        $this->jsTranslator->add('Listing Title', $this->__('Listing Title'));
        $this->jsTranslator->add('The specified Title is already used for other Listing. Listing Title must be unique.', $this->__('The specified Title is already used for other Listing. Listing Title must be unique.'));
        $this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\\Ess\\M2ePro\\Helper\\Component\\Ebay'));
        $component = \Ess\M2ePro\Helper\Component\Ebay::NICK;
        $this->js->add(<<<JS
    require([
        'M2ePro/Ebay/Listing/Grid',
        'M2ePro/Listing/EditTitle'
    ], function(){

        window.EbayListingGridObj = new EbayListingGrid('{$this->getId()}');
        window.EditListingTitleObj = new ListingEditListingTitle('{$this->getId()}', '{$component}');

    });
JS
);
        return parent::_toHtml();
    }
Exemplo n.º 2
0
    protected function _toHtml()
    {
        $this->jsUrl->add($this->getUrl('*/listing/edit'), 'listing/edit');
        $this->jsUrl->add($this->getUrl('*/amazon_listing/saveTitle'), 'amazon_listing/saveTitle');
        $uniqueTitleTxt = 'The specified Title is already used for other Listing. Listing Title must be unique.';
        $this->jsTranslator->addTranslations(['Cancel' => $this->__('Cancel'), 'Save' => $this->__('Save'), 'Edit Listing Title' => $this->__('Edit Listing Title'), $uniqueTitleTxt => $this->__($uniqueTitleTxt)]);
        $component = \Ess\M2ePro\Helper\Component\Amazon::NICK;
        $this->js->add(<<<JS
    require([
        'M2ePro/Listing/EditTitle'
    ], function(){

        window.EditListingTitleObj = new ListingEditListingTitle('{$this->getId()}', '{$component}');

    });
JS
);
        return parent::_toHtml();
    }