Example #1
0
 public function onSearch(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     $kw = $params["kw"];
     $userId = $params["userId"];
     $recipients = $params["recipients"];
     //$context = $params["context"];
     $groups = array();
     if ($kw === null && $params["context"] == MCOMPOSE_BOL_Service::CONTEXT_EVENT) {
         $groups = $this->findGroups(null, $userId);
     } else {
         $groups = $this->findGroups($kw, $userId);
     }
     if (!empty($recipients)) {
         $rIds = array();
         foreach ($recipients as $r) {
             list($prefix, $id) = explode("_", $r);
             if ($prefix == self::ID_PREFIX) {
                 $rIds[] = $id;
             }
         }
         $_groups = GROUPS_BOL_GroupDao::getInstance()->findByIdList($rIds);
         $groups = array_merge($groups, $_groups);
     }
     $data = $this->buildData($groups, OW::getLanguage()->text('mcompose', 'selector_group_my_groups'));
     foreach ($data as $item) {
         $event->add($item);
     }
 }
Example #2
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return GROUPS_BOL_GroupDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Example #3
0
 public function setGroupsPrivacy($ownerId, $privacy)
 {
     $this->groupDao->setPrivacy($ownerId, $privacy);
 }