// Rename correctly all hooks
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12006 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1330,8 +1330,8 @@ class AdminControllerCore extends Controller
|
||||
'pic_dir' => _THEME_PROD_PIC_DIR_
|
||||
));
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_HEADER' => Hook::exec('backOfficeHeader'),
|
||||
'HOOK_TOP' => Hook::exec('backOfficeTop'),
|
||||
'HOOK_HEADER' => Hook::exec('displayBackOfficeHeader'),
|
||||
'HOOK_TOP' => Hook::exec('displayBackOfficeTop'),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1421,7 +1421,7 @@ class AdminControllerCore extends Controller
|
||||
));
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_FOOTER' => Hook::exec('backOfficeFooter'),
|
||||
'HOOK_FOOTER' => Hook::exec('displayBackOfficeFooter'),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class AttributeCore extends ObjectModel
|
||||
|
||||
$return = parent::delete();
|
||||
if ($return)
|
||||
Hook::exec('afterDeleteAttribute', array('id_attribute' => $this->id));
|
||||
Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id));
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class AttributeCore extends ObjectModel
|
||||
$return = parent::update($null_values);
|
||||
|
||||
if ($return)
|
||||
Hook::exec('afterSaveAttribute', array('id_attribute' => $this->id));
|
||||
Hook::exec('actionAttributeSave', array('id_attribute' => $this->id));
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class AttributeCore extends ObjectModel
|
||||
$return = parent::add($autodate, $null_values);
|
||||
|
||||
if ($return)
|
||||
Hook::exec('afterSaveAttribute', array('id_attribute' => $this->id));
|
||||
Hook::exec('actionAttributeSave', array('id_attribute' => $this->id));
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -75,14 +75,14 @@ class AttributeGroupCore extends ObjectModel
|
||||
$this->position = AttributeGroup::getHigherPosition() + 1;
|
||||
|
||||
$return = parent::add($autodate, true);
|
||||
Hook::exec('afterSaveAttributeGroup', array('id_attribute_group' => $this->id));
|
||||
Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function update($nullValues = false)
|
||||
{
|
||||
$return = parent::update($nullValues);
|
||||
Hook::exec('afterSaveAttributeGroup', array('id_attribute_group' => $this->id));
|
||||
Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class AttributeGroupCore extends ObjectModel
|
||||
return false;
|
||||
$return = parent::delete();
|
||||
if ($return)
|
||||
Hook::exec('afterDeleteAttributeGroup', array('id_attribute_group' => $this->id));
|
||||
Hook::exec('actionAttributeGroupDelete', array('id_attribute_group' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -170,7 +170,7 @@ class CartCore extends ObjectModel
|
||||
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
|
||||
$return = parent::add($autodate);
|
||||
Hook::exec('cart');
|
||||
Hook::exec('actionCartSave');
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
$this->_products = null;
|
||||
$return = parent::update();
|
||||
Hook::exec('cart');
|
||||
Hook::exec('actionCartSave');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class CategoryCore extends ObjectModel
|
||||
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
|
||||
self::regenerateEntireNtree();
|
||||
$this->updateGroup($this->groupBox);
|
||||
Hook::exec('categoryAddition', array('category' => $this));
|
||||
Hook::exec('actionCategoryAdd', array('category' => $this));
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ class CategoryCore extends ObjectModel
|
||||
self::regenerateEntireNtree();
|
||||
$this->recalculateLevelDepth($this->id_category);
|
||||
}
|
||||
Hook::exec('categoryUpdate', array('category' => $this));
|
||||
Hook::exec('actionCategoryUpdate', array('category' => $this));
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ class CategoryCore extends ObjectModel
|
||||
public function toggleStatus()
|
||||
{
|
||||
$result = parent::toggleStatus();
|
||||
Hook::exec('categoryUpdate');
|
||||
Hook::exec('actionCategoryUpdate');
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ class CategoryCore extends ObjectModel
|
||||
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
|
||||
self::regenerateEntireNtree();
|
||||
|
||||
Hook::exec('categoryDeletion', array('category' => $this));
|
||||
Hook::exec('actionCategoryDelete', array('category' => $this));
|
||||
|
||||
/* Delete Categories in GroupReduction */
|
||||
foreach ($to_delete as $category)
|
||||
@@ -1029,7 +1029,7 @@ class CategoryCore extends ObjectModel
|
||||
SET `position` = '.(int)$position.'
|
||||
WHERE `id_parent` = '.(int)$moved_category['id_parent'].'
|
||||
AND `id_category`='.(int)$moved_category['id_category']));
|
||||
Hook::exec('categoryUpdate');
|
||||
Hook::exec('actionCategoryUpdate');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -114,7 +114,7 @@ class FeatureCore extends ObjectModel
|
||||
$this->position = Feature::getHigherPosition() + 1;
|
||||
|
||||
$return = parent::add($autodate, true);
|
||||
Hook::exec('afterSaveFeature', array('id_feature' => $this->id));
|
||||
Hook::exec('actionFeatureSave', array('id_feature' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class FeatureCore extends ObjectModel
|
||||
|
||||
$return = parent::delete();
|
||||
if ($return)
|
||||
Hook::exec('afterDeleteFeature', array('id_feature' => $this->id));
|
||||
Hook::exec('actionFeatureDelete', array('id_feature' => $this->id));
|
||||
|
||||
/* Reinitializing position */
|
||||
$this->cleanPositions();
|
||||
@@ -169,7 +169,7 @@ class FeatureCore extends ObjectModel
|
||||
'`'.$this->def['primary'].'` = '.(int)$this->id.' AND `id_lang` = '.(int)$field['id_lang']
|
||||
);
|
||||
}
|
||||
Hook::exec('afterSaveFeature', array('id_feature' => $this->id));
|
||||
Hook::exec('actionFeatureSave', array('id_feature' => $this->id));
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ class FeatureValueCore extends ObjectModel
|
||||
{
|
||||
$return = parent::add($autodate, $nullValues);
|
||||
if ($return)
|
||||
Hook::exec('afterSaveFeatureValue', array('id_feature_value' => $this->id));
|
||||
Hook::exec('actionFeatureValueSave', array('id_feature_value' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ class FeatureValueCore extends ObjectModel
|
||||
$return = parent::delete();
|
||||
|
||||
if ($return)
|
||||
Hook::exec('afterDeleteFeatureValue', array('id_feature_value' => $this->id));
|
||||
Hook::exec('actionFeatureValueDelete', array('id_feature_value' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ class FeatureValueCore extends ObjectModel
|
||||
{
|
||||
$return = parent::update($nullValues);
|
||||
if ($return)
|
||||
Hook::exec('afterSaveFeatureValue', array('id_feature_value' => $this->id));
|
||||
Hook::exec('actionFeatureValueSave', array('id_feature_value' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ class qqUploadedFileForm {
|
||||
}
|
||||
}
|
||||
unlink($tmpName);
|
||||
Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_product));
|
||||
Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_product));
|
||||
$lang = Context::getContext()->employee->id_lang;
|
||||
|
||||
if (!$image->update())
|
||||
@@ -229,8 +229,7 @@ class qqUploadedFileXhr
|
||||
}
|
||||
}
|
||||
unlink($tmpName);
|
||||
Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_product));
|
||||
$lang = Context::getContext()->employee->id_lang;
|
||||
Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_product));
|
||||
|
||||
if (!$image->update())
|
||||
return array('error' => Tools::displayError('Error while updating status'));
|
||||
|
||||
@@ -433,7 +433,7 @@ class FrontControllerCore extends Controller
|
||||
Tools::displayAsDeprecated();
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_RIGHT_COLUMN' => Hook::exec('displayRightColumn', array('cart' => $this->context->cart)),
|
||||
'HOOK_FOOTER' => Hook::exec('footer'),
|
||||
'HOOK_FOOTER' => Hook::exec('displayFooter'),
|
||||
));
|
||||
$this->context->smarty->display(_PS_THEME_DIR_.'footer.tpl');
|
||||
}
|
||||
@@ -652,7 +652,7 @@ class FrontControllerCore extends Controller
|
||||
public function initFooter()
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_FOOTER' => Hook::exec('footer'),
|
||||
'HOOK_FOOTER' => Hook::exec('displayFooter'),
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1135,7 +1135,7 @@ abstract class ModuleCore
|
||||
public static function hookExecPayment()
|
||||
{
|
||||
Tools::displayAsDeprecated();
|
||||
return Hook::exec('payment');
|
||||
return Hook::exec('displayPayment');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -353,7 +353,14 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
|
||||
// Hook validate order
|
||||
Hook::exec('newOrder', array('cart' => $cart, 'order' => $order, 'customer' => $customer, 'currency' => $currency, 'orderStatus' => $order_status));
|
||||
Hook::exec('actionValidateOrder', array(
|
||||
'cart' => $cart,
|
||||
'order' => $order,
|
||||
'customer' => $customer,
|
||||
'currency' => $currency,
|
||||
'orderStatus' => $order_status
|
||||
));
|
||||
|
||||
foreach ($cart->getProducts() AS $product)
|
||||
if ($order_status->logable)
|
||||
ProductSale::addProductSale((int)$product['id_product'], (int)$product['cart_quantity']);
|
||||
|
||||
+5
-5
@@ -418,14 +418,14 @@ class ProductCore extends ObjectModel
|
||||
{
|
||||
if (!parent::add($autodate, $null_values))
|
||||
return false;
|
||||
Hook::exec('afterSaveProduct', array('id_product' => $this->id));
|
||||
Hook::exec('actionProductSave', array('id_product' => $this->id));
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update($null_values = false)
|
||||
{
|
||||
$return = parent::update($null_values);
|
||||
Hook::exec('afterSaveProduct', array('id_product' => $this->id));
|
||||
Hook::exec('actionProductSave', array('id_product' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ class ProductCore extends ObjectModel
|
||||
if (!GroupReduction::deleteProductReduction($this->id))
|
||||
return false;
|
||||
|
||||
Hook::exec('deleteProduct', array('product' => $this));
|
||||
Hook::exec('actionProductDelete', array('product' => $this));
|
||||
if (!parent::delete() ||
|
||||
!$this->deleteCategories(true) ||
|
||||
!$this->deleteImages() ||
|
||||
@@ -1282,7 +1282,7 @@ class ProductCore extends ObjectModel
|
||||
return false;
|
||||
|
||||
//if ($quantity)
|
||||
Hook::exec('updateProductAttribute', array('id_product_attribute' => $id_product_attribute));
|
||||
Hook::exec('actionProductAttributeUpdate', array('id_product_attribute' => $id_product_attribute));
|
||||
|
||||
Product::updateDefaultAttribute($this->id);
|
||||
|
||||
@@ -1322,7 +1322,7 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public function deleteProductAttributes()
|
||||
{
|
||||
Hook::exec('deleteProductAttribute', array('id_product_attribute' => 0, 'id_product' => $this->id, 'deleteAllAttributes' => true));
|
||||
Hook::exec('actionProductAttributeDelete', array('id_product_attribute' => 0, 'id_product' => $this->id, 'deleteAllAttributes' => true));
|
||||
|
||||
$result = Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_attribute_combination`
|
||||
|
||||
+1
-1
@@ -1656,7 +1656,7 @@ FileETag INode MTime Size
|
||||
fwrite($write_fd, "\n\n".trim($specific_after));
|
||||
fclose($write_fd);
|
||||
|
||||
Hook::exec('afterCreateHtaccess');
|
||||
Hook::exec('actionHtaccessCreate');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class OrderPaymentCore extends ObjectModel
|
||||
{
|
||||
if (parent::add($autodate, $nullValues))
|
||||
{
|
||||
Hook::exec('paymentCCAdded', array('paymentCC' => $this));
|
||||
Hook::exec('actionPaymentCCAdd', array('paymentCC' => $this));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user