diff --git a/.gitignore b/.gitignore index 6aa576e3..6242a2e1 100644 --- a/.gitignore +++ b/.gitignore @@ -118,4 +118,5 @@ modules/labelgenerate/img/ modules/product_vouchers/*.csv modules/labelgenerate/img/* modules/purchaseguide/img/* +!modules/purchaseguide/img/index.php diff --git a/modules/purchaseguide/AdminGuideCategories.php b/modules/purchaseguide/AdminGuideCategories.php index 897a6602..48e278c3 100644 --- a/modules/purchaseguide/AdminGuideCategories.php +++ b/modules/purchaseguide/AdminGuideCategories.php @@ -134,7 +134,7 @@ class AdminGuideCategories extends AdminTab 'max_bytes' => $this->maxImageBytes, 'allowed_format' => 'JPEG', 'html_file' => "img", - 'path' => $obj->getImageFileUrl() + 'path' => $obj->getImageFileUrl().'?rand='.time() ] ), 'active' => array( diff --git a/modules/purchaseguide/img/index.php b/modules/purchaseguide/img/index.php new file mode 100644 index 00000000..29bb7122 --- /dev/null +++ b/modules/purchaseguide/img/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 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; \ No newline at end of file diff --git a/modules/purchaseguide/purchaseguide.php b/modules/purchaseguide/purchaseguide.php index 28034ef1..c141c2a0 100644 --- a/modules/purchaseguide/purchaseguide.php +++ b/modules/purchaseguide/purchaseguide.php @@ -6,10 +6,8 @@ require_once(__DIR__.'/classes/GuideCategory.php'); class PurchaseGuide extends Module { - const MODULE_NAME = 'purchaseguide'; - public function __construct() { - $this->name = self::MODULE_NAME; + $this->name = 'purchaseguide'; $this->tab = 'front_office_features'; $this->author = 'Antadis'; $this->version = '1.0'; @@ -90,7 +88,7 @@ class PurchaseGuide extends Module Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'tab` - VALUES (DEFAULT, "'.$param['id_parent'].'", "'.$param['class_name'].'", "'.self::MODULE_NAME.'", '.($last_position+1).') + VALUES (DEFAULT, "'.$param['id_parent'].'", "'.$param['class_name'].'", "'.$this->name.'", '.($last_position+1).') '); $tab_id = Db::getInstance()->Insert_ID(); @@ -125,7 +123,7 @@ class PurchaseGuide extends Module $rows = Db::getInstance()->ExecuteS(' SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` - WHERE `module` = "'.self::MODULE_NAME.'" + WHERE `module` = "'.$this->name.'" '); foreach ($rows as $row) { Db::getInstance()->Execute(' @@ -140,7 +138,7 @@ class PurchaseGuide extends Module Db::getInstance()->Execute(' DELETE FROM `'._DB_PREFIX_.'tab` - WHERE `module` = "'.self::MODULE_NAME.'" + WHERE `module` = "'.$this->name.'" '); } @@ -230,13 +228,6 @@ class PurchaseGuide extends Module ) '); - // Add image folder - $path = GuideCategory::getImagePath(); - - if(!is_dir($path)) { - mkdir($path, 0775); - } - return true; }