@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | exit; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -define('_PS_PAYLATER_DIR', _PS_MODULE_DIR_. '/paylater'); |
|
| 14 | +define('_PS_PAYLATER_DIR', _PS_MODULE_DIR_.'/paylater'); |
|
| 15 | 15 | |
| 16 | 16 | require _PS_PAYLATER_DIR.'/vendor/autoload.php'; |
| 17 | 17 | |
@@ -194,18 +194,18 @@ discard block |
||
| 194 | 194 | public function checkHooks() |
| 195 | 195 | { |
| 196 | 196 | try { |
| 197 | - $sql_content = 'select * from ' . _DB_PREFIX_. 'hook_module where |
|
| 198 | - id_module = \'' . Module::getModuleIdByName($this->name) . '\' and |
|
| 199 | - id_shop = \'' . Shop::getContextShopID() . '\' and |
|
| 200 | - id_hook = \'' . Hook::getIdByName('header') . '\''; |
|
| 197 | + $sql_content = 'select * from '._DB_PREFIX_.'hook_module where |
|
| 198 | + id_module = \'' . Module::getModuleIdByName($this->name).'\' and |
|
| 199 | + id_shop = \'' . Shop::getContextShopID().'\' and |
|
| 200 | + id_hook = \'' . Hook::getIdByName('header').'\''; |
|
| 201 | 201 | $hook_exists = Db::getInstance()->ExecuteS($sql_content); |
| 202 | 202 | if (empty($hook_exists)) { |
| 203 | - $sql_insert = 'insert into ' . _DB_PREFIX_. 'hook_module |
|
| 203 | + $sql_insert = 'insert into '._DB_PREFIX_.'hook_module |
|
| 204 | 204 | (id_module, id_shop, id_hook, position) |
| 205 | 205 | values |
| 206 | - (\''. Module::getModuleIdByName($this->name) . '\', |
|
| 207 | - \''. Shop::getContextShopID() . '\', |
|
| 208 | - \''. Hook::getIdByName('header') . '\', |
|
| 206 | + (\''. Module::getModuleIdByName($this->name).'\', |
|
| 207 | + \''. Shop::getContextShopID().'\', |
|
| 208 | + \''. Hook::getIdByName('header').'\', |
|
| 209 | 209 | 150)'; |
| 210 | 210 | Db::getInstance()->execute($sql_insert); |
| 211 | 211 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | public function loadEnvVariables() |
| 218 | 218 | { |
| 219 | - $sql_content = 'select * from ' . _DB_PREFIX_. 'pmt_config'; |
|
| 219 | + $sql_content = 'select * from '._DB_PREFIX_.'pmt_config'; |
|
| 220 | 220 | $dbConfigs = Db::getInstance()->executeS($sql_content); |
| 221 | 221 | |
| 222 | 222 | // Convert a multimple dimension array for SQL insert statements into a simple key/value |
@@ -237,10 +237,10 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | foreach (array_merge($this->defaultConfigs, $simpleDbConfigs) as $key => $value) { |
| 240 | - putenv($key . '=' . $value); |
|
| 240 | + putenv($key.'='.$value); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - putenv("PMT_DEFAULT_CONFIGS" . '=' . json_encode($this->defaultConfigs)); |
|
| 243 | + putenv("PMT_DEFAULT_CONFIGS".'='.json_encode($this->defaultConfigs)); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | } else { |
| 321 | 321 | $this->context->controller->addJS('https://cdn.pagamastarde.com/js/pmt-v2/sdk.js'); |
| 322 | 322 | } |
| 323 | - $this->context->controller->addJS($this->getPathUri(). 'views/js/simulator.js'); |
|
| 323 | + $this->context->controller->addJS($this->getPathUri().'views/js/simulator.js'); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $paymentOption |
| 370 | 370 | ->setCallToActionText($pmtTitle) |
| 371 | 371 | ->setAction($link->getModuleLink('paylater', 'payment')) |
| 372 | - ->setLogo($this->getPathUri(). 'logo.gif') |
|
| 372 | + ->setLogo($this->getPathUri().'logo.gif') |
|
| 373 | 373 | ->setModuleName(__CLASS__) |
| 374 | 374 | ; |
| 375 | 375 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | 'input' => array( |
| 400 | 400 | array( |
| 401 | 401 | 'name' => 'pmt_is_enabled', |
| 402 | - 'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch', |
|
| 402 | + 'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch', |
|
| 403 | 403 | 'label' => $this->l('Module is enabled'), |
| 404 | 404 | 'prefix' => '<i class="icon icon-key"></i>', |
| 405 | 405 | 'class' => 't', |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | ), |
| 440 | 440 | array( |
| 441 | 441 | 'name' => 'pmt_simulator_is_enabled', |
| 442 | - 'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch', |
|
| 442 | + 'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch', |
|
| 443 | 443 | 'label' => $this->l('Simulator is enabled'), |
| 444 | 444 | 'prefix' => '<i class="icon icon-key"></i>', |
| 445 | 445 | 'class' => 't', |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | $message = $this->displayError($error); |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | - $logo = $this->getPathUri(). 'views/img/logo_pagamastarde.png'; |
|
| 558 | + $logo = $this->getPathUri().'views/img/logo_pagamastarde.png'; |
|
| 559 | 559 | $tpl = $this->local_path.'views/templates/admin/config-info.tpl'; |
| 560 | 560 | $this->context->smarty->assign(array( |
| 561 | 561 | 'logo' => $logo, |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | /** @var ProductCore $product */ |
| 641 | 641 | $product = new Product(Tools::getValue('id_product')); |
| 642 | 642 | $amount = $product->getPublicPrice(); |
| 643 | - $pmtPublicKey = Configuration::get('pmt_public_key'); |
|
| 643 | + $pmtPublicKey = Configuration::get('pmt_public_key'); |
|
| 644 | 644 | $pmtSimulatorIsEnabled = Configuration::get('pmt_simulator_is_enabled'); |
| 645 | 645 | $pmtIsEnabled = Configuration::get('pmt_is_enabled'); |
| 646 | 646 | $pmtSimulatorType = getenv('PMT_SIMULATOR_DISPLAY_TYPE'); |
@@ -749,10 +749,10 @@ discard block |
||
| 749 | 749 | */ |
| 750 | 750 | public function checkLogoExists() |
| 751 | 751 | { |
| 752 | - $logo = _PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments/'. Tools::strtolower(__CLASS__). '.png'; |
|
| 753 | - if (!file_exists($logo) && is_dir(_PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments')) { |
|
| 752 | + $logo = _PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments/'.Tools::strtolower(__CLASS__).'.png'; |
|
| 753 | + if (!file_exists($logo) && is_dir(_PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments')) { |
|
| 754 | 754 | copy( |
| 755 | - _PS_PAYLATER_DIR . '/views/img/logo-64x64.png', |
|
| 755 | + _PS_PAYLATER_DIR.'/views/img/logo-64x64.png', |
|
| 756 | 756 | $logo |
| 757 | 757 | ); |
| 758 | 758 | } |