From 656f87440ded757745f5b64800dbdc514e1fba28 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Tue, 31 Jul 2012 07:58:27 +0000 Subject: [PATCH] [-] MO : blockadvertising update did not update the image extension #PSCFV-3355 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16615 b9a71923-0436-4b27-9f14-aed3839534dd --- .../php/p15015_blockadvertising_extension.php | 36 +++++++++++++++++++ install-dev/upgrade/sql/1.5.0.15.sql | 5 +++ 2 files changed, 41 insertions(+) create mode 100644 install-dev/upgrade/php/p15015_blockadvertising_extension.php create mode 100644 install-dev/upgrade/sql/1.5.0.15.sql diff --git a/install-dev/upgrade/php/p15015_blockadvertising_extension.php b/install-dev/upgrade/php/p15015_blockadvertising_extension.php new file mode 100644 index 000000000..580d718d9 --- /dev/null +++ b/install-dev/upgrade/php/p15015_blockadvertising_extension.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 15469 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function p15015_blockadvertising_extension() +{ + // Try to update with the extension of the image that exists in the module directory + if (file_exists(_PS_MODULE_DIR_.'blockadvertising')) + foreach (scandir(_PS_MODULE_DIR_.'blockadvertising') as $file) + if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png'))) + Configuration::updateGlobalValue('BLOCKADVERT_IMG_EXT', substr($file, strrpos($file, '.') + 1)); + return true; +} \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.0.15.sql b/install-dev/upgrade/sql/1.5.0.15.sql new file mode 100644 index 000000000..ec7f8de82 --- /dev/null +++ b/install-dev/upgrade/sql/1.5.0.15.sql @@ -0,0 +1,5 @@ +SET NAMES 'utf8'; + +/* PHP:p15015_blockadvertising_extension(); */; + +