From 69a7bc1b26888d6649dfd967272b1f623abeb456 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 26 Apr 2022 19:28:36 +0530 Subject: [PATCH] Remove 'blockviewed', --- config/xml/themes/default.xml | 1 - controllers/admin/AdminThemesController.php | 1 - modules/blockviewed/CHANGELOG.txt | 4 - modules/blockviewed/blockviewed.css | 35 --- modules/blockviewed/blockviewed.php | 218 ------------------ modules/blockviewed/blockviewed.tpl | 44 ---- modules/blockviewed/index.php | 35 --- modules/blockviewed/logo.gif | Bin 954 -> 0 bytes modules/blockviewed/logo.png | Bin 1392 -> 0 bytes modules/blockviewed/translations/index.php | 35 --- .../css/modules/blockviewed/blockviewed.css | 7 - .../css/modules/blockviewed/index.php | 35 --- .../modules/blockviewed/blockviewed.tpl | 55 ----- .../modules/blockviewed/index.php | 35 --- 14 files changed, 505 deletions(-) delete mode 100644 modules/blockviewed/CHANGELOG.txt delete mode 100644 modules/blockviewed/blockviewed.css delete mode 100644 modules/blockviewed/blockviewed.php delete mode 100644 modules/blockviewed/blockviewed.tpl delete mode 100644 modules/blockviewed/index.php delete mode 100644 modules/blockviewed/logo.gif delete mode 100644 modules/blockviewed/logo.png delete mode 100644 modules/blockviewed/translations/index.php delete mode 100644 themes/hotel-reservation-theme/css/modules/blockviewed/blockviewed.css delete mode 100644 themes/hotel-reservation-theme/css/modules/blockviewed/index.php delete mode 100644 themes/hotel-reservation-theme/modules/blockviewed/blockviewed.tpl delete mode 100644 themes/hotel-reservation-theme/modules/blockviewed/index.php diff --git a/config/xml/themes/default.xml b/config/xml/themes/default.xml index faa92c618..3c8e790d3 100644 --- a/config/xml/themes/default.xml +++ b/config/xml/themes/default.xml @@ -86,7 +86,6 @@ - diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 801736677..bdf895499 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -2117,7 +2117,6 @@ class AdminThemesControllerCore extends AdminController 'blocksupplier', 'blocktags', 'blockuserinfo', - 'blockviewed', 'carriercompare', 'cashondelivery', 'cheque', diff --git a/modules/blockviewed/CHANGELOG.txt b/modules/blockviewed/CHANGELOG.txt deleted file mode 100644 index 36f4c0c31..000000000 --- a/modules/blockviewed/CHANGELOG.txt +++ /dev/null @@ -1,4 +0,0 @@ -2014-04-22 18:58:01 +0200 // Changelog updated -2014-03-24 11:43:29 +0100 / MO blockviewed : ps_versions_compliancy modified (1.5.6.1 => 1.6) -2014-03-24 11:04:58 +0100 / MO blockviewed : ps_versions_compliancy added -2014-03-20 14:29:39 +0100 Initial commit diff --git a/modules/blockviewed/blockviewed.css b/modules/blockviewed/blockviewed.css deleted file mode 100644 index dad9cf128..000000000 --- a/modules/blockviewed/blockviewed.css +++ /dev/null @@ -1,35 +0,0 @@ -/* Block Viewed Products */ -#viewed-products_block_left .products li { - padding:10px 0; - border-bottom:1px dotted #ccc; -} -#viewed-products_block_left .products li.last_item { - padding-bottom:0; - border:none; -} - -#viewed-products_block_left .content_img { - float:left; -} -#viewed-products_block_left .text_desc { - float:left; - margin-left: 10px; - width: 130px; -} -#viewed-products_block_left li .text_desc .s_title_block, #viewed-products_block_left li .text_desc h5 { - padding:0 0 5px 0; - font-size:12px; - color:#333; - font-weight: bold; -} - -#viewed-products_block_left li .text_desc .s_title_block a, #viewed-products_block_left li .text_desc h5 a { - color:#333; -} -#viewed-products_block_left li .text_desc p, -#viewed-products_block_left li .text_desc p a { - padding-bottom:0; - line-height:14px; - color:#666 -} - diff --git a/modules/blockviewed/blockviewed.php b/modules/blockviewed/blockviewed.php deleted file mode 100644 index d233436c7..000000000 --- a/modules/blockviewed/blockviewed.php +++ /dev/null @@ -1,218 +0,0 @@ - -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -if (!defined('_PS_VERSION_')) - exit; - -class BlockViewed extends Module -{ - - public function __construct() - { - $this->name = 'blockviewed'; - $this->tab = 'front_office_features'; - $this->version = '1.3.1'; - $this->author = 'PrestaShop'; - $this->need_instance = 0; - - $this->bootstrap = true; - parent::__construct(); - - $this->displayName = $this->l('Viewed products block'); - $this->description = $this->l('Adds a block displaying recently viewed products.'); - $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99'); - } - - public function install() - { - return (parent::install() && $this->registerHook('header') && $this->registerHook('leftColumn') && Configuration::updateValue('PRODUCTS_VIEWED_NBR', 2)); - - } - - public function getContent() - { - $output = ''; - if (Tools::isSubmit('submitBlockViewed')) - { - if (!($productNbr = Tools::getValue('PRODUCTS_VIEWED_NBR')) || empty($productNbr)) - $output .= $this->displayError($this->l('You must fill in the \'Products displayed\' field.')); - elseif ((int)($productNbr) == 0) - $output .= $this->displayError($this->l('Invalid number.')); - else - { - Configuration::updateValue('PRODUCTS_VIEWED_NBR', (int)$productNbr); - $output .= $this->displayConfirmation($this->l('Settings updated.')); - } - } - return $output.$this->renderForm(); - } - - public function hookRightColumn($params) - { - $productsViewed = (isset($params['cookie']->viewed) && !empty($params['cookie']->viewed)) ? array_slice(array_reverse(explode(',', $params['cookie']->viewed)), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); - - if (count($productsViewed)) - { - $defaultCover = Language::getIsoById($params['cookie']->id_lang).'-default'; - - $productIds = implode(',', array_map('intval', $productsViewed)); - $productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT MAX(image_shop.id_image) id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite - FROM '._DB_PREFIX_.'product p - '.Shop::addSqlAssociation('product', 'p').' - LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').') - LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'. - Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' - LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = image_shop.id_image AND il.id_lang = '.(int)($params['cookie']->id_lang).') - LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').') - WHERE p.id_product IN ('.$productIds.') - AND pl.id_lang = '.(int)($params['cookie']->id_lang).' - AND cl.id_lang = '.(int)($params['cookie']->id_lang).' - GROUP BY product_shop.id_product' - ); - - $productsImagesArray = array(); - foreach ($productsImages as $pi) - $productsImagesArray[$pi['id_product']] = $pi; - - $productsViewedObj = array(); - foreach ($productsViewed as $productViewed) - { - $obj = (object)'Product'; - if (!isset($productsImagesArray[$productViewed]) || (!$obj->active = $productsImagesArray[$productViewed]['active'])) - continue; - else - { - $obj->id = (int)($productsImagesArray[$productViewed]['id_product']); - $obj->id_image = (int)$productsImagesArray[$productViewed]['id_image']; - $obj->cover = (int)($productsImagesArray[$productViewed]['id_product']).'-'.(int)($productsImagesArray[$productViewed]['id_image']); - $obj->legend = $productsImagesArray[$productViewed]['legend']; - $obj->name = $productsImagesArray[$productViewed]['name']; - $obj->description_short = $productsImagesArray[$productViewed]['description_short']; - $obj->link_rewrite = $productsImagesArray[$productViewed]['link_rewrite']; - $obj->category_rewrite = $productsImagesArray[$productViewed]['category_rewrite']; - // $obj is not a real product so it cannot be used as argument for getProductLink() - $obj->product_link = $this->context->link->getProductLink($obj->id, $obj->link_rewrite, $obj->category_rewrite); - - if (!isset($obj->cover) || !$productsImagesArray[$productViewed]['id_image']) - { - $obj->cover = $defaultCover; - $obj->legend = ''; - } - $productsViewedObj[] = $obj; - } - } - - if (!count($productsViewedObj)) - return; - - $this->smarty->assign(array( - 'productsViewedObj' => $productsViewedObj, - 'mediumSize' => Image::getSize('medium'))); - - return $this->display(__FILE__, 'blockviewed.tpl'); - } - return; - } - - public function hookLeftColumn($params) - { - return $this->hookRightColumn($params); - } - - public function hookFooter($params) - { - return $this->hookRightColumn($params); - } - - public function hookHeader($params) - { - $id_product = (int)Tools::getValue('id_product'); - $productsViewed = (isset($params['cookie']->viewed) && !empty($params['cookie']->viewed)) ? array_slice(array_reverse(explode(',', $params['cookie']->viewed)), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); - - if ($id_product && !in_array($id_product, $productsViewed)) - { - $product = new Product((int)$id_product); - if ($product->checkAccess((int)$this->context->customer->id)) - { - if (isset($params['cookie']->viewed) && !empty($params['cookie']->viewed)) - $params['cookie']->viewed .= ','.(int)$id_product; - else - $params['cookie']->viewed = (int)$id_product; - } - } - $this->context->controller->addCSS(($this->_path).'blockviewed.css', 'all'); - } - - public function renderForm() - { - $fields_form = array( - 'form' => array( - 'legend' => array( - 'title' => $this->l('Settings'), - 'icon' => 'icon-cogs' - ), - 'input' => array( - array( - 'type' => 'text', - 'label' => $this->l('Products to display'), - 'name' => 'PRODUCTS_VIEWED_NBR', - 'class' => 'fixed-width-xs', - 'desc' => $this->l('Define the number of products displayed in this block.') - ), - ), - 'submit' => array( - 'title' => $this->l('Save'), - ) - ), - ); - - $helper = new HelperForm(); - $helper->show_toolbar = false; - $helper->table = $this->table; - $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); - $helper->default_form_language = $lang->id; - $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; - $helper->identifier = $this->identifier; - $helper->submit_action = 'submitBlockViewed'; - $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; - $helper->token = Tools::getAdminTokenLite('AdminModules'); - $helper->tpl_vars = array( - 'fields_value' => $this->getConfigFieldsValues(), - 'languages' => $this->context->controller->getLanguages(), - 'id_language' => $this->context->language->id - ); - - return $helper->generateForm(array($fields_form)); - } - - public function getConfigFieldsValues() - { - return array( - 'PRODUCTS_VIEWED_NBR' => Tools::getValue('PRODUCTS_VIEWED_NBR', Configuration::get('PRODUCTS_VIEWED_NBR')), - ); - } -} diff --git a/modules/blockviewed/blockviewed.tpl b/modules/blockviewed/blockviewed.tpl deleted file mode 100644 index fc261fe49..000000000 --- a/modules/blockviewed/blockviewed.tpl +++ /dev/null @@ -1,44 +0,0 @@ -{* -* 2007-2016 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - -
-

