4 include_once
'Services/Table/classes/class.ilTable2GUI.php';
39 public function __construct($a_parent_obj, $a_current_folder_id, $a_parent_cmd =
'')
46 $this->_currentFolderId = $a_current_folder_id;
47 $this->_parentObject = $a_parent_obj;
49 $this->
setId(
'mail_folder_tbl');
54 $this->
setFormAction($this->ctrl->getFormAction($this->_parentObject,
'showFolder'));
62 $this->
setRowTemplate(
'tpl.mail_folder_row.html',
'Services/Mail');
79 $this->
addColumn($this->lng->txt(
'personal_picture'),
'',
'10%');
81 $this->
addColumn($this->lng->txt(
'recipient'),
'rcp_to',
'25%');
83 $this->
addColumn($this->lng->txt(
'sender'),
'from',
'25%');
84 $this->
addColumn($this->lng->txt(
'subject'),
'm_subject',
'40%');
85 $this->
addColumn($this->lng->txt(
'date'),
'send_time',
'20%');
88 $mtree =
new ilTree($ilUser->getId());
90 $this->_folderNode = $mtree->getNodeData($this->_currentFolderId);
96 $this->
initMultiCommands($this->_parentObject->mbox->getActions($this->_currentFolderId));
120 $this->_isDraftsFolder = $a_bool;
141 $this->_isSentFolder = $a_bool;
162 $this->_isTrashFolder = $a_bool;
178 if($this->_folderNode[
'm_type'] ==
'user_folder' ||
179 $this->_folderNode[
'm_type'] ==
'local')
181 if($this->_folderNode[
'm_type'] ==
'user_folder')
185 $this->
addCommandButton(
'addSubFolder', $this->lng->txt(
'mail_add_subfolder'));
187 else if($this->_folderNode[
'm_type'] ==
'trash')
189 $this->
addCommandButton(
'askForEmptyTrash', $this->lng->txt(
'mail_empty_trash'));
206 foreach($actions as $key => $action)
208 if($key ==
'moveMails')
210 $folders = $this->_parentObject->mbox->getSubFolders();
211 foreach($folders as $folder)
213 if($folder[
'type'] !=
'trash' ||
216 if($folder[
'type'] !=
'user_folder')
218 $label = $action.
' '.$this->lng->txt(
'mail_'.$folder[
'title']).
219 ($folder[
'type'] ==
'trash' ?
' ('.$this->lng->txt(
'delete').
')' :
'');
223 $this->
addMultiCommand($folder[
'obj_id'], $action.
' '.$folder[
'title']);
248 static $userObjectCache = array();
250 if(isset($userObjectCache[$a_usr_id]))
return $userObjectCache[$a_usr_id];
252 $userObjectCache[$a_usr_id] =
new ilObjUser($a_usr_id);
254 return $userObjectCache[$a_usr_id];
268 $this->_selectedItems = $a_selected_items;
300 require_once
'Services/Mail/classes/class.ilMailBoxQuery.php';
320 foreach(
$data[
'set'] as $key => $mail)
327 $mail[
'checked'] =
' checked="checked" ';
333 $mail[
'mail_login'] = $this->_parentObject->umail->formatNamesForOutput($mail[
'rcp_to']);
337 if($mail[
'sender_id'] != ANONYMOUS_USER_ID)
342 $mail[
'mail_from'] = $tmp_user->getFullname();
344 if(!($login = $tmp_user->getLogin()))
346 $login = $mail[
'import_name'].
' ('.$this->lng->txt(
'user_deleted').
')';
347 $mail[
'mail_login'] = $mail[
'import_name'].
' ('.$this->lng->txt(
'user_deleted').
')';
350 $mail[
'img_sender'] = $tmp_user->getPersonalPicturePath(
'xxsmall');
351 $mail[
'mail_login'] = $mail[
'alt_sender'] = $login;
361 $mail[
'mailclass'] = $mail[
'm_status'] ==
'read' ?
'mailread' :
'mailunread';
366 $this->ctrl->setParameterByClass(
'ilmailformgui',
'mail_id', $mail[
'mail_id']);
367 $this->ctrl->setParameterByClass(
'ilmailformgui',
'type',
'draft');
368 $mail[
'mail_link_read'] = $this->ctrl->getLinkTargetByClass(
'ilmailformgui');
369 $this->ctrl->clearParametersByClass(
'ilmailformgui');
373 $this->ctrl->setParameter($this->_parentObject,
'mail_id', $mail[
'mail_id']);
374 $this->ctrl->setParameter($this->_parentObject,
'cmd',
'showMail');
375 $mail[
'mail_link_read'] = $this->ctrl->getLinkTarget($this->_parentObject);
376 $this->ctrl->clearParameters($this->_parentObject);
379 $mail[
'mail_subject'] = htmlspecialchars($mail[
'm_subject']);
382 $data[
'set'][$key] = $mail;
392 if($this->_folderNode[
'm_type'] ==
'user_folder')
394 $txt_folder = $this->_folderNode[
'title'];
395 $img_folder =
'icon_user_folder.gif';
399 $txt_folder = $this->lng->txt(
'mail_'.$this->_folderNode[
'title']);
400 $img_folder =
'icon'.substr($this->_folderNode[
'title'], 1).
'.gif';
419 protected function setTitleData($folderLabel, $mailCount, $unreadCount, $imgFolder)
421 $titleTemplate =
new ilTemplate(
'tpl.mail_folder_title.html',
true,
true,
'Services/Mail');
422 $titleTemplate->setVariable(
'TXT_FOLDER', $folderLabel);
423 $titleTemplate->setVariable(
'MAIL_COUNT', $mailCount);
424 $titleTemplate->setVariable(
'TXT_MAIL_S', $this->lng->txt(
'mail_s'));
425 $titleTemplate->setVariable(
'MAIL_COUNT_UNREAD', $unreadCount);
426 $titleTemplate->setVariable(
'TXT_UNREAD', $this->lng->txt(
'unread'));
444 $this->_number_of_mails = $a_number_of_mails;
472 foreach($a_set as $key => $value)
474 $this->tpl->setVariable(strtoupper($key), $value);