Remove blocksupplier and blockmanufacturer

This commit is contained in:
Abhishek Kumar
2022-04-27 11:02:35 +05:30
parent d8cd1f3105
commit 24b7dc70d2
27 changed files with 0 additions and 1069 deletions

View File

@@ -1582,17 +1582,10 @@ class FrontControllerCore extends Controller
*/
public function setMobileTemplate($template)
{
// Needed for site map
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
$blocksupplier = Module::getInstanceByName('blocksupplier');
$this->context->smarty->assign(array(
'categoriesTree' => Category::getRootCategory()->recurseLiteCategTree(0),
'categoriescmsTree' => CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1),
'voucherAllowed' => (int)CartRule::isFeatureActive(),
'display_manufacturer_link' => (bool)$blockmanufacturer->active,
'display_supplier_link' => (bool)$blocksupplier->active,
'PS_DISPLAY_SUPPLIERS' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
'PS_DISPLAY_BEST_SELLERS' => Configuration::get('PS_DISPLAY_BEST_SELLERS'),
'display_store' => Configuration::get('PS_STORES_DISPLAY_SITEMAP'),
'conditions' => Configuration::get('PS_CONDITIONS'),

View File

@@ -67,14 +67,12 @@
<module action="disable" name="blockfacebook"/>
<module action="disable" name="blocklayered"/>
<module action="disable" name="blocklink"/>
<module action="disable" name="blockmanufacturer"/>
<module action="disable" name="blockmyaccountfooter"/>
<module action="disable" name="blockpaymentlogo"/>
<module action="disable" name="blockpermanentlinks"/>
<module action="disable" name="blockrss"/>
<module action="disable" name="blocksearch"/>
<module action="disable" name="blocksharefb"/>
<module action="disable" name="blocksupplier"/>
<module action="disable" name="pscleaner"/>
<module action="disable" name="trackingfront"/>
<module action="disable" name="vatnumber"/>

View File

@@ -2094,7 +2094,6 @@ class AdminThemesControllerCore extends AdminController
'blocklanguages',
'blocklayered',
'blocklink',
'blockmanufacturer',
'blockmyaccount',
'blockmyaccountfooter',
'blocknewsletter',
@@ -2104,7 +2103,6 @@ class AdminThemesControllerCore extends AdminController
'blocksearch',
'blocksharefb',
'blocksocial',
'blocksupplier',
'blockuserinfo',
'carriercompare',
'cashondelivery',

View File

@@ -46,22 +46,6 @@ class SitemapControllerCore extends FrontController
$this->context->smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0));
$this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1));
$this->context->smarty->assign('voucherAllowed', (int)CartRule::isFeatureActive());
if (Module::isInstalled('blockmanufacturer') && Module::isEnabled('blockmanufacturer')) {
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
$this->context->smarty->assign('display_manufacturer_link', isset($blockmanufacturer->active) ? (bool)$blockmanufacturer->active : false);
} else {
$this->context->smarty->assign('display_manufacturer_link', 0);
}
if (Module::isInstalled('blocksupplier') && Module::isEnabled('blocksupplier')) {
$blocksupplier = Module::getInstanceByName('blocksupplier');
$this->context->smarty->assign('display_supplier_link', isset($blocksupplier->active) ? (bool)$blocksupplier->active : false);
} else {
$this->context->smarty->assign('display_supplier_link', 0);
}
$this->context->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
$this->context->smarty->assign('PS_DISPLAY_BEST_SELLERS', Configuration::get('PS_DISPLAY_BEST_SELLERS'));
$this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));

View File

@@ -1,4 +0,0 @@
2014-04-22 18:57:21 +0200 // Changelog updated
2014-03-24 11:43:28 +0100 / MO blockmanufacturer : ps_versions_compliancy modified (1.5.6.1 => 1.6)
2014-03-24 11:02:41 +0100 / MO blockmanufacturer : ps_versions_compliancy added
2014-03-20 14:22:51 +0100 Initial commit

View File

