示例#1
0
		/**
		* Зарегистрировать событие в истории событий
		* @param string $eventTypeId идентификатор типа события
		* @param array $params массив параметров события
		* @param int $elementId id связанной страницы
		* @param int $objectId id связанного объекта
		*/
		public function registerEvent($eventTypeId, $params = array(), $elementId = null, $objectId = null) {
			
			$pool = ConnectionPool::getInstance();
			$connection = $pool->getConnection();
			umiEventFeed::setConnection($connection);
			umiEventFeedType::setConnection($connection);
					
			try {
				$eventType = umiEventFeedType::get($eventTypeId);
			} catch (Exception $e) {
				$eventType = umiEventFeedType::create($eventTypeId);
			}
			
			$userId = permissionsCollection::getInstance()->getUserId();
			$user = umiObjectsCollection::getInstance()->getObject($userId)->getName();
			
			$module = cmsController::getInstance()->getModule('users');
			$link = $module->getObjectEditLink($userId);
			
			array_unshift($params, $user);
			array_unshift($params, $link);
			umiEventFeed::create($eventType, $params, $elementId, $objectId);
			
			$maxDays = (int) regedit::getInstance()->getVal("//modules/events/max-days-storing-events");
			if ($maxDays > 0) {
				$lastDate = time() - ($maxDays * 24 * 60 * 60);
				umiEventFeed::deleteList(array(), $lastDate);
			}
			
		}
示例#2
0
 public function registerEvent($v803e96ab2d19ace0f4af5786a470117e, $v21ffce5b8a6cc8cc6a41448dd69623c9 = array(), $v7552cd149af7495ee7d8225974e50f80 = null, $v16b2b26000987faccb260b9d39df1269 = null)
 {
     $vb10a8c0bede9eb4ea771b04db3149f28 = ConnectionPool::getInstance();
     $v4717d53ebfdfea8477f780ec66151dcb = $vb10a8c0bede9eb4ea771b04db3149f28->getConnection();
     umiEventFeed::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     umiEventFeedType::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     try {
         $v2f264034c73acbd6baae70dd7edb3d3f = umiEventFeedType::get($v803e96ab2d19ace0f4af5786a470117e);
     } catch (Exception $ve1671797c52e15f763380b45e841ec32) {
         $v2f264034c73acbd6baae70dd7edb3d3f = umiEventFeedType::create($v803e96ab2d19ace0f4af5786a470117e);
     }
     $v8e44f0089b076e18a718eb9ca3d94674 = permissionsCollection::getInstance()->getUserId();
     $vee11cbb19052e40b07aac0ca060c23ee = umiObjectsCollection::getInstance()->getObject($v8e44f0089b076e18a718eb9ca3d94674)->getName();
     $v22884db148f0ffb0d830ba431102b0b5 = cmsController::getInstance()->getModule('users');
     $v2a304a1348456ccd2234cd71a81bd338 = $v22884db148f0ffb0d830ba431102b0b5->getObjectEditLink($v8e44f0089b076e18a718eb9ca3d94674);
     array_unshift($v21ffce5b8a6cc8cc6a41448dd69623c9, $vee11cbb19052e40b07aac0ca060c23ee);
     array_unshift($v21ffce5b8a6cc8cc6a41448dd69623c9, $v2a304a1348456ccd2234cd71a81bd338);
     umiEventFeed::create($v2f264034c73acbd6baae70dd7edb3d3f, $v21ffce5b8a6cc8cc6a41448dd69623c9, $v7552cd149af7495ee7d8225974e50f80, $v16b2b26000987faccb260b9d39df1269);
     $v5a0eeddea3917f781ddb458441cc2a3e = (int) regedit::getInstance()->getVal("//modules/events/max-days-storing-events");
     if ($v5a0eeddea3917f781ddb458441cc2a3e > 0) {
         $v636843b5194c655771a1f62d6690ced4 = time() - $v5a0eeddea3917f781ddb458441cc2a3e * 24 * 60 * 60;
         umiEventFeed::deleteList(array(), $v636843b5194c655771a1f62d6690ced4);
     }
 }
示例#3
0
 public function addEventType()
 {
     $eventType = getRequest('event-type');
     $pool = ConnectionPool::getInstance();
     $connection = $pool->getConnection();
     umiEventFeedType::setConnection($connection);
     umiEventFeedType::create($eventType);
     $this->redirect(getServer("HTTP_REFERER"));
 }
示例#4
0
 public function addEventType()
 {
     $v2f264034c73acbd6baae70dd7edb3d3f = getRequest('event-type');
     $vb10a8c0bede9eb4ea771b04db3149f28 = ConnectionPool::getInstance();
     $v4717d53ebfdfea8477f780ec66151dcb = $vb10a8c0bede9eb4ea771b04db3149f28->getConnection();
     umiEventFeedType::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     umiEventFeedType::create($v2f264034c73acbd6baae70dd7edb3d3f);
     $this->redirect(getServer("HTTP_REFERER"));
 }