{l s='Viewed products' mod='blockviewed'}

-
- -
-
diff --git a/modules/blockviewed/index.php b/modules/blockviewed/index.php deleted file mode 100644 index e5064df41..000000000 --- a/modules/blockviewed/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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/blockviewed/logo.gif b/modules/blockviewed/logo.gif deleted file mode 100644 index d1258171ccfb0488625783c74c7556d8e38cf330..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 954 zcmZ?wbhEHb6krfwXlG#fr|@w{yZ_Ek|2=&X$EPKonVUUr(bj#dCePe@bMBr8tB>AV zeBjCQgAbM+e!A-Dv#nYZy>$&gSFTCD!8q`RUv5j^6uv^6sZo55Apy{NviwueYCnz5nLNvuDrVzkmPk^N;V}zyJULpJ5b? zhQL6FfZ|UUW{?|nKm;gHFmOy~U}QMqupz;bmq|FyqH)neXAyM+g%FO9Ek}h^Jr*b^ zPF!@fUqZV~CgS7cP9c6{jx!%NC>`t32$_^qX}H8^ny$Hq$At$6J7?=EdI%UEYG&bZ zkhkLaxX`&>fM=4GkHMjrECSq1%yI;hn!*J*wk*2wfU)H!2b;#4oXn diff --git a/modules/blockviewed/logo.png b/modules/blockviewed/logo.png deleted file mode 100644 index 36af5ccab3b6f2d27f2a7ceda2f06fc7da9ae7c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1392 zcmV-$1&{iPP)pEX5Wmt=-;sySv@{cJH_8UjCjl-Ik`^h1m$6GbU>xipgkw4#b3G~N|maEedXn1X@KY1!GAS}!vVQMp&@@y=L+y5 zXU?WKOv5m3lq??4c3LhMe{D7!S``YFWQa7t>h?6iw9y2k$qbWu=8@uYJf4k$V%Fmo zkF8cKlxnq={I1FwfSsCWERx0J*{Jjgha+$}U5gNBRVvFPA(jJhW-}J6Wbya~fJ7pW zKp?mX!P7yNcsRsz01J^@=|-uVv04_VfQ=!z5)0G8jY$pe%nGpxpjOY9j-1-;cFD5X ztm1wBw{MFO^0fH4CEb|3!YIZIk^pRW2kZ`~Wbyc5AoS4X$<^f;k^tB#&tWbSLDE_Z z#u5R@w`2e(Idr+)lH_K&XETbgJJZdW6M*X>PM69{4~Wkl007pB|-hU`)F=tEErd$I4T9hKL)0TW^+6jUwA0Ng;C6r|=7ggKmSYQnw2 z0VoIEIMwfh#UIBVYXsK}L1@SQXeNNlJ~zJm(?RFL7`}TKwYA5j190PHQaBPpBALX_ zoqLdo1;w&+<{Z4s5W=~M0OYy=PTcpQa=?pA@c?9FLHw)>qK@>_NB{>1{6JhlF|7>A01?VGlVY)$c>SBg z9Y_gbY;2oGFJ<0AW#`N}`0>dwWTq%inxkl#3ghrd2&rfo`-+OC14N?&DYim9|7=^g z7Q*LtV2j3#_F*4dXwJFpoVm;xh1``un>z{FjDY&dD10s__U_FAAQqb=2`jV!@M~iu zy03MiebA2LE{E7~RW#>ZcFvrGD?BMQTI1-k1kl^vjUVZGAsIl3$05wktrVT-9+=V_ zD5D~AD^}5M$KDz0fyl}csRQZv%Fyy2Hd6cl`gO`A5)t6(#JJK2P-+qR>wK?d1rHAZ`W zr=5-p(CxtWqwjFQ=T-plSJC6PuM5A$wZ?6L@>QVs3xc=^jPFL@u?-KVV*x;;)dqO) zCVpU!bI|;y0K8#*gS3J4 z?qk*mijwze+x!acPS;>ax$)|a+V>xt yPttg -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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/themes/hotel-reservation-theme/css/modules/blockviewed/blockviewed.css b/themes/hotel-reservation-theme/css/modules/blockviewed/blockviewed.css deleted file mode 100644 index a069ec35f..000000000 --- a/themes/hotel-reservation-theme/css/modules/blockviewed/blockviewed.css +++ /dev/null @@ -1,7 +0,0 @@ -/* Block Viewed Products */ -#viewed-products_block_left li.last_item { - padding-bottom: 0; - margin-bottom: 0; - border-bottom: none; } - -/*# sourceMappingURL=blockviewed.css.map */ diff --git a/themes/hotel-reservation-theme/css/modules/blockviewed/index.php b/themes/hotel-reservation-theme/css/modules/blockviewed/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/css/modules/blockviewed/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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; diff --git a/themes/hotel-reservation-theme/modules/blockviewed/blockviewed.tpl b/themes/hotel-reservation-theme/modules/blockviewed/blockviewed.tpl deleted file mode 100644 index ca70ae14b..000000000 --- a/themes/hotel-reservation-theme/modules/blockviewed/blockviewed.tpl +++ /dev/null @@ -1,55 +0,0 @@ -{* -* 2007-2017 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2017 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - -
-

{l s='Viewed products' mod='blockviewed'}

-
- -
-
diff --git a/themes/hotel-reservation-theme/modules/blockviewed/index.php b/themes/hotel-reservation-theme/modules/blockviewed/index.php deleted file mode 100644 index 9a99a8662..000000000 --- a/themes/hotel-reservation-theme/modules/blockviewed/index.php +++ /dev/null @@ -1,35 +0,0 @@ - -* @copyright 2007-2017 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;