149 $tpl =
new ilTemplate(
'tpl.users_gallery.html',
true,
true,
'Services/User');
151 require_once
'Services/UIComponent/Panel/classes/class.ilPanelGUI.php';
153 $panel->setBody($this->lng->txt(
'no_gallery_users_available'));
154 $tpl->setVariable(
'NO_ENTRIES_HTML', json_encode($panel->getHTML()));
157 return count($group) > 0;
159 $groups_with_highlight = array_filter($groups_with_users,
function (
ilUsersGalleryGroup $group) {
163 if (0 == count($groups_with_users)) {
164 $tpl->setVariable(
'NO_GALLERY_USERS', $panel->getHTML());
168 require_once
'Services/UIComponent/Panel/classes/class.ilPanelGUI.php';
170 $panel->setBody($this->lng->txt(
'no_gallery_users_available'));
171 $tpl->setVariable(
'NO_ENTRIES_HTML', json_encode($panel->getHTML()));
173 require_once
'Services/User/Gallery/classes/class.ilUsersGallerySortedUserGroup.php';
174 require_once
'Services/User/Gallery/classes/class.ilUsersGalleryUserCollectionPublicNameSorter.php';
178 foreach ($gallery_groups as $group) {
181 foreach ($group as
$user) {
182 $card = $this->factory->card()->standard($user->getPublicName());
183 $avatar = $this->factory->image()->standard($user->getAggregatedUser()->getPersonalPicturePath(
'big'), $user->getPublicName());
187 if (count($groups_with_highlight) > 0) {
188 $card = $card->withHighlight($group->isHighlighted());
191 $sections[] = $this->factory->listing()->descriptive(
193 $this->lng->txt(
"username") => $user->getAggregatedUser()->getLogin(),
194 $this->lng->txt(
"crs_contact_responsibility") => $group->getLabel()
200 if ($user->hasPublicProfile()) {
201 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user', $user->getAggregatedUser()->getId());
202 $public_profile_url = $this->ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
204 $avatar = $avatar->withAction($public_profile_url);
205 $card = $card->withTitleAction($public_profile_url);
208 $card = $card->withImage($avatar)->withSections($sections);
214 $tpl->setVariable(
'GALLERY_HTML', $this->renderer->render($this->factory->deck($cards)));
216 if ($this->collection_provider->hasRemovableUsers()) {
217 $tpl->touchBlock(
'js_remove_handler');
static getInstanceByGlobalUser()
Class ilUsersGallerySortedUserGroup.
isHighlighted()
Returns whether or not it is a highlighted group.boolean
Class ilUsersGalleryUserCollectionPublicNameSorter.
special template class to simplify handling of ITX/PEAR
static getInstance()
Get instance.
addActionSection(ilObjUser $user, array &$sections)
Class ilUsersGalleryGroup.