@@ -1,235 +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 BlockManufacturer extends Module
{
public function __construct()
{
$this->name = 'blockmanufacturer';
$this->tab = 'front_office_features';
$this->version = '1.4.1';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Manufacturers block');
$this->description = $this->l('Displays a block listing product manufacturers and/or brands.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
}
public function install()
{
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true);
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5);
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', false);
$success = (parent::install() &&
$this->registerHook('header') && $this->registerHook('leftColumn') &&
$this->registerHook('actionObjectManufacturerDeleteAfter') &&
$this->registerHook('actionObjectManufacturerAddAfter') &&
$this->registerHook('actionObjectManufacturerUpdateAfter')
);
return $success;
}
public function uninstall()
{
if (!parent::uninstall() ||
!Configuration::deleteByName('MANUFACTURER_DISPLAY_TEXT') ||
!Configuration::deleteByName('MANUFACTURER_DISPLAY_TEXT_NB') ||
!Configuration::deleteByName('MANUFACTURER_DISPLAY_FORM')
)
return false;
return true;
}
public function hookLeftColumn($params)
{
if (!$this->isCached('blockmanufacturer.tpl', $this->getCacheId()))
{
$manufacturers = Manufacturer::getManufacturers();
foreach ($manufacturers as &$manufacturer)
{
$manufacturer['image'] = $this->context->language->iso_code.'-default';
if (file_exists(_PS_MANU_IMG_DIR_.$manufacturer['id_manufacturer'].'-'.ImageType::getFormatedName('medium').'.jpg'))
$manufacturer['image'] = $manufacturer['id_manufacturer'];
}
$this->smarty->assign(array(
'manufacturers' => $manufacturers,
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
));
}
return $this->display(__FILE__, 'blockmanufacturer.tpl', $this->getCacheId());
}
public function hookRightColumn($params)
{
return $this->hookLeftColumn($params);
}
public function getContent()
{
$output = '';
if (Tools::isSubmit('submitBlockManufacturers'))
{
$text_list = (int)(Tools::getValue('MANUFACTURER_DISPLAY_TEXT'));
$text_nb = (int)(Tools::getValue('MANUFACTURER_DISPLAY_TEXT_NB'));
$form_list = (int)(Tools::getValue('MANUFACTURER_DISPLAY_FORM'));
if ($text_list && !Validate::isUnsignedInt($text_nb))
$errors[] = $this->l('There is an invalid number of elements.');
elseif (!$text_list && !$form_list)
$errors[] = $this->l('Please activate at least one system list.');
else
{
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', $text_list);
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb);
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list);
$this->_clearCache('blockmanufacturer.tpl');
}
if (isset($errors) && count($errors))
$output .= $this->displayError(implode('<br />', $errors));
else
$output .= $this->displayConfirmation($this->l('Settings updated.'));
}
return $output.$this->renderForm();
}
public function hookHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all');
}
public function hookActionObjectManufacturerUpdateAfter($params)
{
$this->_clearCache('blockmanufacturer.tpl');
}
public function hookActionObjectManufacturerAddAfter($params)
{
$this->_clearCache('blockmanufacturer.tpl');
}
public function hookActionObjectManufacturerDeleteAfter($params)
{
$this->_clearCache('blockmanufacturer.tpl');
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Use a plain-text list'),
'name' => 'MANUFACTURER_DISPLAY_TEXT',
'desc' => $this->l('Display manufacturers in a plain-text list.'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'text',
'label' => $this->l('Number of elements to display'),
'name' => 'MANUFACTURER_DISPLAY_TEXT_NB',
'class' => 'fixed-width-xs'
),
array(
'type' => 'switch',
'label' => $this->l('Use a drop-down list'),
'name' => 'MANUFACTURER_DISPLAY_FORM',
'desc' => $this->l('Display manufacturers in a drop-down list.'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
)
),
'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 = 'submitBlockManufacturers';
$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(
'MANUFACTURER_DISPLAY_TEXT' => Tools::getValue('MANUFACTURER_DISPLAY_TEXT', Configuration::get('MANUFACTURER_DISPLAY_TEXT')),
'MANUFACTURER_DISPLAY_TEXT_NB' => Tools::getValue('MANUFACTURER_DISPLAY_TEXT_NB', Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB')),
'MANUFACTURER_DISPLAY_FORM' => Tools::getValue('MANUFACTURER_DISPLAY_FORM', Configuration::get('MANUFACTURER_DISPLAY_FORM')),
);
}
}

View File

