From 2ac8d67e6bcffc9a8a63a966d2cb54bc5bb41ec2 Mon Sep 17 00:00:00 2001 From: Darko Date: Sat, 29 Apr 2017 00:44:38 +0200 Subject: [PATCH] new comment hooks new comment hooks --- oc-includes/osclass/controller/item.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/oc-includes/osclass/controller/item.php b/oc-includes/osclass/controller/item.php index e4edc4b17a..e02e74ebbe 100755 --- a/oc-includes/osclass/controller/item.php +++ b/oc-includes/osclass/controller/item.php @@ -481,7 +481,8 @@ function doModel() $result = $mItem->contact(); osc_run_hook('post_item_contact_post', $item); - if(is_string($result)){ + + if(is_string($result)) { osc_add_flash_error_message( $result ); } else { osc_add_flash_ok_message( _m("We've just sent an e-mail to the seller") ); @@ -528,6 +529,8 @@ function doModel() } // View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey(Params::getParam('id'))); + + osc_run_hook('post_item_add_comment_post', $item); $this->redirectTo( osc_item_url() ); break; case 'delete_comment': @@ -572,9 +575,10 @@ function doModel() $this->redirectTo( osc_item_url() ); } - $commentManager->deleteByPrimaryKey($commentId); - osc_add_flash_ok_message( _m('The comment has been deleted' ) ); - $this->redirectTo( osc_item_url() ); + $commentManager->deleteByPrimaryKey($commentId); + osc_add_flash_ok_message( _m('The comment has been deleted' ) ); + osc_run_hook('post_item_delete_comment_post', $item, $commentId); + $this->redirectTo( osc_item_url() ); break; default: // if there isn't ID, show an error 404