diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..690ac19 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +vendor +config*.xml \ No newline at end of file diff --git a/smartsupp/backward_compatibility/Context.php b/backward_compatibility/Context.php similarity index 100% rename from smartsupp/backward_compatibility/Context.php rename to backward_compatibility/Context.php diff --git a/smartsupp/backward_compatibility/Display.php b/backward_compatibility/Display.php similarity index 100% rename from smartsupp/backward_compatibility/Display.php rename to backward_compatibility/Display.php diff --git a/smartsupp/backward_compatibility/backward.ini b/backward_compatibility/backward.ini similarity index 100% rename from smartsupp/backward_compatibility/backward.ini rename to backward_compatibility/backward.ini diff --git a/smartsupp/backward_compatibility/backward.php b/backward_compatibility/backward.php similarity index 100% rename from smartsupp/backward_compatibility/backward.php rename to backward_compatibility/backward.php diff --git a/smartsupp/backward_compatibility/index.php b/backward_compatibility/index.php similarity index 100% rename from smartsupp/backward_compatibility/index.php rename to backward_compatibility/index.php diff --git a/smartsupp/classes/index.php b/classes/index.php similarity index 96% rename from smartsupp/classes/index.php rename to classes/index.php index de4ac88..ed66748 100644 --- a/smartsupp/classes/index.php +++ b/classes/index.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/composer.json b/composer.json similarity index 100% rename from smartsupp/composer.json rename to composer.json diff --git a/smartsupp/composer.lock b/composer.lock similarity index 100% rename from smartsupp/composer.lock rename to composer.lock diff --git a/smartsupp/controllers/admin/AdminSmartsuppAjax.php b/controllers/admin/AdminSmartsuppAjax.php similarity index 51% rename from smartsupp/controllers/admin/AdminSmartsuppAjax.php rename to controllers/admin/AdminSmartsuppAjax.php index 8159ec2..fd37632 100755 --- a/smartsupp/controllers/admin/AdminSmartsuppAjax.php +++ b/controllers/admin/AdminSmartsuppAjax.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Text Domain: smartsupp * Author: Smartsupp * Author URI: http://www.smartsupp.com @@ -23,8 +23,10 @@ class AdminSmartsuppAjaxController extends ModuleAdminController { + const FILE_NAME = 'AdminSmartsuppAjaxController'; public $ssl = true; private $partnerKey = 'h4w6t8hln9'; + private $response = []; public function init() { @@ -32,45 +34,62 @@ public function init() switch (Tools::getValue('action')) { case 'login': - $response = $api->login(array( + $this->response = $api->login([ 'email' => Tools::getValue('email'), 'password' => Tools::getValue('password'), 'platform' => 'Prestashop ' . _PS_VERSION_, - )); - - Configuration::updateValue('SMARTSUPP_KEY', $response['account']['key']); - Configuration::updateValue('SMARTSUPP_EMAIL', Tools::getValue('email')); + ]); + $this->updateCredentials(); break; case 'create': - $response = $api->create(array( + $this->response = $api->create([ 'email' => Tools::getValue('email'), 'password' => Tools::getValue('password'), 'partnerKey' => $this->partnerKey, 'consentTerms' => 1, 'platform' => 'Prestashop ' . _PS_VERSION_, - )); - - Configuration::updateValue('SMARTSUPP_KEY', $response['account']['key']); - Configuration::updateValue('SMARTSUPP_EMAIL', Tools::getValue('email')); + ]); + $this->updateCredentials(); break; case 'deactivate': Configuration::updateValue('SMARTSUPP_KEY', ''); Configuration::updateValue('SMARTSUPP_EMAIL', ''); break; } - - if (isset($response) && isset($response['error'])) { - Configuration::updateValue('SMARTSUPP_KEY', ''); - Configuration::updateValue('SMARTSUPP_EMAIL', ''); - } header('Content-Type: application/json'); - die(Tools::jsonEncode(array( - 'key' => Configuration::get('SMARTSUPP_KEY'), - 'email' => Configuration::get('SMARTSUPP_EMAIL'), - 'error' => $response['error'], - 'message' => $response['message'], - 'hint' => $response['hint'] - ))); + + $responseData = [ + 'key' => Configuration::get('SMARTSUPP_KEY'), + 'email' => Configuration::get('SMARTSUPP_EMAIL'), + 'error' => isset($this->response['error']) ? $this->response['error'] : null, + 'message' => isset($this->response['message']) ? $this->response['message'] : null, + ]; + + $responseData = array_filter($responseData, function ($val) { + return $val !== null; + }); + + die(json_encode($responseData)); + } + + + /** + * @return void + */ + private function updateCredentials() + { + if (isset($this->response['account']['key'])) { + Configuration::updateValue('SMARTSUPP_KEY', $this->response['account']['key']); + Configuration::updateValue('SMARTSUPP_EMAIL', Tools::getValue('email')); + + return; + } + + $this->response['error'] = isset($this->response['error']) ? $this->response['error'] : $this->module->l('Unknown Error Occurred', self::FILE_NAME); + $this->response['message'] = isset($this->response['message']) ? $this->response['message'] : $this->module->l('Unknown Error Occurred', self::FILE_NAME); + + Configuration::updateValue('SMARTSUPP_KEY', ''); + Configuration::updateValue('SMARTSUPP_EMAIL', ''); } } diff --git a/smartsupp/index.php b/controllers/admin/index.php similarity index 96% rename from smartsupp/index.php rename to controllers/admin/index.php index de4ac88..ed66748 100644 --- a/smartsupp/index.php +++ b/controllers/admin/index.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/controllers/admin/index.php b/controllers/index.php similarity index 96% rename from smartsupp/controllers/admin/index.php rename to controllers/index.php index de4ac88..ed66748 100644 --- a/smartsupp/controllers/admin/index.php +++ b/controllers/index.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/controllers/index.php b/index.php similarity index 96% rename from smartsupp/controllers/index.php rename to index.php index de4ac88..ed66748 100644 --- a/smartsupp/controllers/index.php +++ b/index.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/logo.gif b/logo.gif similarity index 100% rename from smartsupp/logo.gif rename to logo.gif diff --git a/smartsupp/logo.png b/logo.png similarity index 100% rename from smartsupp/logo.png rename to logo.png diff --git a/smartsupp/smartsupp.php b/smartsupp.php similarity index 81% rename from smartsupp/smartsupp.php rename to smartsupp.php index a6d1a13..db4b092 100755 --- a/smartsupp/smartsupp.php +++ b/smartsupp.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp @@ -19,19 +19,19 @@ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt */ +use Smartsupp\LiveChat\Utility\VersionUtility; + if (!defined('_PS_VERSION_')) { exit; } -require dirname(__FILE__) . '/vendor/autoload.php'; - class Smartsupp extends Module { public function __construct() { $this->name = 'smartsupp'; $this->tab = 'advertising_marketing'; - $this->version = '2.1.9'; + $this->version = '2.2.0'; $this->author = 'Smartsupp'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); @@ -40,18 +40,20 @@ public function __construct() parent::__construct(); - $this->displayName = $this->l('Smartsupp Live Chat'); - $this->description = $this->l('Smartsupp combines live chat and chatbots to save your time.'); + $this->displayName = $this->l('Smartsupp Live Chat & AI Chatbots'); + $this->description = $this->l('Smartsupp is your personal online shopping assistant, built to increase conversion rates and sales via visitor engagement in real-time, at the right time.'); + + $confirm = $this->l('Are you sure you want to uninstall Smartsupp Live Chat? '); + $confirm .= $this->l('You will lose all the data related to this module.'); - $confirm = 'Are you sure you want to uninstall Smartsupp Live Chat? '; - $confirm .= 'You will lose all the data related to this module.'; - $this->confirmUninstall = $this->l($confirm); if (version_compare(_PS_VERSION_, '1.5', '<')) { include _PS_MODULE_DIR_ . $this->name . '/backward_compatibility/backward.php'; } + $this->autoload(); + if (!Configuration::get('SMARTSUPP_KEY')) { $this->warning = $this->l('No Smartsupp key provided.'); } @@ -73,10 +75,15 @@ public function install() $tab->id_parent = -1; $tab->module = $this->name; + if (VersionUtility::isPsVersionGreaterThan('1.6')) { + $this->registerHook('displayBackOfficeHeader'); + } else { + $this->registerHook('backOfficeHeader'); + } + if (!$tab->add() || !parent::install() || !$this->registerHook('header') - || !$this->registerHook('backOfficeHeader') || !Configuration::updateValue('SMARTSUPP_KEY', '') || !Configuration::updateValue('SMARTSUPP_EMAIL', '') || !Configuration::updateValue('SMARTSUPP_CUSTOMER_ID', '1') @@ -91,21 +98,36 @@ public function install() return false; } + if (VersionUtility::isPsVersionGreaterThan('1.6')) { + $this->registerHook('displayBackOfficeHeader'); + } else { + $this->registerHook('backOfficeHeader'); + } + return true; } public function uninstall() { - $id_tab = (int) Tab::getIdFromClassName('AdminSmartsuppAjax'); + if (VersionUtility::isPsVersionGreaterOrEqualTo('1.7.1')) { + $id_tab = $this->get('prestashop.core.admin.tab.repository')->findOneIdByClassName('AdminSmartsuppAjax'); + } else { + $id_tab = (int) Tab::getIdFromClassName('AdminSmartsuppAjax'); + } if ($id_tab) { $tab = new Tab($id_tab); $tab->delete(); } + if (VersionUtility::isPsVersionGreaterThan('1.6')) { + $this->unregisterHook('displayBackOfficeHeader'); + } else { + $this->unregisterHook('backOfficeHeader'); + } + if (!parent::uninstall() || !$this->unregisterHook('header') - || !$this->unregisterHook('backOfficeHeader') || !Configuration::deleteByName('SMARTSUPP_KEY') || !Configuration::deleteByName('SMARTSUPP_EMAIL') || !Configuration::deleteByName('SMARTSUPP_CUSTOMER_ID', '') @@ -159,8 +181,8 @@ public function displayForm() $fields_form = array(); - $fields_desc = 'Don\'t put the chat code here - this box is for '; - $fields_desc .= '(optional) advanced customizations via #.'; + $fields_desc = $this->l('Don\'t put the chat code here - this box is for '); + $fields_desc .= $this->l('(optional) advanced customizations via ') . '#.'; $fields_form[0]['form'] = array( 'legend' => array( @@ -312,20 +334,27 @@ public function hookHeader() public function hookBackOfficeHeader() { $js = ''; + if (strcmp(Tools::getValue('configure'), $this->name) === 0) { $path = $this->_path; - if (version_compare(_PS_VERSION_, '1.6', '>=') == true) { - $this->context->controller->addJquery(); - $this->context->controller->addJs($path . 'views/js/smartsupp.js'); - $this->context->controller->addCSS($path . 'views/css/smartsupp.css'); - if (version_compare(_PS_VERSION_, '1.6', '<') == true) { - $this->context->controller->addCSS($path . 'views/css/smartsupp-nobootstrap.css'); - } - } else { - $js .= ''; - $js .= ''; - $js .= ''; - } + $js .= ''; + $js .= ''; + $js .= ''; + } + + return $js; + } + + public function hookDisplayBackOfficeHeader() + { + $js = ''; + + if (strcmp(Tools::getValue('configure'), $this->name) === 0) { + $path = $this->_path; + $this->context->controller->addJquery(); + $this->context->controller->addJs($path . 'views/js/smartsupp.js'); + $this->context->controller->addCSS($path . 'views/css/smartsupp.css'); + $this->context->controller->addCSS($path . 'views/css/smartsupp-nobootstrap.css'); } return $js; @@ -335,4 +364,9 @@ protected function getAdminDir() { return basename(_PS_ADMIN_DIR_); } + + private function autoload() + { + include_once "{$this->getLocalPath()}vendor/autoload.php"; + } } diff --git a/smartsupp/translations/index.php b/smartsupp/translations/index.php deleted file mode 100644 index de4ac88..0000000 --- a/smartsupp/translations/index.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @link http://www.smartsupp.com - * @copyright 2016 Smartsupp.com - * @license GPL-2.0+ - * - * Plugin Name: Smartsupp Live Chat - * Plugin URI: http://www.smartsupp.com - * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 - * Author: Smartsupp - * Author URI: http://www.smartsupp.com - * Text Domain: smartsupp - * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt - */ - -header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/smartsupp/vendor/autoload.php b/smartsupp/vendor/autoload.php deleted file mode 100644 index c0a8cb9..0000000 --- a/smartsupp/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/smartsupp/vendor/composer/LICENSE b/smartsupp/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/smartsupp/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/smartsupp/vendor/composer/autoload_classmap.php b/smartsupp/vendor/composer/autoload_classmap.php deleted file mode 100644 index 3762ca3..0000000 --- a/smartsupp/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,12 +0,0 @@ - $baseDir . '/classes/Auth/Api.php', - 'SmartsuppAuthCurlRequest' => $baseDir . '/classes/Auth/Request/CurlRequest.php', - 'SmartsuppAuthHttpRequest' => $baseDir . '/classes/Auth/Request/HttpRequest.php', -); diff --git a/smartsupp/vendor/composer/autoload_namespaces.php b/smartsupp/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 9650b05..0000000 --- a/smartsupp/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,10 +0,0 @@ - array($vendorDir . '/smartsupp/chat-code-generator/src', $vendorDir . '/smartsupp/php-partner-client/src'), -); diff --git a/smartsupp/vendor/composer/autoload_psr4.php b/smartsupp/vendor/composer/autoload_psr4.php deleted file mode 100644 index 6c325d2..0000000 --- a/smartsupp/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,10 +0,0 @@ - array($baseDir . '/src'), -); diff --git a/smartsupp/vendor/composer/autoload_real.php b/smartsupp/vendor/composer/autoload_real.php deleted file mode 100755 index 64a9cc9..0000000 --- a/smartsupp/vendor/composer/autoload_real.php +++ /dev/null @@ -1,52 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once dirname(__FILE__) . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit8dab3547849c97a9298bf7cb711c8367::getInitializer($loader)); - } else { - $map = require dirname(__FILE__) . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require dirname(__FILE__) . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require dirname(__FILE__) . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(false); - - return $loader; - } -} diff --git a/smartsupp/vendor/composer/autoload_static.php b/smartsupp/vendor/composer/autoload_static.php deleted file mode 100644 index 9aaa686..0000000 --- a/smartsupp/vendor/composer/autoload_static.php +++ /dev/null @@ -1,50 +0,0 @@ - - array ( - 'Smartsupp\\LiveChat\\' => 19, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Smartsupp\\LiveChat\\' => - array ( - 0 => __DIR__ . '/../..' . '/src', - ), - ); - - public static $prefixesPsr0 = array ( - 'S' => - array ( - 'Smartsupp' => - array ( - 0 => __DIR__ . '/..' . '/smartsupp/chat-code-generator/src', - 1 => __DIR__ . '/..' . '/smartsupp/php-partner-client/src', - ), - ), - ); - - public static $classMap = array ( - 'SmartsuppAuthApi' => __DIR__ . '/../..' . '/classes/Auth/Api.php', - 'SmartsuppAuthCurlRequest' => __DIR__ . '/../..' . '/classes/Auth/Request/CurlRequest.php', - 'SmartsuppAuthHttpRequest' => __DIR__ . '/../..' . '/classes/Auth/Request/HttpRequest.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit8dab3547849c97a9298bf7cb711c8367::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit8dab3547849c97a9298bf7cb711c8367::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit8dab3547849c97a9298bf7cb711c8367::$prefixesPsr0; - $loader->classMap = ComposerStaticInit8dab3547849c97a9298bf7cb711c8367::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/smartsupp/vendor/composer/installed.json b/smartsupp/vendor/composer/installed.json deleted file mode 100644 index e1d1264..0000000 --- a/smartsupp/vendor/composer/installed.json +++ /dev/null @@ -1,91 +0,0 @@ -[ - { - "name": "smartsupp/chat-code-generator", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/smartsupp/chat-code-generator.git", - "reference": "1f63b44aeb90a1cd9e37b260a35b0ccb3377feea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/smartsupp/chat-code-generator/zipball/1f63b44aeb90a1cd9e37b260a35b0ccb3377feea", - "reference": "1f63b44aeb90a1cd9e37b260a35b0ccb3377feea", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.7.*" - }, - "time": "2018-11-08T15:36:32+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Smartsupp": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "authors": [ - { - "name": "Marek Gach", - "role": "lead" - } - ], - "description": "This simple PHP class allows you to easily generate Smartsupp.com JS chat code.", - "homepage": "https://www.smartsupp.com/", - "keywords": [ - "chat" - ] - }, - { - "name": "smartsupp/php-partner-client", - "version": "1.1", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/smartsupp/php-auth-client.git", - "reference": "caa587a89ae551f1356f083baf29d31567468020" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/smartsupp/php-auth-client/zipball/caa587a89ae551f1356f083baf29d31567468020", - "reference": "caa587a89ae551f1356f083baf29d31567468020", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.8.*" - }, - "time": "2019-09-30T15:08:09+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Smartsupp": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "authors": [ - { - "name": "Marek Gach", - "role": "lead" - } - ], - "description": "API client allows to register and login (obtain API key) from Smartsupp partner API.", - "homepage": "https://www.smartsupp.com/", - "keywords": [ - "chat" - ] - } -] diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/.gitignore b/smartsupp/vendor/smartsupp/chat-code-generator/.gitignore deleted file mode 100644 index 9b3d38c..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea/* -/vendor/ -composer.lock -/build/ \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/.travis.yml b/smartsupp/vendor/smartsupp/chat-code-generator/.travis.yml deleted file mode 100644 index a03008d..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm - -matrix: - allow_failures: - - php: hhvm - -before_script: - - composer require satooshi/php-coveralls:1.0.1 squizlabs/php_codesniffer - - composer install -script: - - vendor/bin/phpcs src/ -p --standard=PSR2 --report=summary - - mkdir -p build/logs - - vendor/bin/phpunit --configuration phpunit.xml --coverage-text - -after_success: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;' \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/README.md b/smartsupp/vendor/smartsupp/chat-code-generator/README.md deleted file mode 100644 index a1341bd..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[![Build Status](https://travis-ci.org/smartsupp/chat-code-generator.svg)](https://travis-ci.org/smartsupp/chat-code-generator) -[![Coverage Status](https://coveralls.io/repos/smartsupp/chat-code-generator/badge.svg?branch=master&service=github)](https://coveralls.io/github/smartsupp/chat-code-generator?branch=master) - -# Smartsupp chat code generator - -This is simple PHP class for Smartsupp chat API which helps you to generate chat JavaScript code. - -* https://www.smartsupp.com/ -* [More info about Smartsupp CHAT API](https://developers.smartsupp.com/chat/configuration) This is "Get started" doc for chat API. -* [More info about Smartsupp CHAT API - Overview](https://developers.smartsupp.com/chat/overview) This is full documentation for chat API. Note, that not all properties are possible to be set using this class. - -## Get Started - -Here is an example on how to use it: - -```php - $chat = new Smartsupp\ChatGenerator; - - $chat->setKey('XYZ123456'); - $chat->disableSendEmailTranscript(); - $chat->enableRating('advanced', true); - $chat->setBoxPosition('left', 'side', 20, 120); - $chat->setName('Johny Depp'); - $chat->setEmail('johny@depp.com'); - $chat->setVariable('orderTotal', 'Total orders', 150); - $chat->setVariable('lastOrder', 'Last ordered', '2015-07-09'); - $chat->setGoogleAnalytics('UA-123456'); - $data = $chat->render(); -``` - -## Copyright - -Copyright (c) 2016 Smartsupp.com, s.r.o. diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/composer.json b/smartsupp/vendor/smartsupp/chat-code-generator/composer.json deleted file mode 100644 index f2476a4..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "smartsupp/chat-code-generator", - "description": "This simple PHP class allows you to easily generate Smartsupp.com JS chat code.", - "type": "library", - "keywords": [ - "chat" - ], - "homepage": "https://www.smartsupp.com/", - "authors": [ - { - "name": "Marek Gach", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/smartsupp/chat-code-generator/issues", - "wiki": "https://github.com/smartsupp/chat-code-generator/wiki", - "source": "https://github.com/smartsupp/chat-code-generator" - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": {"Smartsupp": "src/"} - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.7.*" - } -} diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/index.php b/smartsupp/vendor/smartsupp/chat-code-generator/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/phpunit.xml b/smartsupp/vendor/smartsupp/chat-code-generator/phpunit.xml deleted file mode 100644 index 285b9a9..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/phpunit.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - ./tests/ - - - - - - src/ - - - - - - - \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/src/Smartsupp/ChatGenerator.php b/smartsupp/vendor/smartsupp/chat-code-generator/src/Smartsupp/ChatGenerator.php deleted file mode 100644 index 02c52e1..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/src/Smartsupp/ChatGenerator.php +++ /dev/null @@ -1,481 +0,0 @@ -=5.3 - * - * @package Smartsupp - * @author Marek Gach - * @copyright since 2015 SmartSupp.com - * @version Git: $Id$ - * @link https://github.com/smartsupp/chat-code-generator - * @since File available since Release 0.1 - */ -class ChatGenerator -{ - /** - * @var array Values which are allowed for ratingType param. - */ - protected $allowed_rating_types = array('advanced', 'simple'); - - /** - * @var array Values which are allowed for alignX param. - */ - protected $allowed_align_x = array('right', 'left'); - - /** - * @var array Values which are allowed for alignY param. - */ - protected $allowed_align_y = array('side', 'bottom'); - - /** - * @var array Values which are allowed for widget param. - */ - protected $allowed_widget = array('button', 'widget'); - - /** - * @var null|string Your unique chat code. Can be obtained after registration. - */ - protected $key = null; - - /** - * @var null|string By default chat conversation is terminated when visitor opens a sub-domain on your website. - */ - protected $cookie_domain = null; - - /** - * @var string Chat language. - */ - protected $language = 'en'; - - /** - * @var string Chat charset defaults to utf-8. - */ - protected $charset = 'utf-8'; - - /** - * @var null|string Email (basic information). - */ - protected $email = null; - - /** - * @var null|string Customer name (basic information). - */ - protected $name = null; - - /** - * @var null|array contain additional user information. - */ - protected $variables = null; - - /** - * @var bool When the visitor ends the conversation a confirmation window is displayed. This flag defaults to true - * and can be changed. - */ - protected $send_email_transcript = true; - - /** - * @var bool Indicate if rating is enabled. - */ - protected $rating_enabled = false; - - /** - * @var string Rating type. - */ - protected $rating_type = 'simple'; - - /** - * @var bool Set if rating comment is enambled. - */ - protected $rating_comment = false; - - /** - * @var string Chat X align. - */ - protected $align_x = null; - - /** - * @var string Chat Y align. - */ - protected $align_y = null; - - /** - * @var int Chat X offset. - */ - protected $offset_x = null; - - /** - * @var int Chat Y offset. - */ - protected $offset_y = null; - - /** - * @var string Widget type. - */ - protected $widget = null; - - /** - * @var null|string Google analytics key value. - */ - protected $ga_key = null; - - /** - * @var null|array Google analytics additional options. - */ - protected $ga_options = null; - - /** - * @var bool - */ - protected $hide_widget = false; - - /** - * @var null|string plugin platform - */ - protected $platform = null; - - public function __construct($key = null) - { - $this->key = $key; - } - - /** - * Set platform - serves as internal information for Smartsupp to identify which CMS and version is used. - * - * @param string $platform - */ - public function setPlatform($platform) - { - $this->platform = $platform; - } - - /** - * Set chat language. Also is checking if language is one of allowed values. - * - * @param string $language - * @throws \Exception when parameter value is incorrect - */ - public function setLanguage($language) - { - $this->language = $language; - } - - /** - * Set the charset. Check also if charset is allowed and valid value. - * - * @param string $charset - */ - public function setCharset($charset) - { - $this->charset = $charset; - } - - /** - * Allows to set Smartsupp code. - * - * @param string $key Smartsupp chat key. - */ - public function setKey($key) - { - $this->key = $key; - } - - /** - * Smartsupp visitor is identified by unique key stored in cookies. By default chat conversation is terminated when - * visitor opens a sub-domain on your website. You should set main domain as cookie domain if you want chat - * conversations uninterrupted across your sub-domains. Insert the cookieDomain parameter in your chat code on main - * domain and all sub-domains where you want the chat conversation uninterrupted. - * - * Example: Use value '.your-domain.com' to let chat work also on all sub-domains and main domain. - * - * @param string $cookie_domain - */ - public function setCookieDomain($cookie_domain) - { - $this->cookie_domain = $cookie_domain; - } - - /** - * When the visitor ends the conversation a confirmation window is displayed. In this window there is by default a - * button to send a transcript of the chat conversation to email. You can choose not to show this button. - */ - public function disableSendEmailTranscript() - { - $this->send_email_transcript = false; - } - - /** - * After visitors ends a chat conversation, he is prompted to rate the conversation. Rating is disabled by default. - * Together with enabling it you can set additional parameters. - * - * @param string $rating_type - * @param boolean|false $rating_comment - * @throws \Exception when parameter value is incorrect - */ - public function enableRating($rating_type = 'simple', $rating_comment = false) - { - if (!in_array($rating_type, $this->allowed_rating_types)) { - throw new \Exception("Rating type $rating_type is not allowed value. You can use only one of values: " . - implode(', ', $this->allowed_rating_types) . "."); - } - - $rating_comment = (bool) $rating_comment; - - $this->rating_enabled = true; - $this->rating_type = $rating_type; - $this->rating_comment = $rating_comment; - } - - /** - * You can send visitor name. So your visitors won't be anonymous and your chat agents will see info about every - * visitor, enabling agents to better focus on VIP visitors and provide customized answers. - * - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * You can send visitor email. So your visitors won't be anonymous and your chat agents will see info about every - * visitor, enabling agents to better focus on VIP visitors and provide customized answers. - * - * @param string $name - */ - public function setEmail($email) - { - $this->email = $email; - } - - /** - * Will add additional parameter into Extra user info variables list. - * - * @param $id Parameter ID. - * @param $label Parameter label. - * @param $value Parameter value. - */ - public function setVariable($id, $label, $value) - { - $variable = array('id' => $id, 'label' => $label, 'value' => $value); - - $this->variables[] = $variable; - } - - /** - * By default the chat box is displayed in bottom right corner of the website. You can change the default position - * along the bottom line or place the chat on right or left side of the website. - * - * @param string $align_x Align to right or left. - * @param string $align_y Align to bottom or side. - * @param int $offset_x Offset from left or right. - * @param int $offset_y Offset from top. - * @throws \Exception When params are not correct. - */ - public function setAlign($align_x = 'right', $align_y = 'bottom', $offset_x = 10, $offset_y = 100) - { - if (!in_array($align_x, $this->allowed_align_x)) { - throw new \Exception("AllignX value $align_x is not allowed value. You can use only one of values: " . - implode(', ', $this->allowed_align_x) . "."); - } - - if (!in_array($align_y, $this->allowed_align_y)) { - throw new \Exception("AllignY value $align_y is not allowed value. You can use only one of values: " . - implode(', ', $this->allowed_align_y) . "."); - } - - $this->align_x = $align_x; - $this->align_y = $align_y; - $this->offset_x = $offset_x; - $this->offset_y = $offset_y; - } - - /** - * We supports two chat-box layouts, widget and button. By default is activated layout widget. - * - * @param string $widget Parameter value. - * @throws \Exception when parameter value is incorrect - */ - public function setWidget($widget = 'widget') - { - if (!in_array($widget, $this->allowed_widget)) { - throw new \Exception("Widget value $widget is not allowed value. You can use only one of values: " . - implode(', ', $this->allowed_widget) . "."); - } - - $this->widget = $widget; - } - - /** - * Smartsupp is linked with your Google Analytics (GA) automatically. Smartsupp automatically checks your site's - * code for GA property ID and sends data to that account. If you are using Google Tag Manager (GTM) or you don't - * have GA code directly inserted in your site's code for some reason, you have to link your GA account as described - * here. - * If you have sub-domains on your website and you are tracking all sub-domains in one GA account, use the gaOptions - * parameter. You can find more info about gaOptions in Google Analytics documentation - * (@see https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#customizeTracker). - * - * @param $ga_key Google analytics key. - * @param array|null $ga_options Additional gaOptions. - */ - public function setGoogleAnalytics($ga_key, array $ga_options = null) - { - $this->ga_key = $ga_key; - $this->ga_options = $ga_options; - } - - /** - * You can hide chat box on certain pages by setting this variable. - */ - public function hideWidget() - { - $this->hide_widget = true; - } - - /** - * Function for javascript variable value escaping. - * - * @param $str string String to encode. - * @return string Encoded string. - */ - public function javascriptEscape($str) - { - $new_str = ''; - - for ($i = 0; $i < mb_strlen($str); $i++) { - // obtain single character - $char = mb_substr($str, $i, 1); - - // if is alphanumeric put directly into string - if (!in_array($char, array("'"))) { - $new_str .= $char; - } else { // else encode as hex - $new_str .= '\\x' . bin2hex($char); - } - } - - return $new_str; - } - - /** - * Will assemble chat JS code. Class property with name key need to be set before rendering. - * - * @param bool|false $print_out Force to echo JS chat code instead of returning it. - * @return string - * @throws \Exception Will reach exception when key param is not set. - */ - public function render($print_out = false) - { - if (empty($this->key)) { - throw new \Exception("At least KEY param must be set!"); - } - - $params = array(); - $params2 = array(); - - // set cookie domain if not blank - if ($this->cookie_domain) { - $params[] = "_smartsupp.cookieDomain = '%cookie_domain%';"; - } - - // If is set to false, turn off. Default value is true. - if (!$this->send_email_transcript) { - $params[] = "_smartsupp.sendEmailTanscript = false;"; - } - - if ($this->rating_enabled) { - $params[] = "_smartsupp.ratingEnabled = true; // by default false"; - $params[] = "_smartsupp.ratingType = '" . $this->rating_type . "'; // by default 'simple'"; - $params[] = "_smartsupp.ratingComment = " . ($this->rating_comment? 'true':'false') . "; // default false"; - } - - if ($this->align_x && $this->align_y && $this->widget) { - $params[] = "_smartsupp.alignX = '" . $this->align_x . "'; // or 'left'"; - $params[] = "_smartsupp.alignY = '" . $this->align_y . "'; // by default 'bottom'"; - $params[] = "_smartsupp.widget = '" . $this->widget . "'; // by default 'widget'"; - } - - if ($this->offset_x && $this->offset_y) { - $params[] = "_smartsupp.offsetX = " . (int)$this->offset_x . "; // offset from left / right, default 10"; - $params[] = "_smartsupp.offsetY = " . (int)$this->offset_y . "; // offset from top, default 100"; - } - - if ($this->platform) { - $params[] = "_smartsupp.sitePlatform = '" . self::javascriptEscape($this->platform) . "';"; - } - - // set detailed visitor's info - // basic info - if ($this->email) { - $params2[] = "smartsupp('email', '" . self::javascriptEscape($this->email) . "');"; - } - - if ($this->name) { - $params2[] = "smartsupp('name', '" . self::javascriptEscape($this->name) . "');"; - } - - - // extra info - if ($this->variables) { - $options = array(); - - foreach ($this->variables as $key => $value) { - $options[] = self::javascriptEscape($value['id']) .": {label: '" . - self::javascriptEscape($value['label']) . "', value: '" . self::javascriptEscape($value['value']) . - "'}"; - } - - $params2[] = "smartsupp('variables', {" . - implode(", ", $options) . - "});"; - } - - - // set GA key and additional GA params - if ($this->ga_key) { - $params[] = "_smartsupp.gaKey = '%ga_key%';"; - - if (!empty($this->ga_options)) { - $options = array(); - - foreach ($this->ga_options as $key => $value) { - $options[] = "'" . self::javascriptEscape($key) . "': '" . self::javascriptEscape($value) . "'"; - } - - $params[] = "_smartsupp.gaOptions = {" . implode(", ", $options) . "};"; - } - } - - // hide widget if needed - if ($this->hide_widget) { - $params[] = "_smartsupp.hideWidget = true;"; - } - - // create basic code and append params - $code = ""; - - $code = str_replace('%key%', self::javascriptEscape($this->key), $code); - $code = str_replace('%cookie_domain%', self::javascriptEscape($this->cookie_domain), $code); - $code = str_replace('%ga_key%', self::javascriptEscape($this->ga_key), $code); - - - if ($print_out) { - echo $code; - } else { - return $code; - } - } -} diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/src/Smartsupp/index.php b/smartsupp/vendor/smartsupp/chat-code-generator/src/Smartsupp/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/src/index.php b/smartsupp/vendor/smartsupp/chat-code-generator/src/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/tests/ChatGeneratorTest.php b/smartsupp/vendor/smartsupp/chat-code-generator/tests/ChatGeneratorTest.php deleted file mode 100644 index 2487a92..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/tests/ChatGeneratorTest.php +++ /dev/null @@ -1,257 +0,0 @@ -chat = new ChatGenerator(); - } - - public function test_javascriptEscape() - { - $ret = $this->chat->javascriptEscape('abc123'); - - $this->assertEquals('abc123', $ret); - } - - public function test_javascriptEscape_someScript() - { - $ret = $this->chat->javascriptEscape(""); - - $this->assertEquals('', $ret); - } - - public function test_javascriptEscape_someSpecialChars() - { - $ret = $this->chat->javascriptEscape("\"'*!@#$%^&*()_+}{:?><.,/`~"); - - $this->assertEquals('"\x27*!@#$%^&*()_+}{:?><.,/`~', $ret); - } - - public function test_hideWidget() - { - $this->chat->hideWidget(); - - $this->assertTrue(self::getPrivateField($this->chat, 'hide_widget')); - } - - public function test_setGoogleAnalytics() - { - $this->chat->setGoogleAnalytics('UA-123456789'); - - $this->assertEquals('UA-123456789', self::getPrivateField($this->chat, 'ga_key')); - } - - public function test_setGoogleAnalytics_withOptions() - { - $options = array('cookieDomain' => 'foo.example.com'); - $this->chat->setGoogleAnalytics('UA-123456789', $options); - - $this->assertEquals('UA-123456789', self::getPrivateField($this->chat, 'ga_key')); - $this->assertEquals($options, self::getPrivateField($this->chat, 'ga_options')); - } - - public function test_widget() - { - $this->chat->setWidget('button'); - $this->assertEquals('button', self::getPrivateField($this->chat, 'widget')); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Widget value foo is not allowed value. You can use only one of values: button, widget. - */ - public function test_widget_badParam() - { - $this->chat->setWidget('foo'); - } - - public function test_setBoxPosition() - { - $this->chat->setAlign('left', 'side', 20, 120); - - $this->assertEquals('left', self::getPrivateField($this->chat, 'align_x')); - $this->assertEquals('side', self::getPrivateField($this->chat, 'align_y')); - $this->assertEquals('20', self::getPrivateField($this->chat, 'offset_x')); - $this->assertEquals('120', self::getPrivateField($this->chat, 'offset_y')); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage AllignX value foo is not allowed value. You can use only one of values: right, left. - */ - public function test_setBoxPosition_badParam() - { - $this->chat->setAlign('foo', 'side', 20, 120); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage AllignY value foo is not allowed value. You can use only one of values: side, bottom. - */ - public function test_setBoxPosition_badParam2() - { - $this->chat->setAlign('left', 'foo', 20, 120); - } - - public function test_setVariable() - { - $this->chat->setVariable('userId', 'User ID', 123); - $this->chat->setVariable('orderedPrice', 'Ordered Price in Eshop', '128 000'); - - $this->assertEquals( - array( - array('id' => 'userId', 'label' => 'User ID', 'value' => 123), - array('id' => 'orderedPrice', 'label' => 'Ordered Price in Eshop', 'value' => '128 000') - ), - self::getPrivateField($this->chat, 'variables') - ); - } - - public function test_setUserBasicInformation() - { - $this->chat->setName('Johny Depp'); - $this->chat->setEmail('johny@depp.com'); - - $this->assertEquals('Johny Depp', self::getPrivateField($this->chat, 'name')); - $this->assertEquals('johny@depp.com', self::getPrivateField($this->chat, 'email')); - } - - public function test_enableRating() - { - $this->chat->enableRating('advanced', true); - - $this->assertTrue(self::getPrivateField($this->chat, 'rating_enabled')); - $this->assertEquals('advanced', self::getPrivateField($this->chat, 'rating_type')); - $this->assertTrue(self::getPrivateField($this->chat, 'rating_comment')); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Rating type foo is not allowed value. You can use only one of values: advanced, simple. - */ - public function test_enableRating_badParam() - { - $this->chat->enableRating('foo'); - } - - public function test_disableSendEmailTranscript() - { - $this->assertTrue(self::getPrivateField($this->chat, 'send_email_transcript')); - $this->chat->disableSendEmailTranscript(); - $this->assertFalse(self::getPrivateField($this->chat, 'send_email_transcript')); - } - - public function test_setCookieDomain() - { - $this->assertNull(self::getPrivateField($this->chat, 'cookie_domain')); - $this->chat->setCookieDomain('.foo.bar'); - $this->assertEquals('.foo.bar', self::getPrivateField($this->chat, 'cookie_domain')); - } - - public function test_setKey() - { - $this->assertNull(self::getPrivateField($this->chat, 'key')); - $this->chat->setKey('123456'); - $this->assertEquals('123456', self::getPrivateField($this->chat, 'key')); - } - - public function test_setCharset() - { - $this->assertEquals('utf-8', self::getPrivateField($this->chat, 'charset')); - $this->chat->setCharset('utf-32'); - $this->assertEquals('utf-32', self::getPrivateField($this->chat, 'charset')); - } - - public function test_setLanguage() - { - $this->assertEquals('en', self::getPrivateField($this->chat, 'language')); - $this->chat->setLanguage('cs'); - $this->assertEquals('cs', self::getPrivateField($this->chat, 'language')); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage At least KEY param must be set! - */ - public function test_render_keyNotSet() - { - $this->chat->render(); - } - - public function test_render_simple() - { - $this->chat->setKey('XYZ123456'); - $ret = $this->chat->render(); - - $expected = ""; - - $this->assertEquals($expected, $ret); - } - - public function test_render_simpleOutput() - { - $this->chat->setKey('XYZ123456'); - $ret = $this->chat->render(true); - - $this->assertNull($ret); - $this->expectOutputRegex('/.*window.smartsupp.*/'); - } - - public function test_render_allParams() - { - $this->chat->setKey('XYZ123456'); - $this->chat->setCookieDomain('.foo.bar'); - $this->chat->disableSendEmailTranscript(); - $this->chat->enableRating('advanced', true); - $this->chat->setAlign('left', 'side', 20, 120); - $this->chat->setWidget('button'); - $this->chat->setName('Johny Depp'); - $this->chat->setEmail('johny@depp.com'); - $this->chat->setVariable('orderTotal', 'Total orders', 150); - $this->chat->setVariable('lastOrder', 'Last ordered', '2015-07-09'); - $this->chat->setGoogleAnalytics('UA-123456', array('cookieDomain' => '.foo.bar')); - $this->chat->hideWidget(); - - $ret = $this->chat->render(); - - $this->assertEquals(file_get_contents(dirname(__FILE__) . '/chat_code.txt'), $ret); - } - - - /** - * Get private / protected field value using \ReflectionProperty object. - * - * @static - * @param mixed $object object to be used - * @param string $fieldName object property name - * @return mixed given property value - */ - public static function getPrivateField($object, $fieldName) - { - $refId = new \ReflectionProperty($object, $fieldName); - $refId->setAccessible(true); - $value = $refId->getValue($object); - $refId->setAccessible(false); - - return $value; - } -} diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/tests/bootstrap.php b/smartsupp/vendor/smartsupp/chat-code-generator/tests/bootstrap.php deleted file mode 100755 index f8157c3..0000000 --- a/smartsupp/vendor/smartsupp/chat-code-generator/tests/bootstrap.php +++ /dev/null @@ -1,6 +0,0 @@ - - var _smartsupp = _smartsupp || {}; - _smartsupp.key = 'XYZ123456'; -_smartsupp.cookieDomain = '.foo.bar'; -_smartsupp.sendEmailTanscript = false; -_smartsupp.ratingEnabled = true; // by default false -_smartsupp.ratingType = 'advanced'; // by default 'simple' -_smartsupp.ratingComment = true; // default false -_smartsupp.alignX = 'left'; // or 'left' -_smartsupp.alignY = 'side'; // by default 'bottom' -_smartsupp.widget = 'button'; // by default 'widget' -_smartsupp.offsetX = 20; // offset from left / right, default 10 -_smartsupp.offsetY = 120; // offset from top, default 100 -_smartsupp.gaKey = 'UA-123456'; -_smartsupp.gaOptions = {'cookieDomain': '.foo.bar'}; -_smartsupp.hideWidget = true; -window.smartsupp||(function(d) { - var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[]; - s=d.getElementsByTagName('script')[0];c=d.createElement('script'); - c.type='text/javascript';c.charset='utf-8';c.async=true; - c.src='//www.smartsuppchat.com/loader.js';s.parentNode.insertBefore(c,s); - })(document);smartsupp('email', 'johny@depp.com'); -smartsupp('name', 'Johny Depp'); -smartsupp('variables', {orderTotal: {label: 'Total orders', value: '150'}, lastOrder: {label: 'Last ordered', value: '2015-07-09'}}); - \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/chat-code-generator/tests/index.php b/smartsupp/vendor/smartsupp/chat-code-generator/tests/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/index.php b/smartsupp/vendor/smartsupp/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/php-partner-client/.gitignore b/smartsupp/vendor/smartsupp/php-partner-client/.gitignore deleted file mode 100644 index 44c1366..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.idea/* -/vendor/ -composer.lock -/build/ -test.php \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/php-partner-client/.travis.yml b/smartsupp/vendor/smartsupp/php-partner-client/.travis.yml deleted file mode 100644 index d8af461..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - -before_script: - - composer require satooshi/php-coveralls:1.0.1 squizlabs/php_codesniffer - - composer install -script: - - vendor/bin/phpcs src/ -p --standard=PSR2 --report=summary - - mkdir -p build/logs - - vendor/bin/phpunit --configuration phpunit.xml --coverage-text - -after_success: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;' \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/php-partner-client/README.md b/smartsupp/vendor/smartsupp/php-partner-client/README.md deleted file mode 100644 index 9199936..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/README.md +++ /dev/null @@ -1,92 +0,0 @@ -[![Build Status](https://travis-ci.org/smartsupp/php-auth-client.svg)](https://travis-ci.org/smartsupp/php-auth-client) -[![Coverage Status](https://coveralls.io/repos/github/smartsupp/php-auth-client/badge.svg?branch=master)](https://coveralls.io/github/smartsupp/php-auth-client?branch=master) - -# Smartsupp Authentication API PHP client - -* https://www.smartsupp.com/ - -## Get started - -- Response is successfull if not contains `error` property in `$response` array. -- The `error` is machine-readable name of error, and `message` is human-readable description of error. - -## create - -```php -$api = new Smartsupp\Auth\Api(); - -$response = $api->create(array( - 'email' => 'LOGIN_EMAIL', // required - 'password' => 'YOUR_PASSWORD', // optional, min length 6 characters - 'name' => 'John Doe', // optional - 'lang' => 'en', // optional, lowercase; 2 characters - 'partnerKey' => 'PARTNER_API_KEY' // optional -)); - -// print_r($response); // success response -array( - 'account' => array( - 'key' => 'CHAT_KEY', - 'lang' => 'en' - ), - 'user' => array( - 'email' => 'LOGIN_EMAIL', - 'name' => 'John Doe', - 'password' => 'YOUR_PASSWORD' - ) -); - -// print_r($response); // failure response -array( - 'error' => 'EmailExists', - 'message' => 'Email already exists', - 'hint' => 'email' -); -``` - -### Errors - -- `AuthError` - invalid PARTNER_KEY. -- `InvalidParam` - missing or invalid parameter (e.g.: email). -- `EmailExists` - email is already taken. - - -## login - -```php -$api = new Smartsupp\Auth\Api(); - -$response = $api->login(array( - 'email' => 'LOGIN_EMAIL', - 'password' => 'YOUR_PASSWORD' -)); - -// print_r($response); // success response -array( - 'account' => array( - 'key' => 'CHAT_KEY', - 'lang' => 'en' - ) -); - -// print_r($response); // failure response -array( - 'error' => 'InvalidCredential', - 'message' => 'Invalid password' -); -``` - -### Errors - -- `AuthError` - invalid PARTNER_KEY. -- `InvalidParam` - missing or invalid parameter (e.g.: email is not valid, password is too short). -- `IdentityNotFound` - account with this email not exists. -- `InvalidCredential` - email exists, bad password is incorrect. -- `LoginFailure` - something is bad with login. - -## Requirements -For backward compatibility with multiple plugins library supports PHP starting from version 5.3. It is highly possibly the constraint will change to 5.6+ in near future. - -## Copyright - -Copyright (c) 2016 Smartsupp.com, s.r.o. diff --git a/smartsupp/vendor/smartsupp/php-partner-client/composer.json b/smartsupp/vendor/smartsupp/php-partner-client/composer.json deleted file mode 100644 index fea698c..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "smartsupp/php-partner-client", - "description": "API client allows to register and login (obtain API key) from Smartsupp partner API.", - "type": "library", - "keywords": [ - "chat" - ], - "homepage": "https://www.smartsupp.com/", - "authors": [ - { - "name": "Marek Gach", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/smartsupp/php-partner-client/issues", - "wiki": "https://github.com/smartsupp/php-partner-client/wiki", - "source": "https://github.com/smartsupp/php-partner-client" - }, - "autoload": { - "psr-0": {"Smartsupp": "src/"} - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.8.*" - } -} diff --git a/smartsupp/vendor/smartsupp/php-partner-client/index.php b/smartsupp/vendor/smartsupp/php-partner-client/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/php-partner-client/phpunit.xml b/smartsupp/vendor/smartsupp/php-partner-client/phpunit.xml deleted file mode 100644 index 7794e50..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/phpunit.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - ./tests/ - - - - - - src/ - - - - - - - \ No newline at end of file diff --git a/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Api.php b/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Api.php deleted file mode 100644 index 7b42b20..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Api.php +++ /dev/null @@ -1,169 +0,0 @@ -=5.3 - * - * @package Smartsupp - * @author Marek Gach - * @copyright since 2016 SmartSupp.com - * @version Git: $Id$ - * @link https://github.com/smartsupp/php-partner-client - */ -class Api -{ - /** API call base URL */ - const API_BASE_URL = 'https://www.smartsupp.com/'; - - /** URL paths for all used resources endpoints methods */ - const URL_LOGIN = 'account/login', - URL_CREATE = 'account/create'; - - /** - * @var null|CurlRequest - */ - private $handle = null; - - /** - * Api constructor. - * - * @param null|HttpRequest $handle inject custom request handle to better unit test - * @throws Exception - */ - public function __construct(HttpRequest $handle = null) - { -// @codeCoverageIgnoreStart - if (!function_exists('curl_init')) { - throw new Exception('Smartsupp API client needs the CURL PHP extension.'); - } - if (!function_exists('json_decode')) { - throw new Exception('Smartsupp API client needs the JSON PHP extension.'); - } -// @codeCoverageIgnoreEnd - - $this->handle = $handle ?: new CurlRequest(); - } - - /** - * Allows to create user. - * - * @param array $data - * @return array - */ - public function create($data) - { - return $this->post(self::URL_CREATE, $data); - } - - /** - * Allows to log in account and obtain user key. - * - * @param array $data - * @return array - */ - public function login($data) - { - return $this->post(self::URL_LOGIN, $data); - } - - /** - * Helper function to execute POST request. - * - * @param string $path request path - * @param array $data optional POST data array - * @return array|string array data or json encoded string of result - * @throws Exception - */ - private function post($path, $data) - { - return $this->run($path, 'post', $data); - } - - /** - * Execute request against URL path with given method, optional data array. Also allows - * to specify if json data will be decoded before function return. - * - * @param $path request path - * @param $method request method - * @param null|array $data optional request data - * @param bool $json_decode specify if returned json data will be decoded - * @return string|array JSON data or array containing decoded JSON data - * @throws Exception - */ - private function run($path, $method, $data = null, $json_decode = true) - { - $this->handle->setOption(CURLOPT_URL, self::API_BASE_URL . $path); - $this->handle->setOption(CURLOPT_RETURNTRANSFER, true); - $this->handle->setOption(CURLOPT_FAILONERROR, false); - $this->handle->setOption(CURLOPT_SSL_VERIFYPEER, true); - $this->handle->setOption(CURLOPT_SSL_VERIFYHOST, 2); - $this->handle->setOption(CURLOPT_USERAGENT, 'cURL:php-partner-client'); - - // forward headers from request - $headers = array( - 'X-Forwarded-For: ' . $this->getUserIpAddr(), - 'Accept-Language: ' . $this->getAcceptLanguage(), - ); - $this->handle->setOption(CURLOPT_HTTPHEADER, $headers); - - switch ($method) { - case 'post': - $this->handle->setOption(CURLOPT_POST, true); - $this->handle->setOption(CURLOPT_POSTFIELDS, $data); - break; - } - - $response = $this->handle->execute(); - - if ($response === false) { - throw new Exception($this->handle->getLastErrorMessage()); - } - - $this->handle->close(); - - if ($json_decode) { - $response = json_decode($response, true); - - if (json_last_error() != JSON_ERROR_NONE) { - throw new Exception('Cannot parse API response JSON. Error: ' . json_last_error_msg()); - } - } - - return $response; - } - - /** - * Return user IP address. - * - * @return string|null - */ - private function getUserIpAddr() - { - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { - // ip from share internet - return $_SERVER['HTTP_CLIENT_IP']; - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { - // ip pass from proxy - return $_SERVER['HTTP_X_FORWARDED_FOR']; - } else { - // in case is not set - may be in CLI - return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null; - } - } - - /** - * Get Accept-Language header. - * - * @return string|null - */ - private function getAcceptLanguage() - { - return isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null; - } -} diff --git a/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Request/CurlRequest.php b/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Request/CurlRequest.php deleted file mode 100644 index 6ccfd6a..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Request/CurlRequest.php +++ /dev/null @@ -1,90 +0,0 @@ -init($url); - } - - /** - * Init cURL connection object. - * - * @param string|null $url - * @throws Exception - */ - public function init($url = null) - { - $this->handle = curl_init($url); - } - - /** - * Set cURL option with given value. - * - * @param string $name option name - * @param string|array $value option value - */ - public function setOption($name, $value) - { - curl_setopt($this->handle, $name, $value); - } - - /** - * Execute cURL request. - * - * @return boolean - */ - public function execute() - { - return curl_exec($this->handle); - } - - /** - * Get array of information about last request. - * - * @param int $opt options - * @return array info array - */ - public function getInfo($opt = 0) - { - return curl_getinfo($this->handle, $opt); - } - - /** - * Close cURL handler connection. - */ - public function close() - { - curl_close($this->handle); - } - - /** - * Return last error message as string. - * - * @return string formatted error message - */ - public function getLastErrorMessage() - { - $message = sprintf("cURL failed with error #%d: %s", curl_errno($this->handle), curl_error($this->handle)); - return $message; - } -} diff --git a/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Request/HttpRequest.php b/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Request/HttpRequest.php deleted file mode 100644 index 6132206..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/src/Smartsupp/Auth/Request/HttpRequest.php +++ /dev/null @@ -1,47 +0,0 @@ -assertNotNull($api); - } - - public function test_login() - { - $data = array( - 'email' => 'test5@kurzor.net', - 'password' => 'xxx' - ); - - $response = array( - 'account' => array( - 'key' => 'CHAT_KEY', - 'lang' => 'en' - ) - ); - - $http = $this->getMock('Smartsupp\Auth\Request\HttpRequest'); - $http->expects($this->any()) - ->method('execute') - ->will($this->returnValue(json_encode($response))); - - // create class under test using $http instead of a real CurlRequest - $api = new Api($http); - $this->assertEquals($response, $api->login($data)); - } - - /** - * @expectedException Exception - * @expectedExceptionMessage Foo is at bar! - */ - public function test_response_error() - { - $data = array( - 'email' => 'test5@kurzor.net', - 'password' => 'xxx' - ); - - $http = $this->getMock('Smartsupp\Auth\Request\HttpRequest'); - $http->expects($this->any()) - ->method('execute') - ->will($this->returnValue(false)); - - $http->expects($this->any()) - ->method('getLastErrorMessage') - ->will($this->returnValue('Foo is at bar!')); - - // create class under test using $http instead of a real CurlRequest - $api = new Api($http); - $api->login($data); - } - - public function test_create() - { - $data = array( - 'email' => 'LOGIN_EMAIL', // required - 'password' => 'YOUR_PASSWORD', // optional, min length 6 characters - 'name' => 'John Doe', // optional - 'lang' => 'en', // optional, lowercase; 2 characters - 'partnerKey' => 'PARTNER_API_KEY' // optional - ); - - $response = array( - 'account' => array( - 'key' => 'CHAT_KEY', - 'lang' => 'en' - ), - 'user' => array( - 'email' => 'LOGIN_EMAIL', - 'name' => 'John Doe', - 'password' => 'YOUR_PASSWORD' - ) - ); - - $http = $this->getMock('Smartsupp\Auth\Request\HttpRequest'); - $http->expects($this->any()) - ->method('execute') - ->will($this->returnValue(json_encode($response))); - - // create class under test using $http instead of a real CurlRequest - $api = new Api($http); - $this->assertEquals($response, $api->create($data)); - } -} diff --git a/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/Request/CurlRequestTest.php b/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/Request/CurlRequestTest.php deleted file mode 100644 index c119cab..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/Request/CurlRequestTest.php +++ /dev/null @@ -1,75 +0,0 @@ -curl = new CurlRequest('https://www.smartsupp.com/cs/product'); - } - - public function test_constructorVoid() - { - $this->curl = new CurlRequest(); - - $this->assertInstanceOf('Smartsupp\Auth\Request\CurlRequest', $this->curl); - } - - public function test_constructorUrl() - { - $this->curl = new CurlRequest('https://smartsupp.com'); - - $this->assertInstanceOf('Smartsupp\Auth\Request\CurlRequest', $this->curl); - } - - public function test_initError() - { - $this->curl->init('https://smartsupp.com'); - } - - public function test_setOption() - { - $this->curl->setOption(CURLOPT_HEADER, 0); - } - - /** - * @expectedExceptionMessage curl_setopt() expects parameter 1 to be resource, null given - */ - public function test_setOption_notInitialized() - { - $this->curl->setOption(CURLOPT_HEADER, 0); - } - - public function test_close() - { - $this->curl->close(); - } - - public function test_execute() - { - $this->curl->setOption(CURLOPT_RETURNTRANSFER, TRUE); - $this->assertNotEmpty($this->curl->execute()); - } - - public function test_getInfo() - { - $this->curl->setOption(CURLOPT_RETURNTRANSFER, TRUE); - $this->curl->execute(); - $this->assertEquals($this->curl->getInfo(CURLINFO_HTTP_CODE), 200); - } - - public function test_getLastErrorMessage() - { - $this->curl->setOption(CURLOPT_URL, 'foo://bar'); - $this->curl->setOption(CURLOPT_RETURNTRANSFER, TRUE); - $this->curl->execute(); - $this->assertNotEmpty($this->curl->getLastErrorMessage()); - } -} diff --git a/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/Request/index.php b/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/Request/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/index.php b/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/Auth/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/index.php b/smartsupp/vendor/smartsupp/php-partner-client/tests/Smartsupp/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/vendor/smartsupp/php-partner-client/tests/bootstrap.php b/smartsupp/vendor/smartsupp/php-partner-client/tests/bootstrap.php deleted file mode 100755 index f8157c3..0000000 --- a/smartsupp/vendor/smartsupp/php-partner-client/tests/bootstrap.php +++ /dev/null @@ -1,6 +0,0 @@ - - * @link http://www.smartsupp.com - * @copyright 2016 Smartsupp.com - * @license GPL-2.0+ - * - * Plugin Name: Smartsupp Live Chat - * Plugin URI: http://www.smartsupp.com - * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 - * Author: Smartsupp - * Author URI: http://www.smartsupp.com - * Text Domain: smartsupp - * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt - */ - -header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/smartsupp/views/index.php b/smartsupp/views/index.php deleted file mode 100644 index de4ac88..0000000 --- a/smartsupp/views/index.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @link http://www.smartsupp.com - * @copyright 2016 Smartsupp.com - * @license GPL-2.0+ - * - * Plugin Name: Smartsupp Live Chat - * Plugin URI: http://www.smartsupp.com - * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 - * Author: Smartsupp - * Author URI: http://www.smartsupp.com - * Text Domain: smartsupp - * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt - */ - -header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/smartsupp/views/js/index.php b/smartsupp/views/js/index.php deleted file mode 100644 index de4ac88..0000000 --- a/smartsupp/views/js/index.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @link http://www.smartsupp.com - * @copyright 2016 Smartsupp.com - * @license GPL-2.0+ - * - * Plugin Name: Smartsupp Live Chat - * Plugin URI: http://www.smartsupp.com - * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 - * Author: Smartsupp - * Author URI: http://www.smartsupp.com - * Text Domain: smartsupp - * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt - */ - -header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/smartsupp/views/templates/admin/includes/index.php b/smartsupp/views/templates/admin/includes/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/views/templates/admin/index.php b/smartsupp/views/templates/admin/index.php deleted file mode 100644 index de4ac88..0000000 --- a/smartsupp/views/templates/admin/index.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @link http://www.smartsupp.com - * @copyright 2016 Smartsupp.com - * @license GPL-2.0+ - * - * Plugin Name: Smartsupp Live Chat - * Plugin URI: http://www.smartsupp.com - * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 - * Author: Smartsupp - * Author URI: http://www.smartsupp.com - * Text Domain: smartsupp - * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt - */ - -header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/smartsupp/views/templates/front/index.php b/smartsupp/views/templates/front/index.php deleted file mode 100644 index e69de29..0000000 diff --git a/smartsupp/views/templates/index.php b/smartsupp/views/templates/index.php deleted file mode 100644 index de4ac88..0000000 --- a/smartsupp/views/templates/index.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @link http://www.smartsupp.com - * @copyright 2016 Smartsupp.com - * @license GPL-2.0+ - * - * Plugin Name: Smartsupp Live Chat - * Plugin URI: http://www.smartsupp.com - * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 - * Author: Smartsupp - * Author URI: http://www.smartsupp.com - * Text Domain: smartsupp - * License: GPL-2.0+ - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt - */ - -header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/Utility/VersionUtility.php b/src/Utility/VersionUtility.php new file mode 100644 index 0000000..7c49b3d --- /dev/null +++ b/src/Utility/VersionUtility.php @@ -0,0 +1,35 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +namespace Smartsupp\LiveChat\Utility; + +class VersionUtility +{ + public static function isPsVersionGreaterThan($version) + { + return version_compare(_PS_VERSION_, $version, '>'); + } + + public static function isPsVersionGreaterOrEqualTo($version) + { + return version_compare(_PS_VERSION_, $version, '>='); + } +} \ No newline at end of file diff --git a/src/Utility/index.php b/src/Utility/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/src/Utility/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/src/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/smartsupp/translations/br.php b/translations/br.php similarity index 100% rename from smartsupp/translations/br.php rename to translations/br.php diff --git a/smartsupp/translations/cs.php b/translations/cs.php similarity index 86% rename from smartsupp/translations/cs.php rename to translations/cs.php index 4167783..f22f800 100755 --- a/smartsupp/translations/cs.php +++ b/translations/cs.php @@ -2,11 +2,14 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{smartsupp}prestashop>smartsupp_b10e4b6a10e84bd7b5312f076d2f3ea7'] = 'Smartsupp Live Chat'; -$_MODULE['<{smartsupp}prestashop>smartsupp_32c9a2cba97ffc0669ab2c2a139865da'] = 'Smartsupp kombinuje live chat a chatboty, aby vám šetřil čas.'; +$_MODULE['<{smartsupp}prestashop>smartsupp_b82eb30ace208db211486bdb42475ee5'] = 'Smartsupp je váš osobní online nákupní asistent, vytvořený pro zvýšení míry konverze a prodeje prostřednictvím zapojení návštěvníků v reálném čase a ve správný čas.'; +$_MODULE['<{smartsupp}prestashop>smartsupp_b62af1ad4918b402f148fc2e7841677f'] = 'Opravdu chcete odinstalovat Smartsupp Live Chat?'; +$_MODULE['<{smartsupp}prestashop>smartsupp_4f1adf15fc9b2682736ce1c6749c2175'] = 'Ztratíte všechna data související s tímto modulem.'; $_MODULE['<{smartsupp}prestashop>smartsupp_5db4230515f342afbaee33d685410f04'] = 'Chybí Smartsupp klíč.'; $_MODULE['<{smartsupp}prestashop>smartsupp_c9cc8cce247e49bae79f15173ce97354'] = 'Uložit'; $_MODULE['<{smartsupp}prestashop>smartsupp_630f6dc397fe74e52d5189e2c80f282b'] = 'Zpět'; +$_MODULE['<{smartsupp}prestashop>smartsupp_5b4b55bc08ab8887708ec6188b33f238'] = 'Neuvádějte zde kód chatu – toto pole je pro'; +$_MODULE['<{smartsupp}prestashop>smartsupp_aacbc2c9886e5520a4714cec4c72f1d4'] = '(volitelně) pokročilé přizpůsobení prostřednictvím '; $_MODULE['<{smartsupp}prestashop>smartsupp_f4f70727dc34561dfde1a3c529b6205c'] = 'Pokročilé nastavení'; $_MODULE['<{smartsupp}prestashop>smartsupp_6a9187ca4a2a8b1b97b58c1decd1a494'] = 'API (volitelné)'; $_MODULE['<{smartsupp}prestashop>smartsupp_462390017ab0938911d2d4e964c0cab7'] = 'Nastavení uloženo'; @@ -28,12 +31,6 @@ $_MODULE['<{smartsupp}prestashop>landing_page_6f1bf85c9ebb3c7fa26251e1e335e032'] = 'podmínkami'; $_MODULE['<{smartsupp}prestashop>landing_page_be5d5d37542d75f93a87094459f76678'] = 'a'; $_MODULE['<{smartsupp}prestashop>landing_page_a50a1efe5421320d2dc8ba27e1f7463d'] = 'DPA'; -$_MODULE['<{smartsupp}prestashop>connect_account_3dc3748ee6772a392b583c399cb96fe5'] = 'Nemáte účet?'; -$_MODULE['<{smartsupp}prestashop>connect_account_8ea211024d4a6ad6119a33549dae10d6'] = 'Založit účet zdarma'; -$_MODULE['<{smartsupp}prestashop>connect_account_bffe9a3c9a7e00ba00a11749e022d911'] = 'Přihlásit se'; -$_MODULE['<{smartsupp}prestashop>connect_account_df1555fe48479f594280a2e03f9a8186'] = 'E-mail:'; -$_MODULE['<{smartsupp}prestashop>connect_account_b341a59d5636ed3d6a819137495b08a0'] = 'Heslo:'; -$_MODULE['<{smartsupp}prestashop>connect_account_b05d72142020283dc6812fd3a9bc691c'] = 'Zapomněl/a jsem heslo'; $_MODULE['<{smartsupp}prestashop>configuration_9f0e8ccbad931f6a5970bcf9d80482c3'] = 'Deaktivovat chat'; $_MODULE['<{smartsupp}prestashop>configuration_bfc719af6420fa1d34b6f3cc858d3494'] = 'Všechno je nastavené a funkční'; $_MODULE['<{smartsupp}prestashop>configuration_ca546d2931eac2cb8f292a583aa2e3fa'] = 'Gratulujeme! Smartsupp live chat je teď nasazený na vaší stránce.'; @@ -41,6 +38,12 @@ $_MODULE['<{smartsupp}prestashop>configuration_e81c4e4f2b7b93b481e13a8553c2ae1b'] = 'nebo nejprve'; $_MODULE['<{smartsupp}prestashop>configuration_b191593bc602ff910417b3f85bb496ca'] = 'nastavte'; $_MODULE['<{smartsupp}prestashop>configuration_b0c2b3626fad53c9cdd6cdd9d3251e90'] = 'vzhled chat boxu'; +$_MODULE['<{smartsupp}prestashop>connect_account_3dc3748ee6772a392b583c399cb96fe5'] = 'Nemáte účet?'; +$_MODULE['<{smartsupp}prestashop>connect_account_8ea211024d4a6ad6119a33549dae10d6'] = 'Založit účet zdarma'; +$_MODULE['<{smartsupp}prestashop>connect_account_bffe9a3c9a7e00ba00a11749e022d911'] = 'Přihlásit se'; +$_MODULE['<{smartsupp}prestashop>connect_account_df1555fe48479f594280a2e03f9a8186'] = 'E-mail:'; +$_MODULE['<{smartsupp}prestashop>connect_account_b341a59d5636ed3d6a819137495b08a0'] = 'Heslo:'; +$_MODULE['<{smartsupp}prestashop>connect_account_b05d72142020283dc6812fd3a9bc691c'] = 'Zapomněl/a jsem heslo'; $_MODULE['<{smartsupp}prestashop>clients_9f07b115f358391fc5118f1488f69965'] = 'NEJOBLÍBENĚJŠÍ CHAT ĆESKÝCH WEBŮ A ESHOPŮ'; $_MODULE['<{smartsupp}prestashop>clients_79733ba6c329916522a8369f2b94ac99'] = 'Přidejte se k více než 500 000 společnostem a živnostníkům spoléhajícím na Smartsupp po celém světě'; $_MODULE['<{smartsupp}prestashop>features_9e9a9f11d422e372100a4c07df22f849'] = 'MULTICHANNEL'; diff --git a/smartsupp/translations/de.php b/translations/de.php similarity index 100% rename from smartsupp/translations/de.php rename to translations/de.php diff --git a/smartsupp/translations/en.php b/translations/en.php similarity index 77% rename from smartsupp/translations/en.php rename to translations/en.php index e7cee04..b3720ab 100644 --- a/smartsupp/translations/en.php +++ b/translations/en.php @@ -2,23 +2,26 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{smartsupp}prestashop>smartsupp_b10e4b6a10e84bd7b5312f076d2f3ea7'] = 'Smartsupp Live Chat'; -$_MODULE['<{smartsupp}prestashop>smartsupp_62c23de32bc191f88f77eaef905ca293'] = 'Smartsupp is your personal shopping assistant. It combines live chat and chatbots to save your time and help you turn visitors into loyal customers. Smartsupp is one of the most popular products in Europe with 50 000 active European webshops and websites.'; -$_MODULE['<{smartsupp}prestashop>smartsupp_a20e991223473d0779ade2d16211bed4'] = 'Opravdu chcete odinstalovat Smartsupp? Ztratíte tak všechna data uložená v modulu.'; -$_MODULE['<{smartsupp}prestashop>smartsupp_5db4230515f342afbaee33d685410f04'] = 'Chybí Smartsupp klíč.'; -$_MODULE['<{smartsupp}prestashop>smartsupp_c9cc8cce247e49bae79f15173ce97354'] = 'Uložit'; -$_MODULE['<{smartsupp}prestashop>smartsupp_630f6dc397fe74e52d5189e2c80f282b'] = 'Zpět k seznamu'; -$_MODULE['<{smartsupp}prestashop>smartsupp_f4f70727dc34561dfde1a3c529b6205c'] = 'Nastavení'; -$_MODULE['<{smartsupp}prestashop>smartsupp_6a9187ca4a2a8b1b97b58c1decd1a494'] = 'API (volitelné)'; -$_MODULE['<{smartsupp}prestashop>smartsupp_78a81f0852c850f502d91479f1465761'] = 'Nevkládejte zde chat kód - toto pole je určeno pro (volitelné) pokročilé úpravy pomocí #.'; -$_MODULE['<{smartsupp}prestashop>smartsupp_462390017ab0938911d2d4e964c0cab7'] = 'Nastavení uloženo'; +$_MODULE['<{smartsupp}prestashop>smartsupp_d3a313dc870b6246b569f4532bd8a778'] = 'Smartsupp Live Chat & AI Chatbots'; +$_MODULE['<{smartsupp}prestashop>smartsupp_b82eb30ace208db211486bdb42475ee5'] = 'Smartsupp is your personal online shopping assistant, built to increase conversion rates and sales via visitor engagement in real-time, at the right time.'; +$_MODULE['<{smartsupp}prestashop>smartsupp_b62af1ad4918b402f148fc2e7841677f'] = 'Are you sure you want to uninstall Smartsupp Live Chat? '; +$_MODULE['<{smartsupp}prestashop>smartsupp_4f1adf15fc9b2682736ce1c6749c2175'] = 'You will lose all the data related to this module.'; +$_MODULE['<{smartsupp}prestashop>smartsupp_5db4230515f342afbaee33d685410f04'] = 'No Smartsupp key provided.'; +$_MODULE['<{smartsupp}prestashop>smartsupp_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; +$_MODULE['<{smartsupp}prestashop>smartsupp_630f6dc397fe74e52d5189e2c80f282b'] = 'Back to list'; +$_MODULE['<{smartsupp}prestashop>smartsupp_5b4b55bc08ab8887708ec6188b33f238'] = 'Don\'t put the chat code here - this box is for '; +$_MODULE['<{smartsupp}prestashop>smartsupp_aacbc2c9886e5520a4714cec4c72f1d4'] = '(optional) advanced customizations via '; +$_MODULE['<{smartsupp}prestashop>smartsupp_f4f70727dc34561dfde1a3c529b6205c'] = 'Settings'; +$_MODULE['<{smartsupp}prestashop>smartsupp_6a9187ca4a2a8b1b97b58c1decd1a494'] = 'API (Optional)'; +$_MODULE['<{smartsupp}prestashop>smartsupp_462390017ab0938911d2d4e964c0cab7'] = 'Settings updated successfully'; $_MODULE['<{smartsupp}prestashop>smartsupp_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; -$_MODULE['<{smartsupp}prestashop>smartsupp_49ee3087348e8d44e1feda1917443987'] = 'Jméno'; +$_MODULE['<{smartsupp}prestashop>smartsupp_49ee3087348e8d44e1feda1917443987'] = 'Name'; $_MODULE['<{smartsupp}prestashop>smartsupp_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; -$_MODULE['<{smartsupp}prestashop>smartsupp_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefon'; +$_MODULE['<{smartsupp}prestashop>smartsupp_bcc254b55c4a1babdf1dcb82c207506b'] = 'Phone'; $_MODULE['<{smartsupp}prestashop>smartsupp_bbbabdbe1b262f75d99d62880b953be1'] = 'Role'; -$_MODULE['<{smartsupp}prestashop>smartsupp_d06ce84f89526b7bac0002dbbc1e8297'] = 'Útrata'; -$_MODULE['<{smartsupp}prestashop>smartsupp_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Objednávky'; +$_MODULE['<{smartsupp}prestashop>smartsupp_d06ce84f89526b7bac0002dbbc1e8297'] = 'Spendings'; +$_MODULE['<{smartsupp}prestashop>smartsupp_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Orders'; +$_MODULE['<{smartsupp}prestashop>adminsmartsuppajax_364fca2fd3206702e62d2e1df8ea1176'] = 'Unknown Error Occurred'; $_MODULE['<{smartsupp}prestashop>landing_page_21bdc5689c12595ae14298354d5550d5'] = 'Already have an account?'; $_MODULE['<{smartsupp}prestashop>landing_page_bffe9a3c9a7e00ba00a11749e022d911'] = 'Log in'; $_MODULE['<{smartsupp}prestashop>landing_page_8ea211024d4a6ad6119a33549dae10d6'] = 'Create a free account'; @@ -30,12 +33,6 @@ $_MODULE['<{smartsupp}prestashop>landing_page_6f1bf85c9ebb3c7fa26251e1e335e032'] = 'Terms'; $_MODULE['<{smartsupp}prestashop>landing_page_be5d5d37542d75f93a87094459f76678'] = 'and'; $_MODULE['<{smartsupp}prestashop>landing_page_a50a1efe5421320d2dc8ba27e1f7463d'] = 'DPA'; -$_MODULE['<{smartsupp}prestashop>connect_account_3dc3748ee6772a392b583c399cb96fe5'] = 'Not a Smartsupp user yet?'; -$_MODULE['<{smartsupp}prestashop>connect_account_8ea211024d4a6ad6119a33549dae10d6'] = 'Create a free account'; -$_MODULE['<{smartsupp}prestashop>connect_account_bffe9a3c9a7e00ba00a11749e022d911'] = 'Log in'; -$_MODULE['<{smartsupp}prestashop>connect_account_df1555fe48479f594280a2e03f9a8186'] = 'E-mail:'; -$_MODULE['<{smartsupp}prestashop>connect_account_b341a59d5636ed3d6a819137495b08a0'] = 'Password:'; -$_MODULE['<{smartsupp}prestashop>connect_account_b05d72142020283dc6812fd3a9bc691c'] = 'I forgot my password'; $_MODULE['<{smartsupp}prestashop>configuration_9f0e8ccbad931f6a5970bcf9d80482c3'] = ' Deactivate chat'; $_MODULE['<{smartsupp}prestashop>configuration_bfc719af6420fa1d34b6f3cc858d3494'] = 'All set and running'; $_MODULE['<{smartsupp}prestashop>configuration_ca546d2931eac2cb8f292a583aa2e3fa'] = 'Congratulations! Smartsupp live chat is already visible on your website.'; @@ -43,6 +40,12 @@ $_MODULE['<{smartsupp}prestashop>configuration_e81c4e4f2b7b93b481e13a8553c2ae1b'] = 'or'; $_MODULE['<{smartsupp}prestashop>configuration_b191593bc602ff910417b3f85bb496ca'] = 'Set up'; $_MODULE['<{smartsupp}prestashop>configuration_b0c2b3626fad53c9cdd6cdd9d3251e90'] = 'chat box design first'; +$_MODULE['<{smartsupp}prestashop>connect_account_3dc3748ee6772a392b583c399cb96fe5'] = 'Not a Smartsupp user yet?'; +$_MODULE['<{smartsupp}prestashop>connect_account_8ea211024d4a6ad6119a33549dae10d6'] = 'Create a free account'; +$_MODULE['<{smartsupp}prestashop>connect_account_bffe9a3c9a7e00ba00a11749e022d911'] = 'Log in'; +$_MODULE['<{smartsupp}prestashop>connect_account_df1555fe48479f594280a2e03f9a8186'] = 'E-mail:'; +$_MODULE['<{smartsupp}prestashop>connect_account_b341a59d5636ed3d6a819137495b08a0'] = 'Password:'; +$_MODULE['<{smartsupp}prestashop>connect_account_b05d72142020283dc6812fd3a9bc691c'] = 'I forgot my password'; $_MODULE['<{smartsupp}prestashop>clients_9f07b115f358391fc5118f1488f69965'] = 'POPULAR CHAT SOLUTION OF EUROPEAN WEBSHOPS AND WEBSITES'; $_MODULE['<{smartsupp}prestashop>clients_79733ba6c329916522a8369f2b94ac99'] = 'Join the 469 000 companies and freelancers relying on Smartsupp'; $_MODULE['<{smartsupp}prestashop>features_9e9a9f11d422e372100a4c07df22f849'] = 'MULTICHANNEL'; diff --git a/smartsupp/translations/es.php b/translations/es.php similarity index 100% rename from smartsupp/translations/es.php rename to translations/es.php diff --git a/smartsupp/translations/fr.php b/translations/fr.php similarity index 100% rename from smartsupp/translations/fr.php rename to translations/fr.php diff --git a/smartsupp/translations/hu.php b/translations/hu.php similarity index 100% rename from smartsupp/translations/hu.php rename to translations/hu.php diff --git a/translations/index.php b/translations/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/translations/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/smartsupp/translations/it.php b/translations/it.php similarity index 100% rename from smartsupp/translations/it.php rename to translations/it.php diff --git a/smartsupp/translations/nl.php b/translations/nl.php similarity index 100% rename from smartsupp/translations/nl.php rename to translations/nl.php diff --git a/smartsupp/translations/pl.php b/translations/pl.php similarity index 100% rename from smartsupp/translations/pl.php rename to translations/pl.php diff --git a/smartsupp/translations/pt.php b/translations/pt.php similarity index 100% rename from smartsupp/translations/pt.php rename to translations/pt.php diff --git a/smartsupp/translations/sk.php b/translations/sk.php similarity index 100% rename from smartsupp/translations/sk.php rename to translations/sk.php diff --git a/upgrade/index.php b/upgrade/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/upgrade/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/upgrade/upgrade-2.2.0.php b/upgrade/upgrade-2.2.0.php new file mode 100644 index 0000000..ebdfb59 --- /dev/null +++ b/upgrade/upgrade-2.2.0.php @@ -0,0 +1,37 @@ + + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * @package Smartsupp + * @link http://www.smartsupp.com + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Text Domain: smartsupp + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +use Smartsupp\LiveChat\Utility\VersionUtility; + +/** + * @param Module $module + * + * @return bool + */ +function upgrade_module_2_2_0($module) +{ + if (VersionUtility::isPsVersionGreaterThan('1.6')) { + $module->registerHook('displayBackOfficeHeader'); + $module->unregisterHook('backOfficeHeader'); + } + + return true; +} diff --git a/views/css/index.php b/views/css/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/views/css/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/smartsupp/views/css/smartsupp.css b/views/css/smartsupp.css similarity index 99% rename from smartsupp/views/css/smartsupp.css rename to views/css/smartsupp.css index 885441a..5b4baa8 100755 --- a/smartsupp/views/css/smartsupp.css +++ b/views/css/smartsupp.css @@ -10,7 +10,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/views/img/all-changes-saved.png b/views/img/all-changes-saved.png similarity index 100% rename from smartsupp/views/img/all-changes-saved.png rename to views/img/all-changes-saved.png diff --git a/smartsupp/views/img/all-done.png b/views/img/all-done.png similarity index 100% rename from smartsupp/views/img/all-done.png rename to views/img/all-done.png diff --git a/smartsupp/views/img/avatar-grey.png b/views/img/avatar-grey.png similarity index 100% rename from smartsupp/views/img/avatar-grey.png rename to views/img/avatar-grey.png diff --git a/smartsupp/views/img/chatbot asset.png b/views/img/chatbot asset.png similarity index 100% rename from smartsupp/views/img/chatbot asset.png rename to views/img/chatbot asset.png diff --git a/smartsupp/views/img/chatbot.png b/views/img/chatbot.png similarity index 100% rename from smartsupp/views/img/chatbot.png rename to views/img/chatbot.png diff --git a/smartsupp/views/img/dashboard.png b/views/img/dashboard.png similarity index 100% rename from smartsupp/views/img/dashboard.png rename to views/img/dashboard.png diff --git a/smartsupp/views/img/done.png b/views/img/done.png similarity index 100% rename from smartsupp/views/img/done.png rename to views/img/done.png diff --git a/smartsupp/views/img/icon-20x20.png b/views/img/icon-20x20.png similarity index 100% rename from smartsupp/views/img/icon-20x20.png rename to views/img/icon-20x20.png diff --git a/smartsupp/views/img/index.php b/views/img/index.php similarity index 96% rename from smartsupp/views/img/index.php rename to views/img/index.php index f5356c9..9adc013 100755 --- a/smartsupp/views/img/index.php +++ b/views/img/index.php @@ -11,7 +11,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/views/img/insportline.png b/views/img/insportline.png similarity index 100% rename from smartsupp/views/img/insportline.png rename to views/img/insportline.png diff --git a/smartsupp/views/img/logo.png b/views/img/logo.png similarity index 100% rename from smartsupp/views/img/logo.png rename to views/img/logo.png diff --git a/smartsupp/views/img/mobile.png b/views/img/mobile.png similarity index 100% rename from smartsupp/views/img/mobile.png rename to views/img/mobile.png diff --git a/smartsupp/views/img/motorgarten.png b/views/img/motorgarten.png similarity index 100% rename from smartsupp/views/img/motorgarten.png rename to views/img/motorgarten.png diff --git a/smartsupp/views/img/multichannel.png b/views/img/multichannel.png similarity index 100% rename from smartsupp/views/img/multichannel.png rename to views/img/multichannel.png diff --git a/smartsupp/views/img/redfox.png b/views/img/redfox.png similarity index 100% rename from smartsupp/views/img/redfox.png rename to views/img/redfox.png diff --git a/smartsupp/views/img/smartsupp_logo.png b/views/img/smartsupp_logo.png similarity index 100% rename from smartsupp/views/img/smartsupp_logo.png rename to views/img/smartsupp_logo.png diff --git a/smartsupp/views/img/tablet-screen.png b/views/img/tablet-screen.png similarity index 100% rename from smartsupp/views/img/tablet-screen.png rename to views/img/tablet-screen.png diff --git a/smartsupp/views/img/travelking.png b/views/img/travelking.png similarity index 100% rename from smartsupp/views/img/travelking.png rename to views/img/travelking.png diff --git a/views/index.php b/views/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/views/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/js/index.php b/views/js/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/views/js/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/smartsupp/views/js/smartsupp.js b/views/js/smartsupp.js similarity index 93% rename from smartsupp/views/js/smartsupp.js rename to views/js/smartsupp.js index b7a0bcf..0fa803e 100755 --- a/smartsupp/views/js/smartsupp.js +++ b/views/js/smartsupp.js @@ -10,7 +10,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp @@ -84,8 +84,8 @@ jQuery(document).ready( function($) { errMsg = false; } else { - $("div.messages").show(); - $("div.messages span").html(data.message); + $("#smartsupp-login-alerts").show(); + $("#smartsupp-login-alert").html(data.message); errMsg = true; } } @@ -107,7 +107,7 @@ jQuery(document).ready( function($) { dataType: 'json', headers: { "cache-control": "no-cache" }, success: function(data) { - $("input#smartsupp_key").val(data.key); + $("input#smartsupp_key").val(data.key); $("#smartsupp_configuration p.email").html(data.email); if (data.error === null) { $("#smartsupp_create_account .alerts").hide(); diff --git a/smartsupp/views/templates/admin/configuration.tpl b/views/templates/admin/configuration.tpl similarity index 98% rename from smartsupp/views/templates/admin/configuration.tpl rename to views/templates/admin/configuration.tpl index 7d64b80..e2f7ea1 100755 --- a/smartsupp/views/templates/admin/configuration.tpl +++ b/views/templates/admin/configuration.tpl @@ -10,7 +10,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/views/templates/admin/connect_account.tpl b/views/templates/admin/connect_account.tpl similarity index 92% rename from smartsupp/views/templates/admin/connect_account.tpl rename to views/templates/admin/connect_account.tpl index 5679cf0..9d681a0 100755 --- a/smartsupp/views/templates/admin/connect_account.tpl +++ b/views/templates/admin/connect_account.tpl @@ -10,7 +10,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp @@ -39,6 +39,9 @@