@@ -1,57 +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 manufacturers module -->
<div id="manufacturers_block_left" class="block blockmanufacturer">
<h4 class="title_block">{if $display_link_manufacturer}<a href="{$link->getPageLink('manufacturer')|escape:'html'}" title="{l s='Manufacturers' mod='blockmanufacturer'}">{/if}{l s='Manufacturers' mod='blockmanufacturer'}{if $display_link_manufacturer}</a>{/if}</h4>
<div class="block_content">
{if $manufacturers}
{if $text_list}
<ul class="bullet">
{foreach from=$manufacturers item=manufacturer name=manufacturer_list}
{if $smarty.foreach.manufacturer_list.iteration <= $text_list_nb}
<li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}"><a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}" title="{l s='More about %s' sprintf=[$manufacturer.name] mod='blockmanufacturer'}">{$manufacturer.name|escape:'html':'UTF-8'}</a></li>
{/if}
{/foreach}
</ul>
{/if}
{if $form_list}
<form action="{$smarty.server.SCRIPT_NAME|escape:'html':'UTF-8'}" method="get">
<p>
<select id="manufacturer_list" onchange="autoUrl('manufacturer_list', '');">
<option value="0">{l s='All manufacturers' mod='blockmanufacturer'}</option>
{foreach from=$manufacturers item=manufacturer}
<option value="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}">{$manufacturer.name|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
</p>
</form>
{/if}
{else}
<p>{l s='No manufacturer' mod='blockmanufacturer'}</p>
{/if}
</div>
</div>
<!-- /Block manufacturers module -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

View File

@@ -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;

View File

@@ -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.1 KiB

View File

@@ -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;

View File

@@ -1,4 +0,0 @@
2014-04-22 18:57:53 +0200 // Changelog updated
2014-03-24 11:43:29 +0100 / MO blocksupplier : ps_versions_compliancy modified (1.5.6.1 => 1.6)
2014-03-24 11:04:13 +0100 / MO blocksupplier : ps_versions_compliancy added
2014-03-20 14:26:54 +0100 Initial commit

View File

@@ -1,240 +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 BlockSupplier extends Module
{
function __construct()
{
$this->name = 'blocksupplier';
$this->tab = 'front_office_features';
$this->version = '1.2.1';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Suppliers block');
$this->description = $this->l('Adds a block displaying your product suppliers.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
}
function install()
{
if (!parent::install())
return false;
if (!$this->registerHook('displayHeader') ||
!$this->registerHook('actionObjectSupplierDeleteAfter') ||
!$this->registerHook('actionObjectSupplierAddAfter') ||
!$this->registerHook('actionObjectSupplierUpdateAfter')
)
return false;
$theme = new Theme(Context::getContext()->shop->id_theme);
if ((!$theme->default_right_column || !$this->registerHook('rightColumn'))
&& (!$theme->default_left_column || !$this->registerHook('leftColumn'))
)
{
parent::uninstall();
return false;
}
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', true);
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', 5);
Configuration::updateValue('SUPPLIER_DISPLAY_FORM', false);
return true;
}
public function uninstall()
{
if (!parent::uninstall())
return false;
/* remove the configuration variable */
$result = Configuration::deleteByName('SUPPLIER_DISPLAY_TEXT');
$result &= Configuration::deleteByName('SUPPLIER_DISPLAY_TEXT_NB');
$result &= Configuration::deleteByName('SUPPLIER_DISPLAY_FORM');
return $result;
}
function hookDisplayLeftColumn($params)
{
$id_lang = (int)Context::getContext()->language->id;
if (!$this->isCached('blocksupplier.tpl', $this->getCacheId()))
$this->smarty->assign(array(
'suppliers' => Supplier::getSuppliers(false, $id_lang),
'link' => $this->context->link,
'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'),
'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'),
'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'),
'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')
));
return $this->display(__FILE__, 'blocksupplier.tpl', $this->getCacheId());
}
function getContent()
{
$output = '';
if (Tools::isSubmit('submitBlockSuppliers'))
{
$text_list = (int)(Tools::getValue('SUPPLIER_DISPLAY_TEXT'));
$text_nb = (int)(Tools::getValue('SUPPLIER_DISPLAY_TEXT_NB'));
$form_list = (int)(Tools::getValue('SUPPLIER_DISPLAY_FORM'));
if ($text_list AND !Validate::isUnsignedInt($text_nb))
$errors[] = $this->l('Invalid number of elements.');
elseif (!$text_list AND !$form_list)
$errors[] = $this->l('Please activate at least one type of list.');
else
{
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', $text_list);
Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', $text_nb);
Configuration::updateValue('SUPPLIER_DISPLAY_FORM', $form_list);
$this->_clearCache('blocksupplier.tpl');
}
if (isset($errors) AND sizeof($errors))
$output .= $this->displayError(implode('<br />', $errors));
else
$output .= $this->displayConfirmation($this->l('Settings updated.'));
}
return $output.$this->renderForm();
}
public function hookDisplayRightColumn($params)
{
return $this->hookDisplayLeftColumn($params);
}
public function hookDisplayHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blocksupplier.css', 'all');
}
public function hookActionObjectSupplierUpdateAfter($params)
{
$this->_clearCache('blocksupplier.tpl');
}
public function hookActionObjectSupplierAddAfter($params)
{
$this->_clearCache('blocksupplier.tpl');
}
public function hookActionObjectSupplierDeleteAfter($params)
{
$this->_clearCache('blocksupplier.tpl');
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Use a plain-text list'),
'name' => 'SUPPLIER_DISPLAY_TEXT',
'desc' => $this->l('Display suppliers in a plain-text list.'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'text',
'label' => $this->l('Number of elements to display'),
'name' => 'SUPPLIER_DISPLAY_TEXT_NB',
'class' => 'fixed-width-xs'
),
array(
'type' => 'switch',
'label' => $this->l('Use a drop-down list'),
'name' => 'SUPPLIER_DISPLAY_FORM',
'desc' => $this->l('Display suppliers in a drop-down list.'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
)
),
'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 = 'submitBlockSuppliers';
$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(
'SUPPLIER_DISPLAY_TEXT' => Tools::getValue('SUPPLIER_DISPLAY_TEXT', Configuration::get('SUPPLIER_DISPLAY_TEXT')),
'SUPPLIER_DISPLAY_TEXT_NB' => Tools::getValue('SUPPLIER_DISPLAY_TEXT_NB', Configuration::get('SUPPLIER_DISPLAY_TEXT_NB')),
'SUPPLIER_DISPLAY_FORM' => Tools::getValue('SUPPLIER_DISPLAY_FORM', Configuration::get('SUPPLIER_DISPLAY_FORM')),
);
}
}

