本文整理汇总了PHP中ilMail::appendInstallationSignature方法的典型用法代码示例。如果您正苦于以下问题:PHP ilMail::appendInstallationSignature方法的具体用法?PHP ilMail::appendInstallationSignature怎么用?PHP ilMail::appendInstallationSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilMail
的用法示例。
在下文中一共展示了ilMail::appendInstallationSignature方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notify
public function notify(ilNotificationObject $notification)
{
// use a specific sender or ANONYMOUS
$sender_id = isset($notification->handlerParams['mail']['sender']) ? $notification->handlerParams['mail']['sender'] : ANONYMOUS_USER_ID;
include_once 'Services/Mail/classes/class.ilMail.php';
$mail = new ilMail($sender_id);
$mail->appendInstallationSignature(true);
$mail->sendMail($notification->user->getLogin(), '', '', $notification->title, $notification->longDescription, false, array('normal'));
//mail($notification->user->getEmail(), $notification->title, $notification->longDescription);
}
示例2: sendNotification
static function sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id, $a_comment = null)
{
global $ilUser, $ilObjDataCache, $ilAccess;
include_once "./Services/Notification/classes/class.ilNotification.php";
include_once "./Modules/Wiki/classes/class.ilObjWiki.php";
include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
$wiki_id = $ilObjDataCache->lookupObjId($a_wiki_ref_id);
$wiki = new ilObjWiki($a_wiki_ref_id, true);
$page = new ilWikiPage($a_page_id);
// #11138
$ignore_threshold = $a_action == "comment";
// 1st update will be converted to new - see below
if ($a_action == "new") {
return;
}
if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
$users = ilNotification::getNotificationsForObject($a_type, $a_page_id, null, $ignore_threshold);
$wiki_users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
$users = array_merge($users, $wiki_users);
if (!sizeof($users)) {
return;
}
ilNotification::updateNotificationTime(ilNotification::TYPE_WIKI_PAGE, $a_page_id, $users);
} else {
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
if (!sizeof($users)) {
return;
}
}
ilNotification::updateNotificationTime(ilNotification::TYPE_WIKI, $wiki_id, $users, $a_page_id);
// #15192 - should always be present
if ($a_page_id) {
include_once "./Modules/Wiki/classes/class.ilObjWikiGUI.php";
$link = ILIAS_HTTP_PATH . "/" . ilObjWikiGui::getGotoLink($a_wiki_ref_id, $page->getTitle());
} else {
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getLink($a_wiki_ref_id);
}
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
// see ilBlogPostingGUI::getSnippet()
// see ilBlogPosting::getNotificationAbstract()
include_once "Modules/Wiki/classes/class.ilWikiPageGUI.php";
$pgui = new ilWikiPageGUI($page->getId());
$pgui->setRawPageContent(true);
$pgui->setAbstractOnly(true);
$pgui->setFileDownloadLink(".");
$pgui->setFullscreenLink(".");
$pgui->setSourcecodeDownloadScript(".");
$snippet = $pgui->showPage();
$snippet = ilPageObject::truncateHTML($snippet, 500, "...");
// making things more readable
$snippet = str_replace('<br/>', "\n", $snippet);
$snippet = str_replace('<br />', "\n", $snippet);
$snippet = str_replace('</p>', "\n", $snippet);
$snippet = str_replace('</div>', "\n", $snippet);
$snippet = trim(strip_tags($snippet));
// "fake" new (to enable snippet - if any)
$current_version = array_shift($page->getHistoryEntries());
$current_version = $current_version["nr"];
if (!$current_version) {
$a_type = ilNotification::TYPE_WIKI;
$a_action = "new";
}
foreach (array_unique($users) as $idx => $user_id) {
if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $a_wiki_ref_id)) {
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('wiki');
$subject = sprintf($ulng->txt('wiki_change_notification_subject'), $wiki->getTitle(), $page->getTitle());
$message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
// update/delete
$message .= $ulng->txt('wiki_change_notification_page_body_' . $a_action) . ":\n\n";
$message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
$message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
$message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
if ($snippet) {
$message .= "\n" . $ulng->txt('content') . "\n" . "----------------------------------------\n" . $snippet . "\n" . "----------------------------------------\n";
}
// include comment/note text
if ($a_comment) {
$message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
}
$message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
} else {
// new
$message .= $ulng->txt('wiki_change_notification_body_' . $a_action) . ":\n\n";
$message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
$message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
$message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
if ($snippet) {
$message .= $ulng->txt('content') . "\n" . "----------------------------------------\n" . $snippet . "\n" . "----------------------------------------\n\n";
}
$message .= $ulng->txt('wiki_change_notification_link') . ": " . $link;
}
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
//.........这里部分代码省略.........
示例3: sendNotification
/**
* @param $a_action
* @param $a_table_id
* @param null $a_record_id
*/
public static function sendNotification($a_action, $a_table_id, $a_record_id = NULL)
{
global $ilUser, $ilAccess;
// If coming from trash, never send notifications and don't load dcl Object
if ($_GET['ref_id'] == SYSTEM_FOLDER_ID) {
return;
}
$dclObj = new ilObjDataCollection($_GET['ref_id']);
if ($dclObj->getNotification() != 1) {
return;
}
$obj_table = ilDataCollectionCache::getTableCache($a_table_id);
$obj_dcl = $obj_table->getCollectionObject();
// recipients
require_once './Services/Notification/classes/class.ilNotification.php';
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_DATA_COLLECTION, $obj_dcl->getId(), true);
if (!sizeof($users)) {
return;
}
ilNotification::updateNotificationTime(ilNotification::TYPE_DATA_COLLECTION, $obj_dcl->getId(), $users);
//FIXME $_GET['ref_id]
require_once './Services/Link/classes/class.ilLink.php';
$link = ilLink::_getLink($_GET['ref_id']);
// prepare mail content
// use language of recipient to compose message
require_once './Services/Language/classes/class.ilLanguageFactory.php';
// send mails
require_once './Services/Mail/classes/class.ilMail.php';
require_once './Services/User/classes/class.ilObjUser.php';
require_once './Services/Language/classes/class.ilLanguageFactory.php';
require_once './Services/User/classes/class.ilUserUtil.php';
require_once './Services/User/classes/class.ilUserUtil.php';
require_once './Modules/DataCollection/classes/class.ilDataCollectionTable.php';
foreach (array_unique($users) as $idx => $user_id) {
// the user responsible for the action should not be notified
// FIXME $_GET['ref_id]
if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $_GET['ref_id'])) {
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('dcl');
$subject = sprintf($ulng->txt('dcl_change_notification_subject'), $obj_dcl->getTitle());
// update/delete
$message = $ulng->txt("dcl_hello") . " " . ilObjUser::_lookupFullname($user_id) . ",\n\n";
$message .= $ulng->txt('dcl_change_notification_dcl_' . $a_action) . ":\n\n";
$message .= $ulng->txt('obj_dcl') . ": " . $obj_dcl->getTitle() . "\n\n";
$message .= $ulng->txt('dcl_table') . ": " . $obj_table->getTitle() . "\n\n";
$message .= $ulng->txt('dcl_record') . ":\n";
$message .= "------------------------------------\n";
if ($a_record_id) {
$record = ilDataCollectionCache::getRecordCache($a_record_id);
if (!$record->getTableId()) {
$record->setTableId($a_table_id);
}
// $message .= $ulng->txt('dcl_record_id').": ".$a_record_id.":\n";
$t = "";
foreach ($record->getTable()->getVisibleFields() as $field) {
if ($record->getRecordField($field->getId())) {
$t .= $field->getTitle() . ": " . $record->getRecordField($field->getId())->getPlainText() . "\n";
}
}
$message .= $t . "\n";
}
$message .= "------------------------------------\n";
$message .= $ulng->txt('dcl_changed_by') . ": " . $ilUser->getFullname() . " " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
$message .= $ulng->txt('dcl_change_notification_link') . ": " . $link . "\n\n";
$message .= $ulng->txt('dcl_change_why_you_receive_this_email');
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
} else {
unset($users[$idx]);
}
}
}
示例4: sentReminder
protected function sentReminder(array $a_recipient_ids)
{
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($this->getRefId(), "svy");
foreach ($a_recipient_ids as $user_id) {
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('survey');
$subject = sprintf($ulng->txt('survey_reminder_subject'), $this->getTitle());
$message = sprintf($ulng->txt('survey_reminder_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
$message .= $ulng->txt('survey_reminder_body') . ":\n\n";
$message .= $ulng->txt('obj_svy') . ": " . $this->getTitle() . "\n";
$message .= "\n" . $ulng->txt('survey_reminder_link') . ": " . $link;
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
}
}
示例5: sendNotification
static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null)
{
global $ilUser, $ilAccess;
// get blog object id (repository or workspace)
if ($a_in_wsp) {
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$tree = new ilWorkspaceTree($ilUser->getId());
// owner of tree is irrelevant
$blog_obj_id = $tree->lookupObjectId($a_blog_node_id);
$access_handler = new ilWorkspaceAccessHandler($tree);
$link = ilWorkspaceAccessHandler::getGotoLink($a_blog_node_id, $blog_obj_id, "_" . $a_posting_id);
} else {
$blog_obj_id = ilObject::_lookupObjId($a_blog_node_id);
$access_handler = null;
include_once "Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($a_blog_node_id, "blog", true, "_" . $a_posting_id);
}
if (!$blog_obj_id) {
return;
}
include_once "./Modules/Blog/classes/class.ilBlogPosting.php";
$posting = new ilBlogPosting($a_posting_id);
// #11138
$ignore_threshold = $a_action == "comment";
// approval handling
$admin_only = false;
if (!$posting->isApproved()) {
$blog = new self($blog_obj_id, false);
if ($blog->hasApproval()) {
switch ($a_action) {
case "update":
// un-approved posting was updated - no notifications
return;
case "new":
// un-approved posting was activated - admin-only notification
$admin_only = true;
$ignore_threshold = true;
break;
}
}
}
// recipients
include_once "./Services/Notification/classes/class.ilNotification.php";
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_BLOG, $blog_obj_id, $a_posting_id, $ignore_threshold);
if (!sizeof($users)) {
return;
}
// send mails
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
$posting_title = $posting->getTitle();
$blog_title = ilObject::_lookupTitle($blog_obj_id);
$author = $posting->getAuthor();
$notified = array();
foreach (array_unique($users) as $idx => $user_id) {
// the user responsible for the action should not be notified
if ($user_id == $ilUser->getId()) {
continue;
}
// workspace
if ($access_handler) {
if ($admin_only && !$access_handler->checkAccessOfUser($tree, $user_id, 'write', '', $a_blog_node_id)) {
continue;
}
if (!$access_handler->checkAccessOfUser($tree, $user_id, 'read', '', $a_blog_node_id)) {
continue;
}
} else {
if ($admin_only && !$ilAccess->checkAccessOfUser($user_id, 'write', '', $a_blog_node_id)) {
continue;
}
if (!$ilAccess->checkAccessOfUser($user_id, 'read', '', $a_blog_node_id)) {
continue;
}
}
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('blog');
$subject = sprintf($ulng->txt('blog_change_notification_subject'), $blog_title);
$message = sprintf($ulng->txt('blog_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
$message .= $ulng->txt('blog_change_notification_body_' . $a_action) . ":\n\n";
$message .= $ulng->txt('obj_blog') . ": " . $blog_title . "\n";
$message .= $ulng->txt('blog_posting') . ": " . $posting_title . "\n";
$message .= $ulng->txt('blog_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
if ($a_comment) {
$message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
}
$message .= "\n" . $ulng->txt('blog_change_notification_link') . ": " . $link;
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
$notified[] = $user_id;
}
if (sizeof($notified)) {
ilNotification::updateNotificationTime(ilNotification::TYPE_BLOG, $blog_obj_id, $notified);
}
}
示例6: sendNotification
/**
* Send notification about team status
*
* @param int $a_exc_ref_id
* @param int $a_user_id
* @param string $a_action
*/
public function sendNotification($a_exc_ref_id, $a_user_id, $a_action)
{
global $ilUser;
// no need to notify current user
if ($ilUser->getId() == $a_user_id) {
return;
}
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($a_exc_ref_id);
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($a_user_id);
$ulng->loadLanguageModule('exc');
$subject = sprintf($ulng->txt('exc_team_notification_subject_' . $a_action), $this->getTitle());
$message = sprintf($ulng->txt('exc_team_notification_salutation'), ilObjUser::_lookupFullname($a_user_id)) . "\n\n";
$message .= $ulng->txt('exc_team_notification_body_' . $a_action) . "\n\n";
$message .= $ulng->txt('obj_exc') . ": " . ilObject::_lookupTitle($this->getExerciseId()) . "\n";
$message .= $ulng->txt('exc_assignment') . ": " . $this->getTitle() . "\n";
$message .= $ulng->txt('exc_team_notification_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
$message .= $ulng->txt('exc_team_notification_link') . ": " . $link;
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$ret = $mail_obj->sendMail(ilObjUser::_lookupLogin($a_user_id), "", "", $subject, $message, array(), array("system"));
// var_dump($ret);
}
示例7: confirmRegistration
public function confirmRegistration()
{
global $lng, $ilias, $ilLog;
ilUtil::setCookie('iltest', 'cookie', false);
if (!isset($_GET['rh']) || !strlen(trim($_GET['rh']))) {
ilUtil::redirect('./login.php?cmd=force_login®_confirmation_msg=reg_confirmation_hash_not_passed');
}
try {
require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
$oRegSettings = new ilRegistrationSettings();
$usr_id = ilObjUser::_verifyRegistrationHash(trim($_GET['rh']));
$oUser = ilObjectFactory::getInstanceByObjId($usr_id);
$oUser->setActive(true);
if ($oRegSettings->passwordGenerationEnabled()) {
$passwd = ilUtil::generatePasswords(1);
$password = $passwd[0];
$oUser->setPasswd($password, IL_PASSWD_PLAIN);
$oUser->setLastPasswordChangeTS(time());
}
$oUser->update();
$usr_lang = $oUser->getPref('language');
if ($lng->getLangKey() != $usr_lang) {
$lng = new ilLanguage($usr_lang);
}
// send email
// try individual account mail in user administration
include_once "Services/Mail/classes/class.ilAccountMail.php";
include_once './Services/User/classes/class.ilObjUserFolder.php';
$amail = ilObjUserFolder::_lookupNewAccountMail($usr_lang);
if (trim($amail["body"]) != "" && trim($amail["subject"]) != "") {
$acc_mail = new ilAccountMail();
$acc_mail->setUser($oUser);
if ($oRegSettings->passwordGenerationEnabled()) {
$acc_mail->setUserPassword($password);
}
$acc_mail->send();
} else {
include_once 'Services/Mail/classes/class.ilMail.php';
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
// mail subject
$subject = $lng->txt("reg_mail_subject");
// mail body
$body = $lng->txt("reg_mail_body_salutation") . " " . $oUser->getFullname() . ",\n\n" . $lng->txt("reg_mail_body_text1") . "\n\n" . $lng->txt("reg_mail_body_text2") . "\n" . ILIAS_HTTP_PATH . "/login.php?client_id=" . CLIENT_ID . "\n";
$body .= $lng->txt("login") . ": " . $oUser->getLogin() . "\n";
if ($oRegSettings->passwordGenerationEnabled()) {
$body .= $lng->txt("passwd") . ": " . $password . "\n";
}
$body .= "\n";
$body .= $lng->txt('reg_mail_body_forgot_password_info') . "\n";
$body .= "\n";
$body .= $lng->txt("reg_mail_body_text3") . "\n\r";
$body .= $oUser->getProfileAsString($lng);
$mail_obj->enableSoap(false);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail($oUser->getEmail(), '', '', $subject, $body, array(), array('normal'));
}
ilUtil::redirect('./login.php?cmd=force_login®_confirmation_msg=reg_account_confirmation_successful&lang=' . $usr_lang);
} catch (ilRegConfirmationLinkExpiredException $exception) {
include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
$soap_client = new ilSoapClient();
$soap_client->setResponseTimeout(1);
$soap_client->enableWSDL(true);
$soap_client->init();
$ilLog->write(__METHOD__ . ': Triggered soap call (background process) for deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
$soap_client->call('deleteExpiredDualOptInUserObjects', array($_COOKIE['PHPSESSID'] . '::' . $_COOKIE['ilClientId'], $exception->getCode()));
ilUtil::redirect('./login.php?cmd=force_login®_confirmation_msg=' . $exception->getMessage() . "&lang=" . $usr_lang);
} catch (ilRegistrationHashNotFoundException $exception) {
ilUtil::redirect('./login.php?cmd=force_login®_confirmation_msg=' . $exception->getMessage() . "&lang=" . $usr_lang);
}
}
示例8: sendNotificationMail
function sendNotificationMail($user_id, $anonymize_id)
{
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
$recipients = preg_split('/,/', $this->mailaddresses);
foreach ($recipients as $recipient) {
$messagetext = $this->mailparticipantdata;
$data = ilObjUser::_getUserData(array($user_id));
foreach ($data[0] as $key => $value) {
if ($this->getAnonymize()) {
$messagetext = str_replace('[' . $key . ']', '', $messagetext);
} else {
$messagetext = str_replace('[' . $key . ']', $value, $messagetext);
}
}
$active_id = $this->getActiveID($user_id, $anonymize_id);
$messagetext .= (strlen($messagetext) ? "\n\n\n" : '') . $this->lng->txt('results') . "\n\n" . $this->getParticipantTextResults($active_id);
// #11298
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($this->getRefId(), "svy");
$messagetext .= "\n\n" . $this->lng->txt('obj_svy') . ": " . $this->getTitle() . "\n";
$messagetext .= "\n" . $this->lng->txt('survey_notification_tutor_link') . ": " . $link;
$mail->appendInstallationSignature(true);
$mail->sendMail($recipient, "", "", $this->lng->txt('finished_mail_subject') . ': ' . $this->getTitle(), $messagetext, array(), array('normal'));
}
}
示例9: sendNotification
static function sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id, $a_comment = null)
{
global $ilUser, $ilObjDataCache, $ilAccess;
include_once "./Services/Notification/classes/class.ilNotification.php";
include_once "./Modules/Wiki/classes/class.ilObjWiki.php";
include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
$wiki_id = $ilObjDataCache->lookupObjId($a_wiki_ref_id);
$wiki = new ilObjWiki($a_wiki_ref_id, true);
$page = new ilWikiPage($a_page_id);
// #11138
$ignore_threshold = $a_action == "comment";
if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
$users = ilNotification::getNotificationsForObject($a_type, $a_page_id, null, $ignore_threshold);
$wiki_users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
$users = array_merge($users, $wiki_users);
if (!sizeof($users)) {
return;
}
include_once "./Modules/Wiki/classes/class.ilObjWikiGUI.php";
$link = ILIAS_HTTP_PATH . "/" . ilObjWikiGui::getGotoLink($a_wiki_ref_id, $page->getTitle());
ilNotification::updateNotificationTime(ilNotification::TYPE_WIKI_PAGE, $a_page_id, $users);
} else {
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
if (!sizeof($users)) {
return;
}
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getLink($a_wiki_ref_id);
}
ilNotification::updateNotificationTime(ilNotification::TYPE_WIKI, $wiki_id, $users, $a_page_id);
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
foreach (array_unique($users) as $idx => $user_id) {
if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $a_wiki_ref_id)) {
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('wiki');
$subject = sprintf($ulng->txt('wiki_change_notification_subject'), $wiki->getTitle());
$message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
// update/delete
$message .= $ulng->txt('wiki_change_notification_page_body_' . $a_action) . ":\n\n";
$message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
$message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
$message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
// include comment/note text
if ($a_comment) {
$message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
}
$message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
} else {
// new
$message .= $ulng->txt('wiki_change_notification_body_' . $a_action) . ":\n\n";
$message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
$message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
$message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
$message .= $ulng->txt('wiki_change_notification_link') . ": " . $link;
}
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
} else {
unset($users[$idx]);
}
}
}