Index: branches/5.2.x/units/link_validation/link_validation_eh.php =================================================================== diff -u -r14877 -r14987 --- branches/5.2.x/units/link_validation/link_validation_eh.php (.../link_validation_eh.php) (revision 14877) +++ branches/5.2.x/units/link_validation/link_validation_eh.php (.../link_validation_eh.php) (revision 14987) @@ -1,6 +1,6 @@ permMapping = array_merge($this->permMapping, $permissions); } - function mapEvents() + /** + * Define alternative event processing method names + * + * @return void + * @see kEventHandler::$eventMethods + * @access protected + */ + protected function mapEvents() { parent::mapEvents(); @@ -56,28 +66,29 @@ * @return bool * @access public */ - public function CheckPermission(&$event) + public function CheckPermission(kEvent &$event) { $check_events = Array ('OnApproveLinks', 'OnDeclineLinks', 'OnDeleteLinks'); - if (in_array($event->Name, $check_events)) { + + if ( in_array($event->Name, $check_events) ) { $ids = $this->_getSelectedIds($event); $perm_value = true; - if ($ids) { + if ( $ids ) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ $items = $perm_helper->GetCategoryItemData('l', $ids); $check_method = $event->Name == 'OnDeleteLinks' ? 'DeleteCheckPermission' : 'ModifyCheckPermission'; foreach ($items as $item_id => $item_data) { - if ($perm_helper->$check_method($item_data['CreatedById'], $item_data['CategoryId'], 'l') == 0) { + if ( $perm_helper->$check_method($item_data['CreatedById'], $item_data['CategoryId'], 'l') == 0 ) { // one of items selected has no permission $perm_value = false; break; } } - if (!$perm_value) { + if ( !$perm_value ) { $event->status = kEvent::erPERM_FAIL; } } @@ -96,11 +107,11 @@ * @return void * @access protected */ - protected function prepareObject(&$object, &$event) + protected function prepareObject(&$object, kEvent &$event) { parent::prepareObject($object, $event); - $object->addCalculatedField('CachedNavbar', 'c.l'.$this->Application->GetVar('m_lang').'_CachedNavbar'); + $object->addCalculatedField('CachedNavbar', 'c.l' . $this->Application->GetVar('m_lang') . '_CachedNavbar'); } /** @@ -111,14 +122,16 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(&$event) + protected function SetCustomQuery(kEvent &$event) { + parent::SetCustomQuery($event); + $object =& $event->getObject(); /* @var $object kDBList */ $object->addFilter('primary_category_filter', 'ci.PrimaryCat = 1'); - if ($event->Special == 'invalid') { + if ( $event->Special == 'invalid' ) { $object->addFilter('status_filter', '%1$s.ValidationStatus = ' . LINK_VALIDATION_INVALID); } }