19declare(strict_types=1);
51 $this->
http = $DIC->http();
53 $this->ilias_settings =
$DIC[
'ilSetting'];
54 $this->rbac_system =
$DIC[
'rbacsystem'];
57 $this->
setTitle($this->
lng->txt(
'tutorial_support_block_title'));
63 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
64 return $this->
http->wrapper()->query()->retrieve(
78 if ($mail_url !== self::EMPTY_MAIL_URL_STRING) {
80 $property_name = $this->
lng->txt(
'tutorial_support_block_contact');
81 $properties[$property_name] = $mail_button;
84 $tutor_item = $this->
ui->factory()->item()->standard($name)
85 ->withLeadAvatar($avatar)
86 ->withProperties($properties);
89 $this->
user->isAnonymous() ||
90 !$this->hasContactEnabled($tutor_id)
94 $dropdown_actions[] = $this->
ui->factory()->legacy()->content(
97 $dropdown = $this->
ui->factory()->dropdown()->standard($dropdown_actions);
98 return $tutor_item->withActions(
$dropdown);
104 self::DATA_MAIL_URL => $this->getMailUrlOfUser($tutor),
106 self::DATA_TUTOR_ID => $tutor->
getId(),
112 $crs_ref_id = $this->initRefIdFromQuery();
113 if (is_null($crs_ref_id)) {
118 return $course_members->getContacts();
123 return $tutor->
getPref(
'public_profile') ===
'g' ||
125 !$this->
user->isAnonymous() &&
126 $tutor->
getPref(
'public_profile') ===
'y'
136 return is_null($setting_value) ? false : $setting_value ===
'y';
146 return $tutor_id === $this->
user->getId();
151 return !$tutor->
isAnonymous() && $this->hasPublicProfile($tutor);
156 return !$this->
user->isAnonymous() ||
158 $this->
user->isAnonymous() &&
159 $this->areILIASGlobalProfilesEnabled()
165 return (
bool) $this->ilias_settings->get(
'enable_global_profiles');
170 return $this->
ui->factory()->button()->shy(
171 $this->
lng->txt(
'tutorial_support_block_send_mail'),
179 !$this->isIliasInternalMailEnabled()
181 return (
string) self::EMPTY_MAIL_URL_STRING;
184 $this->
http->request()->getUri()->__toString(),
196 if (!$this->isCurrentUserAllowedToSeeTutorBlock()) {
200 $tutor_ids = $this->getTutorIds();
201 foreach ($tutor_ids as $tutor_id) {
204 !$this->isUserValid($tutor) ||
205 $this->
user->isAnonymous()
209 $data[] = $this->getTutorData($tutor);
216 return $this->createTutorItem(
217 (
string)
$data[self::DATA_MAIL_URL],
218 (
string)
$data[self::DATA_NAME],
219 (
int)
$data[self::DATA_TUTOR_ID]
225 return self::BLOCK_TYPE;
Builds a Color from either hex- or rgb values.
This class represents a block method of a block.
setTitle(string $a_title)
setPresentation(int $type)
setBlockId(string $a_block_id="0")
static getMailObjectRefId()
getPref(string $a_keyword)
getFullname(int $max_strlen=0)
static _lookupPref(int $a_usr_id, string $a_keyword)
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false)
static _lookupObjId(int $ref_id)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
@ilCtrl_IsCalledBy ilTutorialSupportBlockGUI: ilColumnGUI
areILIASGlobalProfilesEnabled()
isUserValid(ilObjUser $tutor)
isTutorCurrentUser(int $tutor_id)
hasPublicProfile(ilObjUser $tutor)
getListItemForData(array $data)
Get list item for data array.
isRepositoryObject()
Returns whether block has a corresponding repository object.
getMailUrlOfUser(ilObjUser $tutor)
RefineryFactory $refinery
getTutorData(ilObjUser $tutor)
createMailShyButton(string $mail_url)
ilSetting $ilias_settings
const EMPTY_MAIL_URL_STRING
isCurrentUserAllowedToSeeTutorBlock()
ilRbacSystem $rbac_system
hasContactEnabled(int $tutor_id)
isIliasInternalMailEnabled()
createTutorItem(string $mail_url, string $name, int $tutor_id,)
Common interface to all items.
An entity that renders components to a string output.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc