// Merge -> 10309

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10333 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-11-21 11:05:10 +00:00
parent 2537c72189
commit 9d10de0848
365 changed files with 11185 additions and 1571 deletions
+21 -2
View File
@@ -33,17 +33,31 @@ class Ekomi extends Module
private $_html = '';
private $_postErrors = array();
public $id_lang;
public $iso_lang;
function __construct()
{
$this->name = 'ekomi';
$this->tab = 'advertising_marketing';
$this->version = 1.1;
$this->author = 'PrestaShop';
$this->version = 1.2;
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('eKomi');
$this->description = $this->l('Adds an eKomi block');
if (self::isInstalled($this->name))
{
$this->id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
$this->iso_lang = pSQL(Language::getIsoById($this->id_lang));
/* Check Mail Directory */
if (!file_exists(dirname(__FILE__.'/'.$this->iso_lang.'/')))
$this->warning .= $this->l('directory').' "'.$this->iso_lang.'" does not exist ';
}
}
public function install()
@@ -115,6 +129,10 @@ class Ekomi extends Module
if (!Configuration::get('PS_EKOMI_EMAIL'))
return true;
/* Check Mail Directory */
if (!file_exists(dirname(__FILE__.'/'.$this->iso_lang.'/')))
return true;
/* Email generation */
$subject = '[Ekomi-Prestashop] '.Configuration::get('PS_SHOP_NAME');
$templateVars = array(
@@ -125,8 +143,9 @@ class Ekomi extends Module
);
/* Email sending */
if (!Mail::Send(1, 'ekomi', $subject, $templateVars, Configuration::get('PS_EKOMI_EMAIL'), NULL, $params['customer']->email, Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/'))
if (!Mail::Send((int)$this->id_lang, 'ekomi', $subject, $templateVars, Configuration::get('PS_EKOMI_EMAIL'), NULL, $params['customer']->email, Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/'))
return true;
return true;
}
}