diff --git a/modules/addsharethis/addsharethis.php b/modules/addsharethis/addsharethis.php
index cd0637d70..825d3e1c9 100644
--- a/modules/addsharethis/addsharethis.php
+++ b/modules/addsharethis/addsharethis.php
@@ -1,10 +1,35 @@
+* @copyright 2007-2013 PrestaShop SA
+* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+if (!defined('_PS_VERSION_'))
exit;
-}
+
class AddShareThis extends Module
{
- function __construct()
+ public function __construct()
{
$this->name = 'addsharethis';
$this->author = 'Custom';
@@ -14,49 +39,45 @@ class AddShareThis extends Module
parent::__construct();
$this->displayName = $this->l('Add Sharethis');
$this->description = $this->l('Display social count button on the home page');
-}
+ }
-public function install()
+ public function install()
{
- Configuration::updateValue('CONF_ROW', 'ea22d519-9f98-4018-99a9-5b5f1b100fa8');
- Configuration::updateValue('ADDTHISSHARE_TWITTER',1);
- Configuration::updateValue('ADDTHISSHARE_GOOGLE',1);
- Configuration::updateValue('ADDTHISSHARE_PINTEREST',1);
- Configuration::updateValue('ADDTHISSHARE_FACEBOOK',1);
- if (!parent::install() OR
-
- !$this->registerHook('Extraright') OR
- !$this->registerHook('header'))
- return false;
- return true;
-}
+ return (
+ parent::install() &&
+ $this->registerHook('Extraright') &&
+ $this->registerHook('header') &&
+ Configuration::updateValue('CONF_ROW', 'ea22d519-9f98-4018-99a9-5b5f1b100fa8') &&
+ Configuration::updateValue('ADDTHISSHARE_TWITTER', 1) &&
+ Configuration::updateValue('ADDTHISSHARE_GOOGLE', 1) &&
+ Configuration::updateValue('ADDTHISSHARE_PINTEREST', 1) &&
+ Configuration::updateValue('ADDTHISSHARE_FACEBOOK', 1)
+ );
+ }
-public function uninstall()
- {
- if (!parent::uninstall() OR
- !Configuration::deleteByName('CONF_ROW') OR
- !Configuration::deleteByName('ADDTHISSHARE_TWITTER') OR
- !Configuration::deleteByName('ADDTHISSHARE_GOOGLE') OR
- !Configuration::deleteByName('ADDTHISSHARE_PINTEREST') OR
- !Configuration::deleteByName('ADDTHISSHARE_FACEBOOK') OR
- !$this->unregisterHook('Extraright') OR
- !$this->unregisterHook('header'))
- return false;
- else return true;
-}
-
-public function getContent()
- {
+ public function uninstall()
+ {
+ return (
+ parent::uninstall() &&
+ Configuration::deleteByName('CONF_ROW') &&
+ Configuration::deleteByName('ADDTHISSHARE_TWITTER') &&
+ Configuration::deleteByName('ADDTHISSHARE_GOOGLE') &&
+ Configuration::deleteByName('ADDTHISSHARE_PINTEREST') &&
+ Configuration::deleteByName('ADDTHISSHARE_FACEBOOK') &&
+ $this->unregisterHook('Extraright') &&
+ $this->unregisterHook('header')
+ );
+ }
+ public function getContent()
+ {
$this->_html .= '
'.$this->displayName.'
';
- if (isset($_POST['submitCog'])) $this->updateCog();
-
if (Tools::isSubmit('submitCog'))
{
- $conf_row = Tools::getValue('conf_row');
- Configuration::updateValue('CONF_ROW', $conf_row);
-
- }
+ $this->updateCog();
+ Configuration::updateValue('CONF_ROW', Tools::getValue('conf_row'));
+ }
+
$this->_html .= '