Skip to content
This repository was archived by the owner on Feb 3, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions blocklink.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* 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-2014 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/

Expand Down Expand Up @@ -51,7 +51,7 @@ public function __construct()

public function install()
{
if (!parent::install() || !$this->registerHook('header'))
if (!parent::install() || !$this->registerHook('header') || !$this->registerHook('footer'))
return false;

$success = Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien'));
Expand Down Expand Up @@ -112,7 +112,7 @@ public function uninstall()
return true;
}

public function hookLeftColumn($params)
public function hookDisplayLeftColumn($params)
{
$links = $this->getLinks();

Expand All @@ -128,12 +128,28 @@ public function hookLeftColumn($params)
return $this->display(__FILE__, 'blocklink.tpl');
}

public function hookRightColumn($params)
public function hookDisplayRightColumn($params)
{
return $this->hookLeftColumn($params);
return $this->hookDisplayLeftColumn($params);
}

public function hookHeader($params)
public function hookDisplayFooter($params)
{
$links = $this->getLinks();

$this->smarty->assign(array(
'blocklink_links' => $links,
'title' => Configuration::get('PS_BLOCKLINK_TITLE', $this->context->language->id),
'url' => Configuration::get('PS_BLOCKLINK_URL'),
'lang' => 'text_'.$this->context->language->id
));
if (!$links)
return false;

return $this->display(__FILE__, 'blocklinkfooter.tpl');
}

public function hookDisplayHeader($params)
{
$this->context->controller->addCSS($this->_path.'blocklink.css', 'all');
}
Expand Down
46 changes: 46 additions & 0 deletions blocklinkfooter.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{*
* 2007-2014 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-2014 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 links module -->
<section class="footer-block col-xs-12 col-sm-2">
<h4 class="title_block">
{if $url}
<a href="{$url|escape}" title="{$title|escape}">{$title|escape}</a>
{else}
{$title|escape}
{/if}
</h4>
<div class="block_content toggle-footer">
<ul class="block_content bullet">
{foreach from=$blocklink_links item=blocklink_link}
{if isset($blocklink_link.$lang)}
<li>
<a href="{$blocklink_link.url|escape}" title="{$blocklink_link.$lang|escape}" {if $blocklink_link.newWindow} onclick="window.open(this.href);return false;"{/if}>{$blocklink_link.$lang|escape}</a></li>
{/if}
{/foreach}
</ul>
</div>
</section>
<!-- /Block links module -->