function getContent()
 {
     // Check if the module is configured
     if (!$this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL')) {
         return '<p class="error"><b>' . $this->ebay->l('Please configure the \'General settings\' tab before using this tab') . '</b></p><br /><script type="text/javascript">$("#menuTab4").addClass("wrong")</script>';
     }
     $iso = $this->context->language->iso_code;
     $iso_tiny_mce = file_exists(_PS_ROOT_DIR_ . '/js/tiny_mce/langs/' . $iso . '.js') ? $iso : 'en';
     // Display Form
     $url_vars = array('id_tab' => '4', 'section' => 'template');
     if (version_compare(_PS_VERSION_, '1.5', '>')) {
         $url_vars['controller'] = Tools::getValue('controller');
     } else {
         $url_vars['tab'] = Tools::getValue('tab');
     }
     $action_url = $this->_getUrl($url_vars);
     if (Tools::getValue('reset_template')) {
         $ebay_product_template = EbayProductTemplate::getContent($this->ebay, $this->smarty);
     } else {
         $ebay_product_template = Tools::getValue('ebay_product_template', $this->ebay_profile->getConfiguration('EBAY_PRODUCT_TEMPLATE'));
     }
     $ebay_product_template_title = $this->ebay_profile->getConfiguration('EBAY_PRODUCT_TEMPLATE_TITLE');
     $smarty_vars = array('action_url' => $action_url, 'ebay_product_template' => $ebay_product_template, 'ebay_product_template_title' => $ebay_product_template_title, 'features_product' => Feature::getFeatures($this->context->language->id), 'ad' => dirname($_SERVER['PHP_SELF']), 'base_uri' => __PS_BASE_URI__, 'is_one_dot_three' => Tools::substr(_PS_VERSION_, 0, 3) == '1.3', 'is_one_dot_five' => version_compare(_PS_VERSION_, '1.5', '>'), 'theme_css_dir' => _THEME_CSS_DIR_);
     if (Tools::substr(_PS_VERSION_, 0, 3) == '1.3') {
         $smarty_vars['theme_name'] = _THEME_NAME_;
         $smarty_vars['language'] = file_exists(_PS_ROOT_DIR_ . '/js/tinymce/jscripts/tiny_mce/langs/' . $iso . '.js') ? $iso : 'en';
     } elseif (version_compare(_PS_VERSION_, '1.5', '>')) {
         $smarty_vars['iso'] = file_exists(_PS_ROOT_DIR_ . '/js/tiny_mce/langs/' . $iso . '.js') ? $iso : 'en';
     } else {
         $smarty_vars['iso_type_mce'] = $iso_tiny_mce;
         $smarty_vars['ps_js_dir'] = _PS_JS_DIR_;
     }
     return $this->display('formTemplateManager.tpl', $smarty_vars);
 }
Exemple #2
0
 private function _postProcessAddProfile()
 {
     $ebay_username = Tools::getValue('eBayUsernamesList');
     if (!$ebay_username || $ebay_username == -1) {
         $ebay_username = Tools::getValue('eBayUsername');
     }
     if ($ebay_username) {
         $this->context->cookie->eBayUsername = $ebay_username;
         $id_shop = version_compare(_PS_VERSION_, '1.5', '>') ? Shop::getContextShopID() : Shop::getCurrentShop();
         $this->ebay_profile = EbayProfile::getByLangShopSiteAndUsername((int) Tools::getValue('ebay_language'), $id_shop, Tools::getValue('ebay_country'), $ebay_username, EbayProductTemplate::getContent($this, $this->smarty));
         EbayProfile::setProfile($this->ebay_profile->id);
     }
 }