public static function setTranslationObject(AbsTrustedShops $object)
 {
     self::$translation_object = $object;
 }
 public function __construct()
 {
     // need to set this in constructor to allow translation
     TSBuyerProtection::$payments_type = array('DIRECT_DEBIT' => $this->l('Direct debit'), 'CREDIT_CARD' => $this->l('Credit Card'), 'INVOICE' => $this->l('Invoice'), 'CASH_ON_DELIVERY' => $this->l('Cash on delivery'), 'PREPAYMENT' => $this->l('Prepayment'), 'CHEQUE' => $this->l('Cheque'), 'PAYBOX' => $this->l('Paybox'), 'PAYPAL' => $this->l('PayPal'), 'CASH_ON_PICKUP' => $this->l('Cash on pickup'), 'FINANCING' => $this->l('Financing'), 'LEASING' => $this->l('Leasing'), 'T_PAY' => $this->l('T-Pay'), 'CLICKANDBUY' => $this->l('Click&Buy'), 'GIROPAY' => $this->l('Giropay'), 'GOOGLE_CHECKOUT' => $this->l('Google Checkout'), 'SHOP_CARD' => $this->l('Online shop payment card'), 'DIRECT_E_BANKING' => $this->l('DIRECTebanking.com'), 'MONEYBOOKERS' => $this->l('moneybookers.com'), 'OTHER' => $this->l('Other method of payment'));
     $this->tab_name = $this->l('Trusted Shops quality seal and buyer protection');
     $this->site_url = Tools::htmlentitiesutf8('http://' . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__);
     TSBPException::setTranslationObject($this);
     if (!method_exists('Tools', 'jsonDecode') || !method_exists('Tools', 'jsonEncode')) {
         $this->warnings[] = $this->l('Json functions must be implemented in your php version');
     } else {
         foreach ($this->available_languages as $iso => $lang) {
             if ($lang === '') {
                 $this->available_languages[$iso] = Language::getLanguage(Language::getIdByIso($iso));
             }
             TSBuyerProtection::$CERTIFICATE[strtoupper($iso)] = (array) Tools::jsonDecode(Tools::htmlentitiesDecodeUTF8(Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'CERTIFICATE_' . strtoupper($iso))));
         }
         if (TSBuyerProtection::$SHOPSW === NULL) {
             TSBuyerProtection::$SHOPSW = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'SHOPSW');
             TSBuyerProtection::$ET_CID = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'ET_CID');
             TSBuyerProtection::$ET_LID = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'ET_LID');
             TSBuyerProtection::$DEFAULT_LANG = (int) Configuration::get('PS_LANG_DEFAULT');
             TSBuyerProtection::$CAT_ID = (int) Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'CAT_ID');
             TSBuyerProtection::$ENV_API = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'ENV_API');
         }
     }
 }
Example #3
0
 public function __construct()
 {
     self::$template_version = version_compare(_PS_VERSION_, '1.6', '<') ? '1.5' : '1.6';
     // need to set this in constructor to allow translation
     TSCommon::$payments_type = array('DIRECT_DEBIT' => $this->l('Direct debit'), 'CREDIT_CARD' => $this->l('Credit Card'), 'INVOICE' => $this->l('Invoice'), 'CASH_ON_DELIVERY' => $this->l('Cash on delivery'), 'PREPAYMENT' => $this->l('Prepayment'), 'CHEQUE' => $this->l('Cheque'), 'PAYBOX' => $this->l('Paybox'), 'PAYPAL' => $this->l('PayPal'), 'AMAZON_PAYMENTS' => $this->l('Amazon payments'), 'CASH_ON_PICKUP' => $this->l('Cash on pickup'), 'FINANCING' => $this->l('Financing'), 'LEASING' => $this->l('Leasing'), 'T_PAY' => $this->l('T-Pay'), 'CLICKANDBUY' => $this->l('Click&Buy'), 'GIROPAY' => $this->l('Giropay'), 'GOOGLE_CHECKOUT' => $this->l('Google Checkout'), 'SHOP_CARD' => $this->l('Online shop payment card'), 'DIRECT_E_BANKING' => $this->l('DIRECTebanking.com'), 'MONEYBOOKERS' => $this->l('moneybookers.com'), 'DOTPAY' => $this->l('Dotpay'), 'PLATNOSCI' => $this->l('Platnosci'), 'PRZELEWY24' => $this->l('Przelewy24'), 'OTHER' => $this->l('Other method of payment'));
     $this->tab_name = $this->l('Trusted Shops quality seal and buyer protection');
     $this->site_url = Tools::htmlentitiesutf8('http://' . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__);
     TSBPException::setTranslationObject($this);
     if (!method_exists('Tools', 'jsonDecode') || !method_exists('Tools', 'jsonEncode')) {
         $this->warnings[] = $this->l('Json functions must be implemented in your php version');
     } else {
         foreach (array_keys(self::$available_languages) as $iso) {
             $certificate = Configuration::get(TSCommon::PREFIX_TABLE . 'CERTIFICATE_' . Tools::strtoupper($iso));
             TSCommon::$certificates[Tools::strtoupper($iso)] = (array) Tools::jsonDecode(Tools::htmlentitiesDecodeUTF8($certificate));
             if (!isset(TSCommon::$certificates[Tools::strtoupper($iso)]['tsID']) || isset(TSCommon::$certificates[Tools::strtoupper($iso)]['tsID']) && TSCommon::$certificates[Tools::strtoupper($iso)]['tsID'] == '') {
                 TSCommon::$available_languages_for_adding[Tools::strtoupper($iso)] = Tools::strtoupper($iso);
             }
         }
         if (TSCommon::$shopsw === null) {
             TSCommon::$shopsw = Configuration::get(TSCommon::PREFIX_TABLE . 'SHOPSW');
             TSCommon::$et_cid = Configuration::get(TSCommon::PREFIX_TABLE . 'ET_CID');
             TSCommon::$et_lid = Configuration::get(TSCommon::PREFIX_TABLE . 'ET_LID');
             TSCommon::$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
             TSCommon::$cat_id = (int) Configuration::get(TSCommon::PREFIX_TABLE . 'CAT_ID');
             TSCommon::$env_api = Configuration::get(TSCommon::PREFIX_TABLE . 'ENV_API');
         }
     }
 }