/** * Static method * check how many unread mails are in inbox * @access public * @static * @return int number of mails */ function _countNewMails($a_user_id) { include_once 'Services/Mail/classes/class.ilMailGlobalServices.php'; return ilMailGlobalServices::getNumberOfNewMailsByUserId($a_user_id); }
/** * Render status box */ function renderStatusBox($a_tpl) { global $ilUser, $lng; $box = false; // new mails? if ($this->mail) { $new_mails = ilMailGlobalServices::getNumberOfNewMailsByUserId($ilUser->getId()); if ($new_mails > 0) { $a_tpl->setCurrentBlock('status_text'); $a_tpl->setVariable('STATUS_TXT', $new_mails); $a_tpl->parseCurrentBlock(); } $a_tpl->setCurrentBlock('status_item'); $a_tpl->setVariable('STATUS_IMG', ilUtil::getImagePath('icon_mail.svg')); $a_tpl->setVariable('STATUS_IMG_ALT', $lng->txt("mail")); $a_tpl->setVariable('STATUS_HREF', 'ilias.php?baseClass=ilMailGUI'); $a_tpl->parseCurrentBlock(); $box = true; } if ($box) { $a_tpl->setCurrentBlock("status_box"); $a_tpl->parseCurrentBlock(); } }
function hasNewMail($sid) { $this->initAuth($sid); $this->initIlias(); if (!$this->__checkSession($sid)) { return $this->__raiseError($this->__getMessage(), $this->__getMessageCode()); } global $ilUser; include_once 'Services/Mail/classes/class.ilMailGlobalServices.php'; if (ilMailGlobalServices::getNumberOfNewMailsByUserId($ilUser->getId()) > 0) { return true; } else { return false; } }