19 declare(strict_types=1);
46 $this->sender = $user;
63 $this->recipientIds = array_map(
'intval', $recipientIds);
66 public function send(): void
72 $recipientLanguage->loadLanguageModule(
'buddysystem');
76 $personalProfileLink = $recipientLanguage->txt(
'buddy_noti_cr_profile_not_published');
82 $this->sender->getFirstname() .
', ' .
83 $this->sender->getLastname() .
' ' .
84 $this->sender->getLogin()
92 $this->sender->getId(),
101 $this->sender->getId(),
112 'APPROVE_REQUEST_TXT' => $recipientLanguage->txt(
'buddy_notification_contact_request_link'),
114 'IGNORE_REQUEST_TXT' => $recipientLanguage->txt(
'buddy_notification_contact_request_ignore'),
116 'PERSONAL_PROFILE_LINK' => $personalProfileLink,
118 $notification->setTitleVar(
'buddy_notification_contact_request', [],
'buddysystem');
119 $notification->setShortDescriptionVar(
'buddy_notification_contact_request_short', $bodyParams,
'buddysystem');
120 $notification->setLongDescriptionVar(
'buddy_notification_contact_request_long', $bodyParams,
'buddysystem');
121 $notification->setLinks($links);
122 $notification->setValidForSeconds(ilNotificationConfig::TTL_LONG);
123 $notification->setVisibleForSeconds(ilNotificationConfig::DEFAULT_TTS);
124 $notification->setIconPath(
'templates/default/images/icon_usr.svg');
127 ContactNotificationProvider::NOTIFICATION_TYPE,
128 self::CONTACT_REQUEST_KEY .
'_' . $this->sender->getId(),
131 $notification->notifyByUsers([$user->getId()]);
138 if (is_numeric($portfolioId) && $portfolioId > 0) {
143 $this->sender->getPref(
'public_profile') ===
'y' ||
144 $this->sender->getPref(
'public_profile') ===
'g'
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
description of a localized parameter this information is used locate translations while processing no...
hasPublicProfile(int $recipientUsrId)
static getDefaultPortfolio(int $a_user_id)
Get default portfolio of user.
__construct(ilObjUser $user, ilSetting $settings)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
setRecipientIds(array $recipientIds)
static _getLanguage(string $a_lang_key='')
Get language object.
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.
const CONTACT_REQUEST_KEY