19declare(strict_types=1);
54 $this->
ctrl = $DIC->ctrl();
55 $this->tpl =
$DIC->ui()->mainTemplate();
56 $this->
lng = $DIC->language();
57 $this->
user = $DIC->user();
58 $this->rbacsystem =
$DIC->rbac()->system();
59 $this->ui_factory =
$DIC->ui()->factory();
60 $this->ui_renderer =
$DIC->ui()->renderer();
61 $this->
http = $DIC->http();
74 $this->user_action_gui->init();
79 $next_class = $this->
ctrl->getNextClass();
80 $cmd = $this->
ctrl->getCmd(
'view');
82 switch (strtolower($next_class)) {
83 case strtolower(PublicProfileGUI::class):
85 $this->
http->wrapper()->query()->retrieve(
87 $this->refinery->kindlyTo()->int()
90 $profile_gui->setBackUrl($this->
ctrl->getLinkTarget($this,
'view'));
91 $this->
ctrl->forwardCommand($profile_gui);
104 protected function view(): void
106 $gallery_groups = $this->collection_provider->getGroupedCollections();
107 $groups_with_users = array_filter(
112 if (count($groups_with_users) === 0) {
113 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'no_gallery_users_available'));
119 foreach ($gallery_groups as $group) {
122 foreach ($sorted_group as
$user) {
127 if ($this->collection_provider->hasRemovableUsers()) {
131 $this->tpl->setContent(
132 $this->ui_renderer->render($this->ui_factory->deck($cards))
139 $this->ui_renderer->render(
140 $this->ui_factory->messageBox()->info(
141 $this->lng->txt(
'no_gallery_users_available')
147 let stateChangedListener = (
event) => {
148 const {buddyId, newState, oldState} =
event.detail;
150 if (newState ===
'ilBuddySystemUnlinkedRelationState') {
151 document.querySelector(
'.il-deck [data-buddy-id="' + buddyId +
'"]').closest(
'.il-card').parentElement.remove();
152 if (document.querySelectorAll(
'.il-card.thumbnail').length === 0) {
153 document.querySelector(
'.il-deck').innerHTML = {
$message};
159 document.addEventListener(
'il.bs.stateChange.afterStateChangePerformed', stateChangedListener);
161 $this->tpl->addOnLoadCode($onload_js);
168 $card = $this->ui_factory->card()->
standard(
$user->getPublicName())
169 ->withHighlight($group->isHighlighted());
170 $avatar = $this->ui_factory->image()->standard(
177 $sections[] = $this->ui_factory->listing()->descriptive(
180 $this->lng->txt(
"crs_contact_responsibility") => $group->
getLabel()
185 if ($actions_section !==
null) {
186 $sections[] = $actions_section;
197 return $card->withImage($avatar)->withSections($sections);
202 $contact_btn_html =
"";
204 if (!$this->
user->isAnonymous() &&
207 $this->user->getId() !== $user->
getId()
212 $list_html = $this->user_action_gui->renderDropDown($user->
getId());
214 if ($contact_btn_html || $list_html) {
215 return $this->ui_factory->legacy()->content(
216 "<div style='display:grid; grid-template-columns: max-content max-content;'>"
219 .
"</div><div style='margin-left: 5px;'>"
233 $this->
ctrl->setParameterByClass(
238 $public_profile_url = $this->
ctrl->getLinkTargetByClass(
239 PublicProfileGUI::class,
244 $avatar->withAction($public_profile_url),
245 $card->withTitleAction($public_profile_url)
Builds a Color from either hex- or rgb values.
GUI class for public user profile presentation.
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPersonalPicturePath(string $a_size='small', bool $a_force_pic=false)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
A class that provides a collection of actions on users.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@ilCtrl_Calls ilUsersGalleryGUI: ILIAS\User\Profile\PublicProfileGUI @ilCtrl_isCalledBy ilUsersGaller...
ilGlobalTemplateInterface $tpl
addPublicProfileLinksToAvatarAndCard(Image $avatar, StandardCard $card, int $user_id)
ilUserActionGUI $user_action_gui
getActionsSection(ilObjUser $user)
addUserRemovalJsForUserContacts()
getCardForUser(ilUsersGalleryUser $user, ilUsersGalleryUserCollection $group)
Interface GlobalHttpState.
This describes a standard Card.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc