From 68bcc6c5a73f46c36276f9c6fec0882627ac7e14 Mon Sep 17 00:00:00 2001 From: Alvin Johnson So Date: Fri, 6 May 2022 19:16:48 +0800 Subject: [PATCH 01/11] Applied pattern matching lib and upgrade script for updating patterns to support the pattern matching lib --- .gitignore | 1 + composer.json | 26 + composer.lock | 1116 +++++++++++++++++ prestashop1.6/config.xml | 2 +- .../admin/AdminTawktoController.php | 2 +- prestashop1.6/index.php | 2 +- prestashop1.6/tawkto.php | 45 +- prestashop1.6/upgrade/Upgrade-1.2.0.php | 2 +- prestashop1.6/upgrade/Upgrade-1.2.3.php | 2 +- prestashop1.6/upgrade/Upgrade-1.3.0.php | 153 +++ .../admin/tawkto/helpers/view/view.tpl | 2 +- prestashop1.6/views/templates/hook/widget.tpl | 2 +- prestashop1.7/config.xml | 2 +- .../admin/AdminTawktoController.php | 2 +- prestashop1.7/index.php | 2 +- prestashop1.7/tawkto.php | 60 +- prestashop1.7/upgrade/Upgrade-1.2.0.php | 2 +- prestashop1.7/upgrade/Upgrade-1.2.3.php | 2 +- prestashop1.7/upgrade/Upgrade-1.3.0.php | 153 +++ .../admin/tawkto/helpers/view/view.tpl | 2 +- prestashop1.7/views/templates/hook/widget.tpl | 2 +- 21 files changed, 1511 insertions(+), 71 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 prestashop1.6/upgrade/Upgrade-1.3.0.php create mode 100644 prestashop1.7/upgrade/Upgrade-1.3.0.php diff --git a/.gitignore b/.gitignore index 2602c29..32b1ec0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.zip ./build/tawkto +**/vendor diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c248ae2 --- /dev/null +++ b/composer.json @@ -0,0 +1,26 @@ +{ + "name": "tawk/tawk-prestashop", + "description": "Prestashop plugin for tawk.to", + "type": "project", + "repositories": { + "tawk-url-utils": { + "type": "vcs", + "url": "https://github.com/tawk/tawk-url-utils.git" + } + }, + "require": { + "tawk/url-utils": "2.0.1" + }, + "license": "AFL-3.0", + "scripts": { + "auto-index": "composer run auto-index:1.6 && composer run auto-index:1.7", + "auto-index:1.6": "autoindex prestashop:add:index ./prestashop1.6", + "auto-index:1.7": "autoindex prestashop:add:index ./prestashop1.7", + "build" : "composer run build:1.6 && composer run build:1.7", + "build:1.6" : "COMPOSER_VENDOR_DIR=./prestashop1.6/vendor composer install --no-dev", + "build:1.7" : "COMPOSER_VENDOR_DIR=./prestashop1.7/vendor composer install --no-dev" + }, + "require-dev": { + "prestashop/autoindex": "^2.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..f46d088 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1116 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "b200ad8c6cea27c6f148575eca71159e", + "packages": [ + { + "name": "tawk/url-utils", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/tawk/tawk-url-utils.git", + "reference": "73c166333707d893b0160fa9b5eae7aa8fbfa03c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tawk/tawk-url-utils/zipball/73c166333707d893b0160fa9b5eae7aa8fbfa03c", + "reference": "73c166333707d893b0160fa9b5eae7aa8fbfa03c", + "shasum": "" + }, + "require-dev": { + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tawk\\": "lib", + "Tawk\\Tests\\": "tests" + } + }, + "scripts": { + "post-install-cmd": [ + "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility)" + ], + "post-update-cmd": [ + "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility)" + ], + "test": [ + "phpunit" + ], + "lint": [ + "phpcs -p -s -v --runtime-set ignore_warnings_on_exit true ." + ], + "lint:fix": [ + "phpcbf -p -s -v .; err=$?; if [ $err -eq 1 ]; then exit 0; else exit $err; fi;" + ] + }, + "support": { + "source": "https://github.com/tawk/tawk-url-utils/tree/2.0.1", + "issues": "https://github.com/tawk/tawk-url-utils/issues" + }, + "time": "2022-01-28T11:14:45+00:00" + } + ], + "packages-dev": [ + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "prestashop/autoindex", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/PrestaShopCorp/autoindex.git", + "reference": "355c224de4ca8766d63a038dcdcb24f56cb19fec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/355c224de4ca8766d63a038dcdcb24f56cb19fec", + "reference": "355c224de4ca8766d63a038dcdcb24f56cb19fec", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.10", + "php": ">=7.2", + "symfony/console": "^3.4 || ~4.0 || ~5.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.83", + "prestashop/php-dev-tools": "1.*" + }, + "bin": [ + "bin/autoindex" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\AutoIndex\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AFL-3.0" + ], + "authors": [ + { + "name": "PrestaShop SA", + "email": "contact@prestashop.com" + } + ], + "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", + "homepage": "https://github.com/PrestaShopCorp/autoindex", + "support": { + "source": "https://github.com/PrestaShopCorp/autoindex/tree/v2.0.0" + }, + "time": "2021-06-09T15:37:17+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-12T16:02:29+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-15T08:07:45+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T21:10:46+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-04T08:16:47+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c", + "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.0.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-13T20:10:05+00:00" + }, + { + "name": "symfony/string", + "version": "v6.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-22T08:18:02+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/prestashop1.6/config.xml b/prestashop1.6/config.xml index d70c2e6..09a72ca 100644 --- a/prestashop1.6/config.xml +++ b/prestashop1.6/config.xml @@ -2,7 +2,7 @@ tawkto - + diff --git a/prestashop1.6/controllers/admin/AdminTawktoController.php b/prestashop1.6/controllers/admin/AdminTawktoController.php index 3a4b34b..06c72d2 100644 --- a/prestashop1.6/controllers/admin/AdminTawktoController.php +++ b/prestashop1.6/controllers/admin/AdminTawktoController.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.6/index.php b/prestashop1.6/index.php index 0cce47d..2f5effc 100644 --- a/prestashop1.6/index.php +++ b/prestashop1.6/index.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.6/tawkto.php b/prestashop1.6/tawkto.php index 28788be..c085304 100644 --- a/prestashop1.6/tawkto.php +++ b/prestashop1.6/tawkto.php @@ -1,26 +1,30 @@ name = 'tawkto'; $this->tab = 'front_office_features'; - $this->version = '1.2.3'; + $this->version = '1.3.0'; $this->author = 'tawk.to'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.6'); @@ -113,11 +117,8 @@ public function hookDisplayFooter() $show_pages = $this->getArrayFromJson($options->show_oncustom); $show = false; - foreach ($show_pages as $slug) { - if (stripos($_SERVER['REQUEST_URI'], $slug)!==false) { - $show = true; - break; - } + if (UrlPatternMatcher::match($_SERVER['REQUEST_URI'], $show_pages)) { + $show = true; } if (!$show && !in_array($this->context->controller->php_self, array('index', 'category', 'product'))) { diff --git a/prestashop1.6/upgrade/Upgrade-1.2.0.php b/prestashop1.6/upgrade/Upgrade-1.2.0.php index b7a25da..78361df 100644 --- a/prestashop1.6/upgrade/Upgrade-1.2.0.php +++ b/prestashop1.6/upgrade/Upgrade-1.2.0.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.6/upgrade/Upgrade-1.2.3.php b/prestashop1.6/upgrade/Upgrade-1.2.3.php index 47d9144..9689134 100644 --- a/prestashop1.6/upgrade/Upgrade-1.2.3.php +++ b/prestashop1.6/upgrade/Upgrade-1.2.3.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.6/upgrade/Upgrade-1.3.0.php b/prestashop1.6/upgrade/Upgrade-1.3.0.php new file mode 100644 index 0000000..df8ac25 --- /dev/null +++ b/prestashop1.6/upgrade/Upgrade-1.3.0.php @@ -0,0 +1,153 @@ +shop->getBaseURL(true)); + $shop_host = $base_url['host'] . ':' . $base_url['port']; + + if (!$opts) { + return false; + } + + $opts = json_decode($opts); + + + if (isset($opts->show_oncustom)) { + $show_oncustom = json_decode($opts->show_oncustom); + if (is_array($show_oncustom)) { + $opts->show_oncustom = addWildcardToPatternList($show_oncustom, $shop_host); + } + } + + if (isset($opts->hide_oncustom)) { + $hide_oncustom = json_decode($opts->hide_oncustom); + if (is_array($hide_oncustom)) { + $opts->hide_oncustom = addWildcardToPatternList($hide_oncustom, $shop_host); + } + } + + return Configuration::updateValue( + TawkTo::TAWKTO_WIDGET_OPTS, + json_encode($opts), + false, + $shop_group_id, + $shop_id + ); +} + +function addWildcardToPatternList($patternList, $storeHost) +{ + $wildcard = PathHelper::get_wildcard(); + + $newPatternList = []; + $addedPatterns = []; + + foreach ($patternList as $pattern) { + if (empty($pattern)) { + continue; + } + + $pattern = ltrim($pattern, PHP_EOL); + $pattern = trim($pattern); + + if (strpos($pattern, 'http://') !== 0 && + strpos($pattern, 'https://') !== 0 && + strpos($pattern, '/') !== 0 + ) { + // Check if the first part of the string is a host. + // If not, add a leading / so that the pattern + // matcher treats is as a path. + $firstPatternChunk = explode('/', $pattern)[0]; + if ($firstPatternChunk !== $storeHost) { + $pattern = '/' . $pattern; + } + } + + $newPatternList[] = $pattern; + $newPattern = $pattern . '/' . $wildcard; + if (in_array($newPattern, $patternList, true)) { + continue; + } + + if (true === isset($addedPatterns[$newPattern])) { + continue; + } + + $newPatternList[] = $newPattern; + $addedPatterns[$newPattern] = true; + } + + // EOL for display purposes + return json_encode($newPatternList); +} diff --git a/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl b/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl index 2d4ca62..235e0ca 100644 --- a/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl +++ b/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl @@ -12,7 +12,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) *} diff --git a/prestashop1.6/views/templates/hook/widget.tpl b/prestashop1.6/views/templates/hook/widget.tpl index e05fadf..5d7fc16 100644 --- a/prestashop1.6/views/templates/hook/widget.tpl +++ b/prestashop1.6/views/templates/hook/widget.tpl @@ -12,7 +12,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) *} diff --git a/prestashop1.7/config.xml b/prestashop1.7/config.xml index 4dc0210..d3c0f05 100644 --- a/prestashop1.7/config.xml +++ b/prestashop1.7/config.xml @@ -2,7 +2,7 @@ tawkto - + diff --git a/prestashop1.7/controllers/admin/AdminTawktoController.php b/prestashop1.7/controllers/admin/AdminTawktoController.php index 1c1d46d..f02088a 100644 --- a/prestashop1.7/controllers/admin/AdminTawktoController.php +++ b/prestashop1.7/controllers/admin/AdminTawktoController.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.7/index.php b/prestashop1.7/index.php index 0cce47d..2f5effc 100644 --- a/prestashop1.7/index.php +++ b/prestashop1.7/index.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.7/tawkto.php b/prestashop1.7/tawkto.php index 830ee8d..5c2450a 100644 --- a/prestashop1.7/tawkto.php +++ b/prestashop1.7/tawkto.php @@ -1,26 +1,30 @@ name = 'tawkto'; $this->tab = 'front_office_features'; - $this->version = '1.2.3'; + $this->version = '1.3.0'; $this->author = 'tawk.to'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.7'); @@ -98,14 +102,8 @@ public function hookDisplayFooter() $show_pages = $this->getArrayFromJson($options->show_oncustom); $show = false; - foreach ($show_pages as $slug) { - if (!empty($slug)) { - $slug = str_ireplace(array('http://','https://'), '', $slug); - if (stripos($current_page, $slug)!==false) { - $show = true; - break; - } - } + if (UrlPatternMatcher::match($current_page, $show_pages)) { + $show = true; } if (!$show) { @@ -136,16 +134,8 @@ public function hookDisplayFooter() $hide_pages = $this->getArrayFromJson($options->hide_oncustom); $show = true; - foreach ($hide_pages as $slug) { - // we need to add htmlspecialchars due to slashes added when saving to database - $slug = (string) htmlspecialchars($slug); - if (!empty($slug)) { - $slug = str_ireplace(array('http://','https://'), '', $slug); - if (stripos($current_page, $slug)!==false) { - $show = false; - break; - } - } + if (UrlPatternMatcher::match($current_page, $hide_pages)) { + $show = false; } if (!$show) { diff --git a/prestashop1.7/upgrade/Upgrade-1.2.0.php b/prestashop1.7/upgrade/Upgrade-1.2.0.php index b7a25da..78361df 100644 --- a/prestashop1.7/upgrade/Upgrade-1.2.0.php +++ b/prestashop1.7/upgrade/Upgrade-1.2.0.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.7/upgrade/Upgrade-1.2.3.php b/prestashop1.7/upgrade/Upgrade-1.2.3.php index 47d9144..9689134 100644 --- a/prestashop1.7/upgrade/Upgrade-1.2.3.php +++ b/prestashop1.7/upgrade/Upgrade-1.2.3.php @@ -13,7 +13,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/prestashop1.7/upgrade/Upgrade-1.3.0.php b/prestashop1.7/upgrade/Upgrade-1.3.0.php new file mode 100644 index 0000000..df8ac25 --- /dev/null +++ b/prestashop1.7/upgrade/Upgrade-1.3.0.php @@ -0,0 +1,153 @@ +shop->getBaseURL(true)); + $shop_host = $base_url['host'] . ':' . $base_url['port']; + + if (!$opts) { + return false; + } + + $opts = json_decode($opts); + + + if (isset($opts->show_oncustom)) { + $show_oncustom = json_decode($opts->show_oncustom); + if (is_array($show_oncustom)) { + $opts->show_oncustom = addWildcardToPatternList($show_oncustom, $shop_host); + } + } + + if (isset($opts->hide_oncustom)) { + $hide_oncustom = json_decode($opts->hide_oncustom); + if (is_array($hide_oncustom)) { + $opts->hide_oncustom = addWildcardToPatternList($hide_oncustom, $shop_host); + } + } + + return Configuration::updateValue( + TawkTo::TAWKTO_WIDGET_OPTS, + json_encode($opts), + false, + $shop_group_id, + $shop_id + ); +} + +function addWildcardToPatternList($patternList, $storeHost) +{ + $wildcard = PathHelper::get_wildcard(); + + $newPatternList = []; + $addedPatterns = []; + + foreach ($patternList as $pattern) { + if (empty($pattern)) { + continue; + } + + $pattern = ltrim($pattern, PHP_EOL); + $pattern = trim($pattern); + + if (strpos($pattern, 'http://') !== 0 && + strpos($pattern, 'https://') !== 0 && + strpos($pattern, '/') !== 0 + ) { + // Check if the first part of the string is a host. + // If not, add a leading / so that the pattern + // matcher treats is as a path. + $firstPatternChunk = explode('/', $pattern)[0]; + if ($firstPatternChunk !== $storeHost) { + $pattern = '/' . $pattern; + } + } + + $newPatternList[] = $pattern; + $newPattern = $pattern . '/' . $wildcard; + if (in_array($newPattern, $patternList, true)) { + continue; + } + + if (true === isset($addedPatterns[$newPattern])) { + continue; + } + + $newPatternList[] = $newPattern; + $addedPatterns[$newPattern] = true; + } + + // EOL for display purposes + return json_encode($newPatternList); +} diff --git a/prestashop1.7/views/templates/admin/tawkto/helpers/view/view.tpl b/prestashop1.7/views/templates/admin/tawkto/helpers/view/view.tpl index 4fbbf65..2b9c51e 100644 --- a/prestashop1.7/views/templates/admin/tawkto/helpers/view/view.tpl +++ b/prestashop1.7/views/templates/admin/tawkto/helpers/view/view.tpl @@ -12,7 +12,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) *} diff --git a/prestashop1.7/views/templates/hook/widget.tpl b/prestashop1.7/views/templates/hook/widget.tpl index 408ee45..7245af7 100644 --- a/prestashop1.7/views/templates/hook/widget.tpl +++ b/prestashop1.7/views/templates/hook/widget.tpl @@ -12,7 +12,7 @@ * to support@tawk.to so we can send you a copy immediately. * * @author tawkto support@tawk.to - * @copyright Copyright (c) 2014-2021 tawk.to + * @copyright Copyright (c) 2014-2022 tawk.to * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) *} From 1a2af309dddb2c1701831f880ce13c328926c7f4 Mon Sep 17 00:00:00 2001 From: Alvin Johnson So Date: Tue, 10 May 2022 18:28:43 +0800 Subject: [PATCH 02/11] fixed upgrade script adding multiple wildcards at the end of the existing patterns --- prestashop1.6/upgrade/Upgrade-1.3.0.php | 16 ++- .../admin/tawkto/helpers/view/view.tpl | 73 +++++++++++- prestashop1.7/upgrade/Upgrade-1.3.0.php | 17 ++- .../admin/tawkto/helpers/view/view.tpl | 110 +++++++++++++++++- 4 files changed, 205 insertions(+), 11 deletions(-) diff --git a/prestashop1.6/upgrade/Upgrade-1.3.0.php b/prestashop1.6/upgrade/Upgrade-1.3.0.php index df8ac25..5bda1c4 100644 --- a/prestashop1.6/upgrade/Upgrade-1.3.0.php +++ b/prestashop1.6/upgrade/Upgrade-1.3.0.php @@ -106,10 +106,24 @@ function update_visibility_opts($shop_group_id = null, $shop_id = null) ); } +function checkPatternListHasWildcard($patternList, $wildcard) { + foreach ($patternList as $pattern) { + if (strpos($pattern, $wildcard) > -1) { + return true; + } + } + + return false; +} + function addWildcardToPatternList($patternList, $storeHost) { $wildcard = PathHelper::get_wildcard(); + if (checkPatternListHasWildcard($patternList, $wildcard)) { + return json_encode($patternList); + } + $newPatternList = []; $addedPatterns = []; @@ -144,7 +158,7 @@ function addWildcardToPatternList($patternList, $storeHost) continue; } - $newPatternList[] = $newPattern; + $newPatternList[] = $newPattern; $addedPatterns[$newPattern] = true; } diff --git a/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl b/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl index 235e0ca..b95d7b5 100644 --- a/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl +++ b/prestashop1.6/views/templates/admin/tawkto/helpers/view/view.tpl @@ -27,6 +27,46 @@ margin-top: 0; margin-bottom: 0; } +/* Tooltip */ +.tawk-tooltip { + position: relative; + display: inline; + color: #03a84e; +} + +.tawk-tooltip .tawk-tooltiptext { + visibility: hidden; + background-color: #545454; + color: #fff; + text-align: center; + padding: 0.5rem; + max-width: 300px; + border-radius: 0.5rem; + font-size: 0.7rem; + line-height: 0.9; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1000; + top: 12px; +} + +.tawk-tooltip .tawk-tooltiptext::before { + content: ""; + display: block; + width: 0; + height: 0; + position: absolute; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #545454; + top: -5px; + left: 5px; +} + +.tawk-tooltip:hover .tawk-tooltiptext { + visibility: visible; +}