{l s='Log in' mod='smartsupp'}

+
+
+
diff --git a/smartsupp/views/templates/admin/includes/clients.tpl b/views/templates/admin/includes/clients.tpl similarity index 100% rename from smartsupp/views/templates/admin/includes/clients.tpl rename to views/templates/admin/includes/clients.tpl diff --git a/smartsupp/views/templates/admin/includes/features.tpl b/views/templates/admin/includes/features.tpl similarity index 100% rename from smartsupp/views/templates/admin/includes/features.tpl rename to views/templates/admin/includes/features.tpl diff --git a/smartsupp/vendor/composer/index.php b/views/templates/admin/includes/index.php similarity index 100% rename from smartsupp/vendor/composer/index.php rename to views/templates/admin/includes/index.php diff --git a/views/templates/admin/index.php b/views/templates/admin/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/views/templates/admin/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/smartsupp/views/templates/admin/landing_page.tpl b/views/templates/admin/landing_page.tpl similarity index 99% rename from smartsupp/views/templates/admin/landing_page.tpl rename to views/templates/admin/landing_page.tpl index 19146dc..e491b43 100755 --- a/smartsupp/views/templates/admin/landing_page.tpl +++ b/views/templates/admin/landing_page.tpl @@ -10,7 +10,7 @@ * Plugin Name: Smartsupp Live Chat * Plugin URI: http://www.smartsupp.com * Description: Adds Smartsupp Live Chat code to PrestaShop. - * Version: 2.1.9 + * Version: 2.2.0 * Author: Smartsupp * Author URI: http://www.smartsupp.com * Text Domain: smartsupp diff --git a/smartsupp/views/templates/front/chat_widget.tpl b/views/templates/front/chat_widget.tpl similarity index 100% rename from smartsupp/views/templates/front/chat_widget.tpl rename to views/templates/front/chat_widget.tpl diff --git a/smartsupp/vendor/index.php b/views/templates/front/index.php similarity index 100% rename from smartsupp/vendor/index.php rename to views/templates/front/index.php diff --git a/views/templates/index.php b/views/templates/index.php new file mode 100644 index 0000000..ed66748 --- /dev/null +++ b/views/templates/index.php @@ -0,0 +1,30 @@ + + * @link http://www.smartsupp.com + * @copyright 2016 Smartsupp.com + * @license GPL-2.0+ + * + * Plugin Name: Smartsupp Live Chat + * Plugin URI: http://www.smartsupp.com + * Description: Adds Smartsupp Live Chat code to PrestaShop. + * Version: 2.2.0 + * Author: Smartsupp + * Author URI: http://www.smartsupp.com + * Text Domain: smartsupp + * License: GPL-2.0+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt + */ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit;