147 {
149 $tpl =
new ilTemplate(
'tpl.users_gallery.html',
true,
true,
'Services/User');
150
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()));
155
157 return count($group) > 0;
158 });
159 $groups_with_highlight = array_filter($groups_with_users,
function (
ilUsersGalleryGroup $group) {
161 });
162
163 if (0 == count($groups_with_users)) {
164 $tpl->setVariable(
'NO_GALLERY_USERS', $panel->getHTML());
166 }
167
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()));
172
173 require_once 'Services/User/Gallery/classes/class.ilUsersGallerySortedUserGroup.php';
174 require_once 'Services/User/Gallery/classes/class.ilUsersGalleryUserCollectionPublicNameSorter.php';
175
176 $cards = [];
177
178 foreach ($gallery_groups as $group) {
180
181 foreach ($group as
$user) {
182 $card = $this->factory->card(
$user->getPublicName());
183 $avatar = $this->factory->image()->standard(
$user->getAggregatedUser()->getPersonalPicturePath(
'big'),
$user->getPublicName());
184
185 $sections = [];
186
187 if (count($groups_with_highlight) > 0) {
188 $card = $card->withHighlight($group->isHighlighted());
189 }
190
191 $sections[] = $this->factory->listing()->descriptive(
192 [
193 $this->lng->txt(
"username") =>
$user->getAggregatedUser()->getLogin(),
194 $this->lng->txt("crs_contact_responsibility") => $group->getLabel()
195 ]
196 );
197
199
200 if (
$user->hasPublicProfile()) {
201 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user',
$user->getAggregatedUser()->getId());
202 $public_profile_url = $this->ctrl->getLinkTargetByClass('ilpublicuserprofilegui', 'getHTML');
203
204 $avatar = $avatar->withAction($public_profile_url);
205 $card = $card->withTitleAction($public_profile_url);
206 }
207
208 $card = $card->withImage($avatar)->withSections($sections);
209
210 $cards[] = $card;
211 }
212 }
213
214 $tpl->setVariable(
'GALLERY_HTML', $this->renderer->render($this->factory->deck($cards)));
215
216 if ($this->collection_provider->hasRemovableUsers()) {
217 $tpl->touchBlock(
'js_remove_handler');
218 }
219
221 }
static getInstanceByGlobalUser()
static getInstance()
Get instance.
special template class to simplify handling of ITX/PEAR
addActionSection(ilObjUser $user, array &$sections)
Class ilUsersGalleryGroup.
isHighlighted()
Returns whether or not it is a highlighted group.boolean
Class ilUsersGallerySortedUserGroup.
Class ilUsersGalleryUserCollectionPublicNameSorter.