4 require_once
'Services/Search/classes/class.ilSearchSettings.php';
26 public function __construct(
$mode)
34 $this->allow_smtp = $rbacsystem->checkAccess(
'smtp_mail', MAIL_SETTINGS_ID);
35 $this->user_id = $ilUser->getId();
38 $this->result[
'items'] = array();
39 $this->result[
'hasMoreResults'] =
false;
50 if(!in_array(
$mode, array(self::MODE_FETCH_ALL, self::MODE_STOP_ON_MAX_ENTRIES)))
52 throw new InvalidArgumentException(
"Wrong mode passed!");
63 $this->mode == self::MODE_STOP_ON_MAX_ENTRIES &&
64 $this->max_entries >= 0 && count($this->result[
'items']) >= $this->max_entries
70 $this->mode == self::MODE_FETCH_ALL &&
71 count($this->result[
'items']) >= self::MAX_RESULT_ENTRIES
84 public function addResult($login, $firstname, $lastname)
86 if(!isset($this->handled_recipients[$login]))
89 $recipient[
'value'] = $login;
92 if($firstname && $lastname)
94 $label .=
" [" . $firstname .
", " . $lastname .
"]";
96 $recipient[
'label'] = $label;
98 $this->result[
'items'][] = $recipient;
99 $this->handled_recipients[$login] = 1;
116 return (
int)count($this->result[
'items']);