// Rename correctly all hooks

This commit is contained in:
rMalie
2012-01-02 15:52:40 +00:00
parent 65585b63b1
commit a776684f13
36 changed files with 112 additions and 104 deletions
@@ -658,7 +658,7 @@ class AdminCustomersControllerCore extends AdminController
'messages' => $messages,
// Display hook specified to this page : AdminCustomers
'hook' => Hook::exec('adminCustomers', array('id_customer' => $customer->id)),
'hook' => Hook::exec('displayAdminCustomers', array('id_customer' => $customer->id)),
// Groups
'groups' => $groups,
@@ -264,7 +264,7 @@ class AdminFeaturesControllerCore extends AdminController
$feature_value = new FeatureValue(Tools::getValue('id_feature_value'));
$this->tpl_vars = array(
'hook' => Hook::exec('featureValueForm', array('id_feature_value' => $feature_value->id))
'hook' => Hook::exec('displayFeatureValueForm', array('id_feature_value' => $feature_value->id))
);
$this->getlanguages();
@@ -350,8 +350,8 @@ class AdminFeaturesControllerCore extends AdminController
if (Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value'))
{
Hook::exec('postProcessFeatureValue',
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeatureValue to stop saving process
Hook::exec('displayFeatureValuePostProcess',
array('errors' => &$this->_errors)); // send _errors as reference to allow displayFeatureValuePostProcess to stop saving process
if (Tools::isSubmit('deletefeature_value'))
{
@@ -407,8 +407,8 @@ class AdminFeaturesControllerCore extends AdminController
}
else
{
Hook::exec('postProcessFeature',
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeature to stop saving process
Hook::exec('displayFeaturePostProcess',
array('errors' => &$this->_errors)); // send _errors as reference to allow displayFeaturePostProcess to stop saving process
if (Tools::getValue('submitDel'.$this->table))
{
+1 -1
View File
@@ -564,7 +564,7 @@ class AdminHomeControllerCore extends AdminController
$tpl_vars['last_orders'] =$this->getLastOrders();
$tpl_vars['tips_optimization'] = $this->_displayOptimizationTips();
$HOOK_BACKOFFICEHOME = Hook::exec('backOfficeHome');
$HOOK_BACKOFFICEHOME = Hook::exec('displayBackOfficeHome');
$tpl_vars['HOOK_BACKOFFICEHOME'] = $HOOK_BACKOFFICEHOME;
$smarty->assign($tpl_vars);
+1 -1
View File
@@ -784,7 +784,7 @@ class AdminImportControllerCore extends AdminController
imageResize($tmpfile, $path.'-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']);
}
if (in_array($image_type['id_image_type'], $watermark_types))
Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_entity));
Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity));
}
else
{
+1 -1
View File
@@ -208,7 +208,7 @@ class AdminMetaControllerCore extends AdminController
else
$_POST['url_rewrite_'.$lang['id_lang']] = Tools::getValue('url_rewrite_1');
}
Hook::exec('afterSaveAdminMeta');
Hook::exec('actionAdminMetaSave');
}
return parent::postProcess();
+4 -4
View File
@@ -478,7 +478,7 @@ class AdminOrdersControllerCore extends AdminController
$orderDetail = new OrderDetail((int)($id_order_detail));
if (!$order->deleteProduct($order, $orderDetail, $qtyCancelProduct))
$this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$orderDetail->product_name.'</span>';
Hook::exec('cancelProduct', array('order' => $order, 'id_order_detail' => $id_order_detail));
Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => $id_order_detail));
}
if (!sizeof($this->_errors) AND $customizationList)
foreach ($customizationList AS $id_customization => $id_order_detail)
@@ -504,7 +504,7 @@ class AdminOrdersControllerCore extends AdminController
$this->_errors[] = Tools::displayError('Cannot generate credit slip');
else
{
Hook::exec('orderSlip', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list));
Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list));
@Mail::Send((int)$order->id_lang, 'credit_slip', Mail::l('New credit slip regarding your order', $order->id_lang),
$params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,
_PS_MAIL_DIR_, true);
@@ -1044,8 +1044,8 @@ class AdminOrdersControllerCore extends AdminController
'invoices_collection' => $order->getInvoicesCollection(),
'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(),
'payment_methods' => $payment_methods,
'HOOK_INVOICE' => Hook::exec('invoice', array('id_order' => $order->id)),
'HOOK_ADMIN_ORDER' => Hook::exec('adminOrder', array('id_order' => $order->id))
'HOOK_INVOICE' => Hook::exec('displayInvoice', array('id_order' => $order->id)),
'HOOK_ADMIN_ORDER' => Hook::exec('displayAdminOrder', array('id_order' => $order->id))
);
return parent::renderView();
@@ -438,7 +438,7 @@ class AdminProductsControllerCore extends AdminController
$this->_errors[] = Tools::displayError('An error occurred while copying images.');
else
{
Hook::exec('addProduct', array('product' => $product));
Hook::exec('actionProductAdd', array('product' => $product));
Search::indexation(false, $product->id);
$this->redirect_after = self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=19&token='.($token ? $token : $this->token);
}
@@ -611,7 +611,7 @@ class AdminProductsControllerCore extends AdminController
if (!$product->addStockMvt(Tools::getValue('attribute_mvt_quantity'), $id_reason, $id_product_attribute, null, $this->context->employee->id))
$this->_errors[] = Tools::displayError('An error occurred while updating qty.');
}
Hook::exec('updateProductAttribute', array('id_product_attribute' => (int)$id_product_attribute));
Hook::exec('actionProductAttributeUpdate', array('id_product_attribute' => (int)$id_product_attribute));
$this->updateDownloadProduct($product, 1, $id_product_attribute);
}
else
@@ -1383,7 +1383,7 @@ class AdminProductsControllerCore extends AdminController
}
@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));
}
}
@@ -1415,7 +1415,7 @@ class AdminProductsControllerCore extends AdminController
$this->_errors[] = Tools::displayError('An error occurred while adding tags.');
else
{
Hook::exec('addProduct', array('product' => $object));
Hook::exec('actionProductAdd', array('product' => $object));
Search::indexation(false, $object->id);
}
@@ -1498,7 +1498,7 @@ class AdminProductsControllerCore extends AdminController
else
{
//self::$currentIndex .= '&image_updated='.$id_image;
Hook::exec('updateProduct', array('product' => $object));
Hook::exec('actionProductUpdate', array('product' => $object));
Search::indexation(false, $object->id);
//if (Tools::getValue('resizer') == 'man' && isset($id_image) && is_int($id_image) && $id_image)
// $this->redirect_after = self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') || Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token));
@@ -165,7 +165,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
$module_instance = Module::getInstanceByName($module_name);
if ($module_instance && $module_instance->active)
$hook = Hook::exec('AdminStatsModules', NULL, $module_instance->id);
$hook = Hook::exec('displayAdminStatsModules', null, $module_instance->id);
}
$tpl->assign(array(