ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAwarenessUserProviderContactRequests.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
30{
31 protected ilObjUser $user;
32 protected ilLanguage $lng;
33
34 public function __construct(Container $DIC)
35 {
36 $this->user = $DIC->user();
37 $this->lng = $DIC->language();
38 }
39
43 public function getProviderId(): string
44 {
45 return 'contact_approved';
46 }
47
51 public function getTitle(): string
52 {
53 $this->lng->loadLanguageModule('contact');
54 return $this->lng->txt('contact_awrn_req_contacts');
55 }
56
60 public function getInfo(): string
61 {
62 $this->lng->loadLanguageModule('contact');
63 return $this->lng->txt('contact_awrn_req_contacts_info');
64 }
65
71 public function getInitialUserSet(?array $user_ids = null): array
72 {
73 if ($this->user->isAnonymous()) {
74 return [];
75 }
76
77 if (!ilBuddySystem::getInstance()->isEnabled()) {
78 return [];
79 }
80
81 return ilBuddyList::getInstanceByGlobalUser()->getRequestRelationsForOwner()->getKeys();
82 }
83
87 public function isHighlighted(): bool
88 {
89 return true;
90 }
91}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
user()
Get the current user.
Definition: Container.php:71
language()
Get interface to the i18n service.
Definition: Container.php:95
getInitialUserSet(?array $user_ids=null)
Get initial set of users.
static getInstanceByGlobalUser(?ilObjUser $user=null)
language handling
User class.
global $DIC
Definition: shib_login.php:26