Index: branches/5.3.x/units/topics/topics_event_handler.php
===================================================================
diff -u -r16397 -r16521
--- branches/5.3.x/units/topics/topics_event_handler.php	(.../topics_event_handler.php)	(revision 16397)
+++ branches/5.3.x/units/topics/topics_event_handler.php	(.../topics_event_handler.php)	(revision 16521)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version	$Id: topics_event_handler.php 16397 2016-11-12 17:36:29Z alex $
+* @version	$Id: topics_event_handler.php 16521 2017-01-20 20:26:22Z alex $
 * @package	In-Bulletin
 * @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
 * @license      GNU/GPL
@@ -26,8 +26,8 @@
 		public function CheckPermission(kEvent $event)
 		{
 			if ( $event->Name == 'OnTopicLockToggle' ) {
+				/** @var kCatDBItem $object */
 				$object = $event->getObject();
-				/* @var $object kCatDBItem */
 
 				if ( !$object->isLoaded() ) {
 					$event->status = kEvent::erPERM_FAIL;
@@ -58,8 +58,8 @@
 		 */
 		function OnToggleLock($event)
 		{
+			/** @var kDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kDBItem */
 
 			$new_type = $object->GetDBField('TopicType') ? 0 : 1;
 			$object->SetDBField('TopicType', $new_type);
@@ -93,15 +93,15 @@
 
 			$this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
 
+			/** @var kCatDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kCatDBItem */
 
 			if ( !$object->GetDBField('TodayDate') ) {
 				$object->SetDBField('TodayDate', date('Y-m-d'));
 			}
 
+			/** @var PostHelper $post_helper */
 			$post_helper = $this->Application->recallObject('PostHelper');
-			/* @var $post_helper PostHelper */
 
 			$object->SetDBField('TopicText', $post_helper->CensorText($object->GetDBField('TopicText')));
 		}
@@ -122,11 +122,11 @@
 				return ;
 			}
 
+			/** @var kDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kDBItem */
 
+			/** @var kDBItem $post */
 			$post = $this->Application->recallObject($event->Prefix . '-post', null, Array ('skip_autoload' => true));
-			/* @var $post kDBItem */
 
 			$post->SetDBField('Pending', $object->GetDBField('Status') == STATUS_ACTIVE ? 0 : 1);
 			$post->SetDBField('Subject', '');
@@ -156,12 +156,12 @@
 				return;
 			}
 
+			/** @var kCatDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kCatDBItem */
 
 			if ( $object->GetDBField('Posts') == 1 ) {
+				/** @var kDBItem $post */
 				$post = $this->Application->recallObject($event->Prefix . '-post', null, Array ('skip_autoload' => true));
-				/* @var $post kDBItem */
 
 				$main_status = $object->GetDBField('Status');
 				$post->Load($object->GetDBField('LastPostId'));
@@ -183,8 +183,8 @@
 		{
 			parent::OnAfterItemLoad($event);
 
+			/** @var kCatDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kCatDBItem */
 
 			if ( $object->GetDBField('Posts') > 0 || !$this->Application->isAdminUser ) {
 				$object->setRequired('PostingText', false);
@@ -198,8 +198,8 @@
 		 */
 		function OnTopicLockToggle($event)
 		{
+			/** @var kCatDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kCatDBItem */
 
 			$topic_type = $object->GetDBField('TopicType');
 			$object->SetDBField('TopicType', $topic_type == 1 ? 0 : 1);
@@ -270,8 +270,8 @@
 		 */
 		protected function OnToogleCategoryTopicsSubscribe(kEvent $event)
 		{
+			/** @var PostHelper $post_helper */
 			$post_helper = $this->Application->recallObject('PostHelper');
-			/* @var $post_helper PostHelper */
 
 			$manager = $post_helper->getSubscriptionManager('CategoryTopics');
 
@@ -292,11 +292,11 @@
 		 */
 		protected function OnToogleTopicPostsSubscribe(kEvent $event)
 		{
+			/** @var kDBItem $object */
 			$object = $event->getObject();
-			/* @var $object kDBItem */
 
+			/** @var PostHelper $post_helper */
 			$post_helper = $this->Application->recallObject('PostHelper');
-			/* @var $post_helper PostHelper */
 
 			$manager = $post_helper->getSubscriptionManager('TopicPosts', Array ($object->GetID()));