Remove blockstore
This commit is contained in:
@@ -75,7 +75,6 @@
|
||||
<module action="disable" name="blocksearch"/>
|
||||
<module action="disable" name="blocksharefb"/>
|
||||
<module action="disable" name="blockspecials"/>
|
||||
<module action="disable" name="blockstore"/>
|
||||
<module action="disable" name="blocksupplier"/>
|
||||
<module action="disable" name="blocktags"/>
|
||||
<module action="disable" name="pscleaner"/>
|
||||
|
||||
@@ -2105,7 +2105,6 @@ class AdminThemesControllerCore extends AdminController
|
||||
'blocksharefb',
|
||||
'blocksocial',
|
||||
'blockspecials',
|
||||
'blockstore',
|
||||
'blocksupplier',
|
||||
'blocktags',
|
||||
'blockuserinfo',
|
||||
|
||||
@@ -47,7 +47,6 @@ UPDATE `PREFIX_configuration` SET value = '0_3|0_4' WHERE name = 'FOOTER_CMS';
|
||||
UPDATE `PREFIX_configuration` SET value = '0_3|0_4' WHERE name = 'FOOTER_BLOCK_ACTIVATION';
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'FOOTER_POWEREDBY';
|
||||
UPDATE `PREFIX_configuration` SET value = 'https://qloapps.com/' WHERE name = 'BLOCKADVERT_LINK';
|
||||
UPDATE `PREFIX_configuration` SET value = 'store.jpg' WHERE name = 'BLOCKSTORE_IMG';
|
||||
UPDATE `PREFIX_configuration` SET value = 'jpg' WHERE name = 'BLOCKADVERT_IMG_EXT';
|
||||
UPDATE `PREFIX_configuration` SET value = 'CAT3,CAT8,CAT5,LNK1' WHERE name = 'MOD_BLOCKTOPMENU_ITEMS';
|
||||
UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'MOD_BLOCKTOPMENU_SEARCH';
|
||||
|
||||
@@ -641,9 +641,6 @@
|
||||
<configuration id="BLOCKADVERT_LINK" name="BLOCKADVERT_LINK">
|
||||
<value>http://www.qloapps.com</value>
|
||||
</configuration>
|
||||
<configuration id="BLOCKSTORE_IMG" name="BLOCKSTORE_IMG">
|
||||
<value>store.jpg</value>
|
||||
</configuration>
|
||||
<configuration id="BLOCKADVERT_IMG_EXT" name="BLOCKADVERT_IMG_EXT">
|
||||
<value>jpg</value>
|
||||
</configuration>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
2014-04-22 18:57:51 +0200 // Changelog updated
|
||||
2014-04-03 11:53:18 +0200 [-] Replace Lorem Ipsum by text from configuration
|
||||
2014-03-24 12:22:58 +0100 Merge branch 'master' of https://github.com/PrestaShop/blockstore
|
||||
2014-03-24 11:43:29 +0100 / MO blockstore : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:04:08 +0100 / MO blockstore : ps_versions_compliancy added
|
||||
2014-03-24 10:19:32 +0100 [-] BO : Add Text field, cf #PSCSX-1274
|
||||
2014-03-20 14:25:32 +0100 Initial commit
|
||||
@@ -1,212 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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 BlockStore extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockstore';
|
||||
$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('Store locator block');
|
||||
$this->description = $this->l('Displays an image link to PrestaShop\'s store locator feature.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install())
|
||||
return false;
|
||||
|
||||
// Hook the module either on the left or right column
|
||||
$theme = new Theme(Context::getContext()->shop->id_theme);
|
||||
if ((!$theme->default_right_column || !$this->registerHook('rightColumn'))
|
||||
&& (!$theme->default_left_column || !$this->registerHook('leftColumn')))
|
||||
{
|
||||
// If there are no colums implemented by the template, throw an error and uninstall the module
|
||||
$this->_errors[] = $this->l('This module needs to be hooked in a column, but your theme does not implement one.');
|
||||
parent::uninstall();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/store.jpg'))
|
||||
Configuration::updateValue('BLOCKSTORE_IMG', 'store.jpg');
|
||||
|
||||
// Hook the module at the end on the header, only if it has been hooked
|
||||
return $this->registerHook('header');
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
Configuration::deleteByName('BLOCKSTORE_IMG');
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
return $this->hookRightColumn($params);
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
if (!$this->isCached('blockstore.tpl', $this->getCacheId()))
|
||||
{
|
||||
$id_lang = $this->context->cart->id_lang;
|
||||
$this->smarty->assign(array(
|
||||
'store_img' => Configuration::get('BLOCKSTORE_IMG'),
|
||||
'store_text' => Configuration::get('BLOCKSTORE_TEXT', $id_lang),
|
||||
));
|
||||
$sql = 'SELECT COUNT(*)
|
||||
FROM '._DB_PREFIX_.'store s'
|
||||
.Shop::addSqlAssociation('store', 's');
|
||||
$total = Db::getInstance()->getValue($sql);
|
||||
|
||||
if ($total <= 0)
|
||||
return;
|
||||
}
|
||||
return $this->display(__FILE__, 'blockstore.tpl', $this->getCacheId());
|
||||
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'blockstore.css', 'all');
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitStoreConf'))
|
||||
{
|
||||
if (!($languages = Language::getLanguages(true)))
|
||||
return false;
|
||||
|
||||
$text = array();
|
||||
foreach ($languages as $lang)
|
||||
$text[$lang['id_lang']] = Tools::getValue('BLOCKSTORE_TEXT_'.$lang['id_lang']);
|
||||
|
||||
Configuration::updateValue('BLOCKSTORE_TEXT', $text);
|
||||
|
||||
if (isset($_FILES['BLOCKSTORE_IMG']) && isset($_FILES['BLOCKSTORE_IMG']['tmp_name']) && !empty($_FILES['BLOCKSTORE_IMG']['tmp_name']))
|
||||
{
|
||||
if ($error = ImageManager::validateUpload($_FILES['BLOCKSTORE_IMG'], 4000000))
|
||||
return $this->displayError($this->l('Invalid image.'));
|
||||
else
|
||||
{
|
||||
$ext = substr($_FILES['BLOCKSTORE_IMG']['name'], strrpos($_FILES['BLOCKSTORE_IMG']['name'], '.') + 1);
|
||||
$file_name = md5($_FILES['BLOCKSTORE_IMG']['name']).'.'.$ext;
|
||||
if (!move_uploaded_file($_FILES['BLOCKSTORE_IMG']['tmp_name'], dirname(__FILE__).'/'.$file_name))
|
||||
return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
|
||||
else
|
||||
{
|
||||
if (Configuration::hasContext('BLOCKSTORE_IMG', null, Shop::getContext()) && Configuration::get('BLOCKSTORE_IMG') != $file_name)
|
||||
@unlink(dirname(__FILE__).'/'.Configuration::get('BLOCKSTORE_IMG'));
|
||||
Configuration::updateValue('BLOCKSTORE_IMG', $file_name);
|
||||
$this->_clearCache('blockstore.tpl');
|
||||
return $this->displayConfirmation($this->l('The settings have been updated.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_clearCache('blockstore.tpl');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
return $this->postProcess().$this->renderForm();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Image for the Store Locator block'),
|
||||
'name' => 'BLOCKSTORE_IMG',
|
||||
'thumb' => '../modules/'.$this->name.'/'.Configuration::get('BLOCKSTORE_IMG'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Text for the Store Locator block'),
|
||||
'name' => 'BLOCKSTORE_TEXT',
|
||||
'lang' => true,
|
||||
),
|
||||
),
|
||||
'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 = 'submitStoreConf';
|
||||
$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()
|
||||
{
|
||||
if (!($languages = Language::getLanguages(true)))
|
||||
return false;
|
||||
|
||||
$data = array(
|
||||
'BLOCKSTORE_IMG' => Tools::getValue('BLOCKSTORE_IMG', Configuration::get('BLOCKSTORE_IMG')),
|
||||
);
|
||||
|
||||
foreach ($languages as $lang)
|
||||
$data['BLOCKSTORE_TEXT'][$lang['id_lang']] = Configuration::get('BLOCKSTORE_TEXT', $lang['id_lang']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
<!-- Block stores module -->
|
||||
<div id="stores_block_left" class="block">
|
||||
<h4 class="title_block">
|
||||
<a href="{$link->getPageLink('stores')|escape:'html'}" title="{l s='Our store(s)!' mod='blockstore'}">
|
||||
{l s='Our store(s)!' mod='blockstore'}
|
||||
</a>
|
||||
</h4>
|
||||
<div class="block_content blockstore">
|
||||
<p class="store_image">
|
||||
<a href="{$link->getPageLink('stores')|escape:'html'}" title="{l s='Our store(s)!' mod='blockstore'}">
|
||||
<img src="{$link->getMediaLink("`$module_dir``$store_img|escape:'htmlall':'UTF-8'`")}" alt="{l s='Our store(s)!' mod='blockstore'}" width="174" height="115" />
|
||||
</a>
|
||||
</p>
|
||||
{if !empty($store_text)}
|
||||
<p class="store-description">
|
||||
{$store_text}
|
||||
</p>
|
||||
{/if}
|
||||
<p>
|
||||
<a href="{$link->getPageLink('stores')|escape:'html'}" title="{l s='Our store(s)!' mod='blockstore'}">
|
||||
» {l s='Discover our store(s)!' mod='blockstore'}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block stores module -->
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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;
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 280 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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;
|
||||
@@ -1,54 +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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
<!-- Block stores module -->
|
||||
<div id="stores_block_left" class="block">
|
||||
<p class="title_block">
|
||||
<a href="{$link->getPageLink('stores')|escape:'html':'UTF-8'}" title="{l s='Our stores' mod='blockstore'}">
|
||||
{l s='Our stores' mod='blockstore'}
|
||||
</a>
|
||||
</p>
|
||||
<div class="block_content blockstore">
|
||||
<p class="store_image">
|
||||
<a href="{$link->getPageLink('stores')|escape:'html':'UTF-8'}" title="{l s='Our stores' mod='blockstore'}">
|
||||
<img class="img-responsive" src="{$link->getMediaLink("`$module_dir``$store_img|escape:'htmlall':'UTF-8'`")}" alt="{l s='Our stores' mod='blockstore'}" />
|
||||
</a>
|
||||
</p>
|
||||
{if !empty($store_text)}
|
||||
<p class="store-description">
|
||||
{$store_text}
|
||||
</p>
|
||||
{/if}
|
||||
<div>
|
||||
<a
|
||||
class="btn btn-default button button-small"
|
||||
href="{$link->getPageLink('stores')|escape:'html':'UTF-8'}"
|
||||
title="{l s='Our stores' mod='blockstore'}">
|
||||
<span>{l s='Discover our stores' mod='blockstore'}<i class="icon-chevron-right right"></i></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block stores module -->
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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;
|
||||
Reference in New Issue
Block a user