[-] MO : #PSFV-640 - Fatal error in HomeSlider module

This commit is contained in:
mDeflotte committed 2012-03-08 16:17:20 +00:00
1 parent edcd2d9810
commit 55e8746463
2 files changed
+25 -1

No files matched your search

+24
View File
@@ -1694,5 +1694,29 @@ abstract class ModuleCore
return $result['position']; return $result['position'];
} }
/**
* add a warning message to display at the top of the admin page
*
* @param string $msg
*/
public function adminDisplayWarning($msg)
{
if (!($this->context->controller instanceof AdminController))
return false;
$this->context->controller->warnings[] = $msg;
}
/**
* add a info message to display at the top of the admin page
*
* @param string $msg
*/
protected function adminDisplayInformation($msg)
{
if (!($this->context->controller instanceof AdminController))
return false;
$this->context->controller->informations[] = $msg;
}
} }
+1 -1
View File
@@ -293,7 +293,7 @@ class HomeSlider extends Module
$slide = new HomeSlide((int)Tools::getValue('id_slide')); $slide = new HomeSlide((int)Tools::getValue('id_slide'));
/* Checks if directory is writable */ /* Checks if directory is writable */
if (!is_writable('.')) if (!is_writable('.'))
$this->displayWarning(sprintf($this->l('modules %s must be writable (CHMOD 755 / 777)'), $this->name)); $this->adminDisplayWarning(sprintf($this->l('modules %s must be writable (CHMOD 755 / 777)'), $this->name));
/* Gets languages and sets which div requires translations */ /* Gets languages and sets which div requires translations */
$defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT'); $defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT');