示例#1
0
 /**
  * Получить типы событий, отслеживаемые пользователем
  */
 public function getUserSettings()
 {
     $pool = ConnectionPool::getInstance();
     $connection = $pool->getConnection();
     umiEventFeedType::setConnection($connection);
     umiEventFeedUser::setConnection($connection);
     $user = $this->getUser();
     $settings = umiEventFeedType::getAllowedList($user->getSettings());
     $types = umiEventFeedType::getList();
     $result = array('nodes:type' => array());
     foreach ($types as $type) {
         $typeId = $type->getId();
         $result['nodes:type'][$typeId]['attribute:id'] = $typeId;
         $result['nodes:type'][$typeId]['attribute:name'] = getLabel($typeId);
         $result['nodes:type'][$typeId]['attribute:checked'] = in_array($typeId, $settings) ? 1 : 0;
     }
     return def_module::parseTemplate('', $result);
 }
示例#2
0
 public function getUserSettings()
 {
     $vb10a8c0bede9eb4ea771b04db3149f28 = ConnectionPool::getInstance();
     $v4717d53ebfdfea8477f780ec66151dcb = $vb10a8c0bede9eb4ea771b04db3149f28->getConnection();
     umiEventFeedType::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     umiEventFeedUser::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     $vee11cbb19052e40b07aac0ca060c23ee = $this->getUser();
     $v2e5d8aa3dfa8ef34ca5131d20f9dad51 = umiEventFeedType::getAllowedList($vee11cbb19052e40b07aac0ca060c23ee->getSettings());
     $vd14a8022b085f9ef19d479cbdd581127 = umiEventFeedType::getList();
     $result = array('nodes:type' => array());
     foreach ($vd14a8022b085f9ef19d479cbdd581127 as $v599dcce2998a6b40b1e38e8c6006cb0a) {
         $v5f694956811487225d15e973ca38fbab = $v599dcce2998a6b40b1e38e8c6006cb0a->getId();
         $result['nodes:type'][$v5f694956811487225d15e973ca38fbab]['attribute:id'] = $v5f694956811487225d15e973ca38fbab;
         $result['nodes:type'][$v5f694956811487225d15e973ca38fbab]['attribute:name'] = getLabel($v5f694956811487225d15e973ca38fbab);
         $result['nodes:type'][$v5f694956811487225d15e973ca38fbab]['attribute:checked'] = in_array($v5f694956811487225d15e973ca38fbab, $v2e5d8aa3dfa8ef34ca5131d20f9dad51) ? 1 : 0;
     }
     return def_module::parseTemplate('', $result);
 }