/** * Get Mails */ function getMails() { global $ilUser; // BEGIN MAILS $umail = new ilMail($_SESSION["AccountId"]); $mbox = new ilMailBox($_SESSION["AccountId"]); $inbox = $mbox->getInboxFolder(); //SHOW MAILS FOR EVERY USER $this->mails = $umail->getMailsOfFolder($inbox, array('status' => 'unread', 'type' => 'system')); }
/** * Get Mails */ protected function getMails() { global $ilUser; $umail = new ilMail($ilUser->getId()); $mbox = new ilMailBox($ilUser->getId()); $this->inbox = $mbox->getInboxFolder(); $this->mails = $umail->getMailsOfFolder($this->inbox, array('status' => 'unread', 'type' => 'normal')); }
/** * add folder * @param integer id of parent folder * @access public */ function deleteFolder($a_folder_id) { global $ilDB; $query = $ilDB->queryf(' SELECT title FROM mail_obj_data WHERE obj_id = %s', array('integer'), array($a_folder_id)); $row = $ilDB->fetchAssoc($query); if (array_key_exists($row['title'], $this->default_folder)) { return false; } include_once "Services/Mail/classes/class.ilMail.php"; $umail = new ilMail($this->user_id); // SAVE SUBTREE DATA $subtree = $this->mtree->getSubtree($this->mtree->getNodeData($a_folder_id)); // DELETE ENTRY IN TREE $this->mtree->deleteTree($this->mtree->getNodeData($a_folder_id)); // DELETE ENTRY IN mobj_data foreach ($subtree as $node) { // DELETE mail(s) of folder(s) $mails = $umail->getMailsOfFolder($node["obj_id"]); foreach ($mails as $mail) { $mail_ids[] = $mail["mail_id"]; } if (is_array($mail_ids)) { $umail->deleteMails($mail_ids); } // DELETE mobj_data entries $statement = $ilDB->manipulateF(' DELETE FROM ' . $this->table_mail_obj_data . ' WHERE obj_id = %s', array('integer'), array($node['obj_id'])); } return true; }