Index: branches/5.2.x/core/units/reviews/reviews_event_handler.php =================================================================== diff -u -N -r14851 -r14989 --- branches/5.2.x/core/units/reviews/reviews_event_handler.php (.../reviews_event_handler.php) (revision 14851) +++ branches/5.2.x/core/units/reviews/reviews_event_handler.php (.../reviews_event_handler.php) (revision 14989) @@ -1,6 +1,6 @@ Special == 'product' && !$this->Application->isAdmin) { + if ( $event->Special == 'product' && !$this->Application->isAdmin ) { // rev.product should auto-link return ''; } @@ -39,9 +40,9 @@ * @return bool * @access public */ - public function CheckPermission(&$event) + public function CheckPermission(kEvent &$event) { - if ($event->Name == 'OnAddReview' || $event->Name == 'OnCreate') { + if ( $event->Name == 'OnAddReview' || $event->Name == 'OnCreate' ) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ @@ -53,9 +54,10 @@ $res = $this->Application->CheckPermission($perm_name, 0, $main_object->GetDBField('CategoryId')) || $this->Application->CheckPermission($perm_name.'.PENDING', 0, $main_object->GetDBField('CategoryId')); - if (!$res) { + if ( !$res ) { $event->status = kEvent::erPERM_FAIL; } + return $res; } @@ -65,15 +67,15 @@ $perm_category = $this->_getReviewCategory($event); - if (in_array($event->Name, $check_events)) { + if ( in_array($event->Name, $check_events) ) { // check for PRODUCT.VIEW permission $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ $perm_prefix = $this->getPermPrefix($event); - if ($perm_category === false) { + if ( $perm_category === false ) { // no item id present -> allow return true; } @@ -173,16 +175,18 @@ * @access protected * @see OnListBuild */ - protected function SetCustomQuery(&$event) + protected function SetCustomQuery(kEvent &$event) { + parent::SetCustomQuery($event); + $object =& $event->getObject(); /* @var $object kDBList */ if ( !$this->Application->isAdminUser ) { $object->addFilter('active', '%1$s.Status = ' . STATUS_ACTIVE); } - switch ( $event->Special ) { + switch ($event->Special) { case 'showall': $object->clearFilters(); break;