1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4/**
5 * Class ilAwarenessUserProviderContactRequests
6 * @author  Michael Jansen <mjansen@databay.de>
7 * @ingroup ServicesAwareness
8 */
9class ilAwarenessUserProviderContactRequests extends ilAwarenessUserProvider
10{
11    /** @var ilObjUser */
12    protected $user;
13
14    /**
15     * ilAwarenessUserProviderApprovedContacts constructor.
16     */
17    public function __construct()
18    {
19        global $DIC;
20
21        parent::__construct();
22
23        $this->user = $DIC['ilUser'];
24    }
25
26    /**
27     * @inheritDoc
28     */
29    public function getProviderId()
30    {
31        return 'contact_approved';
32    }
33
34    /**
35     * @inheritDoc
36     */
37    public function getTitle()
38    {
39        $this->lng->loadLanguageModule('contact');
40        return $this->lng->txt('contact_awrn_req_contacts');
41    }
42
43    /**
44     * @inheritDoc
45     */
46    public function getInfo()
47    {
48        $this->lng->loadLanguageModule('contact');
49        return $this->lng->txt('contact_awrn_req_contacts_info');
50    }
51
52    /**
53     * @inheritDoc
54     */
55    public function getInitialUserSet()
56    {
57        if ($this->user->isAnonymous()) {
58            return [];
59        }
60
61        if (!ilBuddySystem::getInstance()->isEnabled()) {
62            return [];
63        }
64
65        return ilBuddyList::getInstanceByGlobalUser()->getRequestRelationsForOwner()->getKeys();
66    }
67
68    /**
69     * @inheritDoc
70     */
71    public function isHighlighted()
72    {
73        return true;
74    }
75}
76