View File

@@ -1,59 +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 suppliers module -->
<div id="suppliers_block_left" class="block blocksupplier">
<h4 class="title_block">{if $display_link_supplier}<a href="{$link->getPageLink('supplier')|escape:'html'}" title="{l s='Suppliers' mod='blocksupplier'}">{/if}{l s='Suppliers' mod='blocksupplier'}{if $display_link_supplier}</a>{/if}</h4>
<div class="block_content">
{if $suppliers}
{if $text_list}
<ul class="bullet">
{foreach from=$suppliers item=supplier name=supplier_list}
{if $smarty.foreach.supplier_list.iteration <= $text_list_nb}
<li class="{if $smarty.foreach.supplier_list.last}last_item{elseif $smarty.foreach.supplier_list.first}first_item{else}item{/if}">
{if $display_link_supplier}<a href="{$link->getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)|escape:'html'}" title="{l s='More about' mod='blocksupplier'} {$supplier.name}">{/if}{$supplier.name|escape:'html':'UTF-8'}{if $display_link_supplier}</a>{/if}
</li>
{/if}
{/foreach}
</ul>
{/if}
{if $form_list}
<form action="{$smarty.server.SCRIPT_NAME|escape:'html':'UTF-8'}" method="get">
<p>
<select id="supplier_list" onchange="autoUrl('supplier_list', '');">
<option value="0">{l s='All suppliers' mod='blocksupplier'}</option>
{foreach from=$suppliers item=supplier}
<option value="{$link->getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)|escape:'html'}">{$supplier.name|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
</p>
</form>
{/if}
{else}
<p>{l s='No supplier' mod='blocksupplier'}</p>
{/if}
</div>
</div>
<!-- /Block suppliers module -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

View File

@@ -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;

View File

@@ -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: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -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;

View File

@@ -1,70 +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 manufacturers module -->
<div id="manufacturers_block_left" class="block blockmanufacturer">
<p class="title_block">
{if $display_link_manufacturer}
<a href="{$link->getPageLink('manufacturer')|escape:'html':'UTF-8'}" title="{l s='Manufacturers' mod='blockmanufacturer'}">
{/if}
{l s='Manufacturers' mod='blockmanufacturer'}
{if $display_link_manufacturer}
</a>
{/if}
</p>
<div class="block_content list-block">
{if $manufacturers}
{if $text_list}
<ul>
{foreach from=$manufacturers item=manufacturer name=manufacturer_list}
{if $smarty.foreach.manufacturer_list.iteration <= $text_list_nb}
<li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}">
<a
href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html':'UTF-8'}" title="{l s='More about %s' mod='blockmanufacturer' sprintf=[$manufacturer.name]}">
{$manufacturer.name|escape:'html':'UTF-8'}
</a>
</li>
{/if}
{/foreach}
</ul>
{/if}
{if $form_list}
<form action="{$smarty.server.SCRIPT_NAME|escape:'html':'UTF-8'}" method="get">
<div class="form-group selector1">
<select class="form-control" name="manufacturer_list">
<option value="0">{l s='All manufacturers' mod='blockmanufacturer'}</option>
{foreach from=$manufacturers item=manufacturer}
<option value="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html':'UTF-8'}">{$manufacturer.name|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
</div>
</form>
{/if}
{else}
<p>{l s='No manufacturer' mod='blockmanufacturer'}</p>
{/if}
</div>
</div>
<!-- /Block manufacturers module -->

View File

@@ -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;

View File

@@ -1,75 +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 suppliers module -->
<div id="suppliers_block_left" class="block blocksupplier">
<p class="title_block">
{if $display_link_supplier}
<a href="{$link->getPageLink('supplier')|escape:'html':'UTF-8'}" title="{l s='Suppliers' mod='blocksupplier'}">
{/if}
{l s='Suppliers' mod='blocksupplier'}
{if $display_link_supplier}
</a>
{/if}
</p>
<div class="block_content list-block">
{if $suppliers}
{if $text_list}
<ul>
{foreach from=$suppliers item=supplier name=supplier_list}
{if $smarty.foreach.supplier_list.iteration <= $text_list_nb}
<li class="{if $smarty.foreach.supplier_list.last}last_item{elseif $smarty.foreach.supplier_list.first}first_item{else}item{/if}">
{if $display_link_supplier}
<a
href="{$link->getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)|escape:'html':'UTF-8'}"
title="{l s='More about' mod='blocksupplier'} {$supplier.name}">
{/if}
{$supplier.name|escape:'html':'UTF-8'}
{if $display_link_supplier}
</a>
{/if}
</li>
{/if}
{/foreach}
</ul>
{/if}
{if $form_list}
<form action="{$smarty.server.SCRIPT_NAME|escape:'html':'UTF-8'}" method="get">
<div class="form-group selector1">
<select class="form-control" name="supplier_list">
<option value="0">{l s='All suppliers' mod='blocksupplier'}</option>
{foreach from=$suppliers item=supplier}
<option value="{$link->getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)|escape:'html':'UTF-8'}">{$supplier.name|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
</div>
</form>
{/if}
{else}
<p>{l s='No supplier' mod='blocksupplier'}</p>
{/if}
</div>
</div>
<!-- /Block suppliers module -->

View File

@@ -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;

View File

@@ -58,24 +58,6 @@
</a>
</li>
{/if}
{if $display_manufacturer_link OR $PS_DISPLAY_SUPPLIERS}
<li>
<a
href="{$link->getPageLink('manufacturer')|escape:'html':'UTF-8'}"
title="{l s='View a list of manufacturers'}">
{l s='Manufacturers'}
</a>
</li>
{/if}
{if $display_supplier_link OR $PS_DISPLAY_SUPPLIERS}
<li>
<a
href="{$link->getPageLink('supplier')|escape:'html':'UTF-8'}"
title="{l s='View a list of suppliers'}">
{l s='Suppliers'}
</a>
</li>
{/if}
</ul>
</div>
</div>