Esempio n. 1
0
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
     $urlComponents = $this->getHelper('Component')->getEnabledComponents();
     $componentForUrl = count($urlComponents) == 1 ? array_shift($urlComponents) : \Ess\M2ePro\Helper\Component\Ebay::NICK;
     $fieldset = $form->addFieldset('configuration_settings_interface', ['legend' => '', 'collapsable' => false]);
     $fieldset->addField('products_show_thumbnails', self::SELECT, ['name' => 'products_show_thumbnails', 'label' => $this->__('Products Thumbnail'), 'values' => [0 => $this->__('Do Not Show'), 1 => $this->__('Show')], 'value' => (bool) (int) $this->getHelper('Module')->getConfig()->getGroupValue('/view/', 'show_products_thumbnails'), 'tooltip' => $this->__('Choose whether you want to see Thumbnail Images for Products on the
                 Add Products and View Listing Pages.')]);
     $fieldset->addField('block_notices_show', self::SELECT, ['name' => 'block_notices_show', 'label' => $this->__('Help Information'), 'values' => [0 => $this->__('Do Not Show'), 1 => $this->__('Show')], 'value' => (bool) (int) $this->getHelper('Module')->getConfig()->getGroupValue('/view/', 'show_block_notices'), 'tooltip' => $this->__('<p>Choose whether you want the help information to be available at the top of 
                 each M2E Pro Page.</p><br>
                 <p><strong>Please note</strong>, it does not disable the help-tips 
                 (the icons with the additional information next to the main options).</p>')]);
     $data = array('id' => 'restore_block_notices', 'label' => $this->__('Restore Help Blocks'), 'class' => 'primary');
     $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
     $fieldset->addField('restore_block_notices', self::CUSTOM_CONTAINER, ['text' => $buttonBlock->toHtml(), 'field_extra_attributes' => 'id="restore_block_notices_tr"']);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Esempio n. 2
0
    protected function _prepareForm()
    {
        $this->prepareLicenseData();
        $form = $this->_formFactory->create(['data' => ['method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
        $urlComponents = $this->getHelper('Component')->getEnabledComponents();
        $componentForUrl = count($urlComponents) == 1 ? array_shift($urlComponents) : \Ess\M2ePro\Helper\Component\Ebay::NICK;
        $email = '<a href="mailto:support@m2epro.com">support@m2epro.com</a>';
        $form->addField('block_notice_configuration_license', self::HELP_BLOCK, ['no_collapse' => true, 'no_hide' => true, 'content' => $this->__('
                    M2E Pro Extension requires activation for its work. License Key activates and identifies your
                    M2E Pro Extension. <br/><br/>
                    To obtain a License Key, press <strong>Create New License</strong>
                    button and enter the required data.<br/><br/>

                    The License Key is strictly connected to the particular
                    <strong>Domain</strong> and <strong>IP</strong>. Their validation prevents problems,
                    such as creation of Item duplicates in case of Magento relocation. For example,
                    duplicated Items can be created after you change the server and synchronization
                    continues working on both old and new server.
                    <br/><br/>
                    <b>Note:</b> If you have not received the License Key, please contact us %email%.</br></br>
                    More detailed information about ability to work with this Page you can find
                    <a href="%url%" target="_blank">here</a>.', $email, $this->getHelper('Module\\Support')->getDocumentationUrl($componentForUrl, 'Global+Settings#GlobalSettings-License'))]);
        $fieldSet = $form->addFieldset('magento_block_configuration_license_data', ['legend' => $this->__('General'), 'collapsable' => false]);
        $fieldData = ['label' => $this->__('License Key'), 'text' => $this->key];
        if ($this->key && $this->licenseData['domain'] && $this->licenseData['ip'] && !$this->status) {
            $fieldData['text'] .= ' <span style="color: red;">(' . $this->__('Suspended') . ')</span>';
        }
        $fieldSet->addField('license_text_key_container', 'note', $fieldData);
        if ($this->licenseData['info']['email'] != '') {
            $fieldSet->addField('associated_email', 'note', ['label' => $this->__('Associated Email'), 'text' => $this->licenseData['info']['email'], 'tooltip' => $this->__('This e-mail address associated to your License. <br/>
                        Also you can use this e-mail to enter a <a href="%url%">clients portal</a>', $this->getHelper('Module\\Support')->getClientsPortalBaseUrl())]);
        }
        if ($this->key != '') {
            $fieldSet->addField('manage_license', 'note', ['label' => '', 'text' => '<a href="' . $this->getHelper('Module\\Support')->getClientsPortalBaseUrl() . '" target="_blank">' . $this->__('Manage License') . '</a>']);
        }
        if ($this->licenseData['domain'] != '' || $this->licenseData['ip'] != '') {
            $fieldSet = $form->addFieldset('magento_block_configuration_license_valid', ['legend' => $this->__('Valid Location'), 'collapsable' => false]);
            if ($this->licenseData['domain'] != '') {
                $text = '<span ' . ($this->licenseData['valid']['domain'] ? '' : 'style="color: red;"') . '>
                            ' . $this->licenseData['domain'] . '
                        </span>';
                if (!$this->licenseData['valid']['domain'] && !is_null($this->licenseData['connection']['domain'])) {
                    $text .= '<span> (' . $this->__('Your Domain') . ': ' . $this->getHelper('Data')->escapeHtml($this->licenseData['connection']['domain']) . ')</span>';
                }
                $fieldSet->addField('domain_field', 'note', ['label' => $this->__('Domain'), 'text' => $text]);
            }
            if ($this->licenseData['ip'] != '') {
                $text = '<span ' . ($this->licenseData['valid']['ip'] ? '' : 'style="color: red;"') . '>
                            ' . $this->licenseData['ip'] . '
                        </span>';
                if (!$this->licenseData['valid']['ip'] && !is_null($this->licenseData['connection']['ip'])) {
                    $text .= '<span> (' . $this->__('Your IP') . ': ' . $this->getHelper('Data')->escapeHtml($this->licenseData['connection']['ip']) . ')</span>';
                }
                $fieldSet->addField('ip_field', 'note', ['label' => $this->__('IP(s)'), 'text' => $text, 'after_element_html' => $this->getChildHtml('refresh_status')]);
            }
        }
        $fieldSet = $form->addFieldset('magento_block_configuration_license', ['legend' => $this->__($this->key == '' ? 'General' : 'Additional'), 'collapsable' => false]);
        $fieldSet->addField('license_buttons', 'note', ['text' => '<span style="padding-right: 10px;">' . $this->getChildHtml('new_license') . '</span>' . '<span>' . $this->getChildHtml('change_license') . '</span>']);
        $form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
    }