19 declare(strict_types=1);
53 $this->
ctrl = $DIC->ctrl();
54 $this->tpl = $DIC->ui()->mainTemplate();
55 $this->
lng = $DIC->language();
56 $this->
user = $DIC->user();
57 $this->rbacsystem = $DIC->rbac()->system();
58 $this->ui_factory = $DIC->ui()->factory();
59 $this->ui_renderer = $DIC->ui()->renderer();
60 $this->
http = $DIC->http();
73 $this->user_action_gui->
init();
78 $next_class = $this->
ctrl->getNextClass();
79 $cmd = $this->
ctrl->getCmd(
'view');
81 switch (strtolower($next_class)) {
82 case strtolower(ilPublicUserProfileGUI::class):
84 $this->
http->wrapper()->query()->retrieve(
89 $profile_gui->setBackUrl($this->
ctrl->getLinkTarget($this,
'view'));
90 $this->
ctrl->forwardCommand($profile_gui);
103 protected function view(): void
105 $gallery_groups = $this->collection_provider->getGroupedCollections();
106 $groups_with_users = array_filter(
111 if (count($groups_with_users) === 0) {
112 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'no_gallery_users_available'));
118 foreach ($gallery_groups as $group) {
121 foreach ($sorted_group as $user) {
126 if ($this->collection_provider->hasRemovableUsers()) {
130 $this->tpl->setContent(
131 $this->ui_renderer->render($this->ui_factory->deck($cards))
138 $this->ui_renderer->render(
139 $this->ui_factory->messageBox()->info(
140 $this->
lng->txt(
'no_gallery_users_available')
146 let stateChangedListener = (
event) => {
147 const {buddyId, newState, oldState} =
event.detail;
149 if (newState ===
'ilBuddySystemUnlinkedRelationState') {
150 document.querySelector(
'.il-deck [data-buddy-id="' + buddyId +
'"]').closest(
'.il-card').parentElement.remove();
151 if (document.querySelectorAll(
'.il-card.thumbnail').length === 0) {
152 document.querySelector(
'.il-deck').innerHTML = {
$message};
158 document.addEventListener(
'il.bs.stateChange.afterStateChangePerformed', stateChangedListener);
160 $this->tpl->addOnLoadCode($onload_js);
167 $card = $this->ui_factory->card()->standard($user->
getPublicName())
169 $avatar = $this->ui_factory->image()->standard(
176 $sections[] = $this->ui_factory->listing()->descriptive(
179 $this->
lng->txt(
"crs_contact_responsibility") => $group->
getLabel()
184 if ($actions_section !==
null) {
185 $sections[] = $actions_section;
196 return $card->withImage($avatar)->withSections($sections);
201 $contact_btn_html =
"";
203 if (!$this->
user->isAnonymous() &&
211 $list_html = $this->user_action_gui->renderDropDown($user->
getId());
213 if ($contact_btn_html || $list_html) {
214 return $this->ui_factory->legacy()->content(
215 "<div style='display:grid; grid-template-columns: max-content max-content;'>" 218 .
"</div><div style='margin-left: 5px;'>" 232 $this->
ctrl->setParameterByClass(
233 ilPublicUserProfileGUI::class,
237 $public_profile_url = $this->
ctrl->getLinkTargetByClass(
238 ilPublicUserProfileGUI::class,
243 $avatar->withAction($public_profile_url),
244 $card->withTitleAction($public_profile_url)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addPublicProfileLinksToAvatarAndCard(Image $avatar, StandardCard $card, int $user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes a standard Card.
A class that provides a collection of actions on users.
addUserRemovalJsForUserContacts()
ilUsersGalleryGUI: ilPublicUserProfileGUI ilUsersGalleryGUI: ilCourseMembershipGUI, ilGroupMembershipGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
GUI class for public user profile presentation.
static http()
Fetches the global http state from ILIAS.
ilGlobalTemplateInterface $tpl
getActionsSection(ilObjUser $user)
__construct(Container $dic, ilPlugin $plugin)
ilUserActionGUI $user_action_gui
getCardForUser(ilUsersGalleryUser $user, ilUsersGalleryUserCollection $group)