121 {
123 $tpl =
new ilTemplate(
'tpl.users_gallery.html',
true,
true,
'Services/User');
124
126 $panel->setBody($this->
lng->txt(
'no_gallery_users_available'));
128
129 $groups_with_users = array_filter($gallery_groups,
static function (
ilUsersGalleryGroup $group):
bool {
130 return count($group) > 0;
131 });
132 $groups_with_highlight = array_filter($groups_with_users,
static function (
ilUsersGalleryGroup $group):
bool {
134 });
135
136 if (0 === count($groups_with_users)) {
139 }
140
142 $panel->setBody($this->
lng->txt(
'no_gallery_users_available'));
144
145 $cards = [];
146
147 foreach ($gallery_groups as $group) {
149
150 foreach ($group as
$user) {
152 $avatar = $this->factory->image()->standard(
155 );
156
157 $sections = [];
158
159 if (count($groups_with_highlight) > 0) {
160 $card = $card->withHighlight($group->isHighlighted());
161 }
162
163 $sections[] = $this->factory->listing()->descriptive(
164 [
165 $this->
lng->txt(
"username") => $user->getAggregatedUser()->getLogin(),
166 $this->lng->txt("crs_contact_responsibility") => $group->getLabel()
167 ]
168 );
169
171
173 $this->
ctrl->setParameterByClass(
174 ilPublicUserProfileGUI::class,
175 'user',
177 );
178 $public_profile_url = $this->
ctrl->getLinkTargetByClass(ilPublicUserProfileGUI::class,
'getHTML');
179
180 $avatar = $avatar->withAction($public_profile_url);
181 $card = $card->withTitleAction($public_profile_url);
182 }
183
184 $card = $card->withImage($avatar)->withSections($sections);
185
186 $cards[] = $card;
187 }
188 }
189
190 $tpl->
setVariable(
'GALLERY_HTML', $this->renderer->render($this->factory->deck($cards)));
191
192 if ($this->collection_provider->hasRemovableUsers()) {
194 }
195
197 }
static getInstanceByGlobalUser()
hasPublicProfile()
returns true if public is profile, false otherwise
getPersonalPicturePath(string $a_size="small", bool $a_force_pic=false)
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
special template class to simplify handling of ITX/PEAR
ilGlobalTemplateInterface $tpl
addActionSection(ilObjUser $user, array &$sections)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
touchBlock(string $block)
overwrites ITX::touchBlock.
setVariable(string $variable, $value='')
Sets the given variable to the given value.