// Fix error if default blockbanner image is missing

This commit is contained in:
Jerome Nadaud
2013-11-15 17:13:50 +01:00
parent 19cfa443d2
commit 8cd1d623e5
2 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -64,7 +64,8 @@ class BlockBanner extends Module
{
if (!$this->isCached('blockbanner.tpl', $this->getCacheId()))
{
$this->smarty->assign('banner_img', Configuration::get('BLOCKBANNER_IMG'));
if (file_exists(_PS_MODULE_DIR_.'blockbanner'.DIRECTORY_SEPARATOR.Configuration::get('BLOCKBANNER_IMG')))
$this->smarty->assign('banner_img', Configuration::get('BLOCKBANNER_IMG'));
$this->smarty->assign('banner_link', Configuration::get('BLOCKBANNER_LINK'));
$this->smarty->assign('banner_desc', Configuration::get('BLOCKBANNER_DESC'));
$sql = 'SELECT COUNT(*)
+9 -5
View File
@@ -26,11 +26,15 @@
<!-- Block stores module -->
<div id="banner_block_top">
<div class="banner-top">
<div class="container">
<a href="{$banner_link}" title="{$banner_desc}">
<img src="{$module_dir}{$banner_img}" alt="{$banner_desc}"/>
</a>
</div>
<div class="container">
<a href="{$banner_link}" title="{$banner_desc}">
{if isset($banner_img)}
<img src="{$module_dir}{$banner_img}" alt=""/>
{else}
{$banner_desc}
{/if}
</a>
</div>
</div>
</div>
<!-- /Block stores module -->