';
}
@@ -341,7 +341,7 @@ class BlockCms extends Module
$cms_blocks_right = $this->getBlocksCMS(1);
$isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$this->context->language->iso_code.'.js') ? $this->context->language->iso_code : 'en');
- $ad = dirname($_SERVER["PHP_SELF"]);
+ $ad = dirname($_SERVER['PHP_SELF']);
$this->_html .= '
';
- /* Add a link */
+ // Add a link
if (isset($_POST['submitLinkAdd']))
{
- if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url']))
+ if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) || empty($_POST['url']))
$this->_html .= $this->displayError($this->l('You must fill in all fields'));
elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url'])))
$this->_html .= $this->displayError($this->l('Bad URL'));
@@ -231,13 +230,13 @@ class BlockLink extends Module
else
$this->_html .= $this->displayError($this->l('An error occurred during link creation.'));
}
- /* Update the block title */
+ // Update the block title
elseif (isset($_POST['submitTitle']))
{
if (empty($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')]))
$this->_html .= $this->displayError($this->l('"title" field cannot be empty.'));
- elseif (!empty($_POST['title_url']) AND !Validate::isUrl(str_replace('http://', '', $_POST['title_url'])))
+ elseif (!empty($_POST['title_url']) && !Validate::isUrl(str_replace('http://', '', $_POST['title_url'])))
$this->_html .= $this->displayError($this->l('The \'title\' field is invalid'));
elseif (!Validate::isGenericName($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')]))
$this->_html .= $this->displayError($this->l('The \'title\' field is invalid'));
@@ -246,12 +245,11 @@ class BlockLink extends Module
else
$this->_html .= $this->displayConfirmation($this->l('The block title has been updated.'));
}
-
- /* Delete a link*/
+ // Delete a link
elseif (Tools::getValue('delete_link') && isset($_GET['id']))
{
- if (!is_numeric($_GET['id']) OR !$this->deleteLink())
+ if (!is_numeric($_GET['id']) || !$this->deleteLink())
$this->_html .= $this->displayError($this->l('An error occurred during link deletion.'));
else
$this->_html .= $this->displayConfirmation($this->l('The link has been deleted.'));
@@ -343,14 +341,14 @@ class BlockLink extends Module
foreach ($languages as $language)
$this->_html .= '
- *
+ *
';
$this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'title', true);
$this->_html .= '
-
+
@@ -380,10 +378,10 @@ class BlockLink extends Module
var currentUrl = \''.AdminController::$currentIndex.'&configure='.$this->name.'\';
var token=\''.Tools::getValue('token').'\';
var links = new Array();';
- foreach ($links AS $link)
+ foreach ($links as $link)
{
$this->_html .= 'links['.$link['id'].'] = new Array(\''.addslashes($link['url']).'\', '.$link['newWindow'];
- foreach ($languages AS $language)
+ foreach ($languages as $language)
if (isset($link['text_'.$language['id_lang']]))
$this->_html .= ', \''.addslashes($link['text_'.$language['id_lang']]).'\'';
else
@@ -408,7 +406,7 @@ class BlockLink extends Module
'.$this->l('There are no links.').'
';
else
- foreach ($links AS $link)
+ foreach ($links as $link)
$this->_html .= '
'.$link['id'].'
@@ -422,17 +420,15 @@ class BlockLink extends Module
$i = 0;
$nb = count($languages);
$idLng = 0;
- while($i < $nb)
+ while ($i < $nb)
{
if ($languages[$i]['id_lang'] == (int)Configuration::get('PS_LANG_DEFAULT'))
- {
$idLng = $i;
- }
$i++;
}
$this->_html .= '
- ';
+ ';
}
}
diff --git a/modules/blockmanufacturer/blockmanufacturer.php b/modules/blockmanufacturer/blockmanufacturer.php
index 278ee3744..fde787617 100644
--- a/modules/blockmanufacturer/blockmanufacturer.php
+++ b/modules/blockmanufacturer/blockmanufacturer.php
@@ -30,7 +30,7 @@ if (!defined('_PS_VERSION_'))
class BlockManufacturer extends Module
{
- function __construct()
+ public function __construct()
{
$this->name = 'blockmanufacturer';
$this->tab = 'front_office_features';
@@ -44,16 +44,16 @@ class BlockManufacturer extends Module
$this->description = $this->l('Displays a block of manufacturers/brands');
}
- function install()
- {
+ public function install()
+ {
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true);
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5);
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true);
- return (parent::install() AND $this->registerHook('leftColumn') AND $this->registerHook('header'));
+ return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header');
}
- function hookLeftColumn($params)
- {
+ public function hookLeftColumn($params)
+ {
$this->smarty->assign(array(
'manufacturers' => Manufacturer::getManufacturers(),
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
@@ -64,12 +64,12 @@ class BlockManufacturer extends Module
return $this->display(__FILE__, 'blockmanufacturer.tpl');
}
- function hookRightColumn($params)
+ public function hookRightColumn($params)
{
return $this->hookLeftColumn($params);
}
- function getContent()
+ public function getContent()
{
$output = '
'.$this->displayName.'
';
if (Tools::isSubmit('submitBlockManufacturers'))
@@ -77,9 +77,9 @@ class BlockManufacturer extends Module
$text_list = (int)(Tools::getValue('text_list'));
$text_nb = (int)(Tools::getValue('text_nb'));
$form_list = (int)(Tools::getValue('form_list'));
- if ($text_list AND !Validate::isUnsignedInt($text_nb))
+ if ($text_list && !Validate::isUnsignedInt($text_nb))
$errors[] = $this->l('Invalid number of elements');
- elseif (!$text_list AND !$form_list)
+ elseif (!$text_list && !$form_list)
$errors[] = $this->l('Please activate at least one system list');
else
{
@@ -87,7 +87,7 @@ class BlockManufacturer extends Module
Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb);
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list);
}
- if (isset($errors) AND sizeof($errors))
+ if (isset($errors) && count($errors))
$output .= $this->displayError(implode(' ', $errors));
else
$output .= $this->displayConfirmation($this->l('Settings updated'));
@@ -123,7 +123,7 @@ class BlockManufacturer extends Module
return $output;
}
- function hookHeader($params)
+ public function hookHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all');
}
diff --git a/modules/blockmyaccount/blockmyaccount.php b/modules/blockmyaccount/blockmyaccount.php
index cb9c8f59c..4f2ee64ad 100644
--- a/modules/blockmyaccount/blockmyaccount.php
+++ b/modules/blockmyaccount/blockmyaccount.php
@@ -56,7 +56,7 @@ class BlockMyAccount extends Module
public function uninstall()
{
- return (parent::uninstall() AND $this->removeMyAccountBlockHook());
+ return (parent::uninstall() && $this->removeMyAccountBlockHook());
}
public function hookDisplayLeftColumn($params)
diff --git a/modules/blockmyaccountfooter/blockmyaccountfooter.php b/modules/blockmyaccountfooter/blockmyaccountfooter.php
index ed3ada0df..f64fabbea 100644
--- a/modules/blockmyaccountfooter/blockmyaccountfooter.php
+++ b/modules/blockmyaccountfooter/blockmyaccountfooter.php
@@ -28,7 +28,7 @@
if (!defined('_PS_VERSION_'))
exit;
-class blockmyaccountfooter extends Module
+class Blockmyaccountfooter extends Module
{
public function __construct()
{
@@ -46,14 +46,14 @@ class blockmyaccountfooter extends Module
public function install()
{
- if (!$this->addMyAccountBlockHook() OR !parent::install() OR !$this->registerHook('footer') OR !$this->registerHook('header'))
+ if (!$this->addMyAccountBlockHook() || !parent::install() || !$this->registerHook('footer') || !$this->registerHook('header'))
return false;
return true;
}
public function uninstall()
{
- return (parent::uninstall() AND $this->removeMyAccountBlockHook());
+ return parent::uninstall() && $this->removeMyAccountBlockHook();
}
public function hookLeftColumn($params)
@@ -84,11 +84,13 @@ class blockmyaccountfooter extends Module
{
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'myAccountBlockfooter\'');
}
- function hookHeader($params)
+
+ public function hookHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blockmyaccount.css', 'all');
}
- function hookFooter($params)
+
+ public function hookFooter($params)
{
global $smarty;
@@ -99,8 +101,4 @@ class blockmyaccountfooter extends Module
));
return $this->display(__FILE__, $this->name.'.tpl');
}
-
}
-
-
-
diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php
index 2a402f9f5..c9fd9f5b1 100644
--- a/modules/blocknewproducts/blocknewproducts.php
+++ b/modules/blocknewproducts/blocknewproducts.php
@@ -46,7 +46,7 @@ class BlockNewProducts extends Module
public function install()
{
- if (parent::install() == false OR $this->registerHook('rightColumn') == false OR $this->registerHook('header') == false OR Configuration::updateValue('NEW_PRODUCTS_NBR', 5) == false)
+ if (parent::install() == false || $this->registerHook('rightColumn') == false || $this->registerHook('header') == false || Configuration::updateValue('NEW_PRODUCTS_NBR', 5) == false)
return false;
return true;
}
@@ -56,7 +56,7 @@ class BlockNewProducts extends Module
$output = '
'.$this->displayName.'
';
if (Tools::isSubmit('submitBlockNewProducts'))
{
- if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr))
+ if (!($productNbr = Tools::getValue('productNbr')) || empty($productNbr))
$output .= '
'.$this->l('Please fill in the "products displayed" field.').'
';
elseif ((int)($productNbr) == 0)
$output .= '
'.$this->l('Invalid number.').'
';
@@ -97,7 +97,7 @@ class BlockNewProducts extends Module
public function hookRightColumn($params)
{
$newProducts = Product::getNewProducts((int)($params['cookie']->id_lang), 0, (int)(Configuration::get('NEW_PRODUCTS_NBR')));
- if (!$newProducts AND !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
+ if (!$newProducts && !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
return;
$this->smarty->assign(array(
diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php
index 4d23d02a7..1de947918 100644
--- a/modules/blocknewsletter/blocknewsletter.php
+++ b/modules/blocknewsletter/blocknewsletter.php
@@ -62,7 +62,7 @@ class Blocknewsletter extends Module
public function install()
{
- if (parent::install() == false OR $this->registerHook('leftColumn') == false OR $this->registerHook('header') == false)
+ if (parent::install() == false || $this->registerHook('leftColumn') == false || $this->registerHook('header') == false)
return false;
Configuration::updateValue('NW_SALT', Tools::passwdGen(16));
@@ -188,7 +188,7 @@ class Blocknewsletter extends Module
*/
private function newsletterRegistration()
{
- if (empty($_POST['email']) OR !Validate::isEmail($_POST['email']))
+ if (empty($_POST['email']) || !Validate::isEmail($_POST['email']))
return $this->error = $this->l('Invalid e-mail address');
/* Unsubscription */
diff --git a/modules/blockpaymentlogo/blockpaymentlogo.php b/modules/blockpaymentlogo/blockpaymentlogo.php
index 42b856fcb..6eef4a583 100644
--- a/modules/blockpaymentlogo/blockpaymentlogo.php
+++ b/modules/blockpaymentlogo/blockpaymentlogo.php
@@ -77,7 +77,7 @@ class BlockPaymentLogo extends Module
$cmss = CMS::listCms($this->context->language->id);
- if (!sizeof($cmss))
+ if (!count($cmss))
$html .= $this->displayError($this->l('No CMS page is available'));
else
{
@@ -109,7 +109,7 @@ class BlockPaymentLogo extends Module
public function hookLeftColumn($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
- return ;
+ return;
if (!Configuration::get('PS_PAYMENT_LOGO_CMS_ID'))
@@ -133,7 +133,7 @@ class BlockPaymentLogo extends Module
public function hookHeader($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
- return ;
+ return;
$this->context->controller->addCSS(($this->_path).'blockpaymentlogo.css', 'all');
}
diff --git a/modules/blockpermanentlinks/blockpermanentlinks.php b/modules/blockpermanentlinks/blockpermanentlinks.php
index 8264ef098..b9b3e6f43 100644
--- a/modules/blockpermanentlinks/blockpermanentlinks.php
+++ b/modules/blockpermanentlinks/blockpermanentlinks.php
@@ -30,7 +30,7 @@ if (!defined('_PS_VERSION_'))
class BlockPermanentLinks extends Module
{
- function __construct()
+ public function __construct()
{
$this->name = 'blockpermanentlinks';
$this->tab = 'front_office_features';
@@ -44,9 +44,9 @@ class BlockPermanentLinks extends Module
$this->description = $this->l('Adds a block that displays permanent links such as sitemap, contact, etc.');
}
- function install()
+ public function install()
{
- return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header'));
+ return (parent::install() && $this->registerHook('top') && $this->registerHook('header'));
}
/**
@@ -55,7 +55,7 @@ class BlockPermanentLinks extends Module
* @param array $params Parameters
* @return string Content
*/
- function hookTop($params)
+ public function hookTop($params)
{
return $this->display(__FILE__, 'blockpermanentlinks-header.tpl');
}
@@ -66,22 +66,22 @@ class BlockPermanentLinks extends Module
* @param array $params Parameters
* @return string Content
*/
- function hookLeftColumn($params)
+ public function hookLeftColumn($params)
{
return $this->display(__FILE__, 'blockpermanentlinks.tpl');
}
- function hookRightColumn($params)
+ public function hookRightColumn($params)
{
return $this->hookLeftColumn($params);
}
-
- function hookFooter($params)
+
+ public function hookFooter($params)
{
return $this->display(__FILE__, 'blockpermanentlinks-footer.tpl');
}
-
- function hookHeader($params)
+
+ public function hookHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blockpermanentlinks.css', 'all');
}
diff --git a/modules/blockreinsurance/blockreinsurance.php b/modules/blockreinsurance/blockreinsurance.php
index c0177d3d0..521c66c65 100644
--- a/modules/blockreinsurance/blockreinsurance.php
+++ b/modules/blockreinsurance/blockreinsurance.php
@@ -28,12 +28,12 @@
if (!defined('_CAN_LOAD_FILES_'))
exit;
-class blockreinsurance extends Module
+class Blockreinsurance extends Module
{
public function __construct()
{
$this->name = 'blockreinsurance';
- if(version_compare(_PS_VERSION_, '1.4.0.0') >= 0)
+ if (version_compare(_PS_VERSION_, '1.4.0.0') >= 0)
$this->tab = 'front_office_features';
else
$this->tab = 'Blocks';
@@ -47,7 +47,7 @@ class blockreinsurance extends Module
public function install()
{
- return (parent::install() AND $this->installDB() AND Configuration::updateValue('blockreinsurance_nbblocks', 5) AND $this->registerHook('footer'));
+ return (parent::install() && $this->installDB() && Configuration::updateValue('blockreinsurance_nbblocks', 5) && $this->registerHook('footer'));
}
public function installDB()
@@ -63,8 +63,8 @@ class blockreinsurance extends Module
public function uninstall()
{
- //Delete configuration
- return (Configuration::deleteByName('blockreinsurance_nbblocks') AND $this->uninstallDB() AND parent::uninstall());
+ // Delete configuration
+ return (Configuration::deleteByName('blockreinsurance_nbblocks') && $this->uninstallDB() && parent::uninstall());
}
public function uninstallDB()
@@ -75,24 +75,24 @@ class blockreinsurance extends Module
public function addToDB()
{
- if(isset($_POST['nbblocks']))
+ if (isset($_POST['nbblocks']))
{
- for($i = 1; $i <= (int)$_POST['nbblocks']; $i++)
+ for ($i = 1; $i <= (int)$_POST['nbblocks']; $i++)
{
$filename = explode('.', $_FILES['info'.$i.'_file']['name']);
- if (isset($_FILES['info'.$i.'_file']) AND isset($_FILES['info'.$i.'_file']['tmp_name']) AND !empty($_FILES['info'.$i.'_file']['tmp_name']))
+ if (isset($_FILES['info'.$i.'_file']) && isset($_FILES['info'.$i.'_file']['tmp_name']) && !empty($_FILES['info'.$i.'_file']['tmp_name']))
{
if ($error = ImageManager::validateUpload($_FILES['info'.$i.'_file']))
return false;
- elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['info'.$i.'_file']['tmp_name'], $tmpName))
+ elseif (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['info'.$i.'_file']['tmp_name'], $tmpName))
return false;
elseif (!ImageManager::resize($tmpName, dirname(__FILE__).'/img/'.$filename[0].'.jpg'))
return false;
unlink($tmpName);
}
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'reinsurance` (`filename`,`text`)
- VALUES ("'.((isset($filename[0]) AND $filename[0] != '') ? pSQL($filename[0]) : '').
- '", "'.((isset($_POST['info'.$i.'_text']) AND $_POST['info'.$i.'_text'] != '') ? pSQL($_POST['info'.$i.'_text']) : '').'")');
+ VALUES ("'.((isset($filename[0]) && $filename[0] != '') ? pSQL($filename[0]) : '').
+ '", "'.((isset($_POST['info'.$i.'_text']) && $_POST['info'.$i.'_text'] != '') ? pSQL($_POST['info'.$i.'_text']) : '').'")');
}
return true;
} else
@@ -105,10 +105,8 @@ class blockreinsurance extends Module
while (false !== ($file = readdir($dir)))
{
$path = dirname(__FILE__).'/img/'.$file;
- if ($file != ".." AND $file != "." AND !is_dir($file))
- {
+ if ($file != '..' && $file != '.' && !is_dir($file))
unlink($path);
- }
}
closedir($dir);
@@ -125,8 +123,8 @@ class blockreinsurance extends Module
// If we try to update the settings
if (isset($_POST['submitModule']))
{
- Configuration::updateValue('blockreinsurance_nbblocks', ((isset($_POST['nbblocks']) AND $_POST['nbblocks'] != '') ? (int)$_POST['nbblocks'] : ''));
- if($this->removeFromDB() && $this->addToDB())
+ Configuration::updateValue('blockreinsurance_nbblocks', ((isset($_POST['nbblocks']) && $_POST['nbblocks'] != '') ? (int)$_POST['nbblocks'] : ''));
+ if ($this->removeFromDB() && $this->addToDB())
echo '
'.$this->l('Configuration updated').'
';
else
echo '
'.$this->l('An error occurred during the save').'
';
@@ -165,22 +163,20 @@ class blockreinsurance extends Module