4 require_once
'Services/User/classes/class.ilUserUtil.php';
5 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
6 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddyList.php';
7 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemLinkButton.php';
8 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemRelation.php';
9 require_once
'Services/Contact/BuddySystem/classes/states/class.ilBuddySystemRelationStateFactory.php';
10 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
69 $this->ctrl = $DIC->ctrl();
70 $this->tpl = $DIC->ui()->mainTemplate();
71 $this->lng = $DIC->language();
72 $this->
user = $DIC->user();
73 $this->rbacsystem = $DIC->rbac()->system();
74 $this->factory = $DIC->ui()->factory();
75 $this->renderer = $DIC->ui()->renderer();
85 $next_class = $this->ctrl->getNextClass();
86 $cmd = $this->ctrl->getCmd(
'view');
88 switch ($next_class) {
89 case 'ilpublicuserprofilegui':
90 require_once
'Services/User/classes/class.ilPublicUserProfileGUI.php';
92 $profile_gui->setBackUrl($this->ctrl->getLinkTarget($this,
'view'));
93 $this->ctrl->forwardCommand($profile_gui);
112 $this->tpl->setContent(
$template->get());
121 $contact_btn_html =
"";
125 $this->
user->getId() != $user->
getId() &&
126 !$this->
user->isAnonymous() &&
132 include_once(
"./Services/User/Actions/classes/class.ilUserActionGUI.php");
133 include_once(
"./Services/User/Gallery/classes/class.ilGalleryUserActionContext.php");
135 $list_html = $ua_gui->renderDropDown($user->
getId());
137 if ($contact_btn_html || $list_html) {
138 $sections[] = $this->factory->legacy(
"<div style='float:left; margin-bottom:5px;'>" . $contact_btn_html .
"</div><div class='button-container'> " . $list_html .
"</div>");
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($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()
ilUsersGalleryGUI: ilPublicUserProfileGUI ilUsersGalleryGUI: ilCourseMembershipGUI, ilGroupMembershipGUI
Gallery context for user actions.
static getInstance(ilUserActionContext $a_user_action_context, ilTemplate $a_global_tpl, $a_current_user_id)
Get instance.
Class ilUsersGallerySortedUserGroup.
isHighlighted()
Returns whether or not it is a highlighted group.boolean
Class ilUsersGalleryUserCollectionPublicNameSorter.
GUI class for public user profile presentation.
getId()
get object id public
special template class to simplify handling of ITX/PEAR
Interface ilUsersGalleryCollectionProvider.
populateTemplate(array $gallery_groups)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
view()
Displays the participants gallery.
Create styles array
The data for the language used.
static getInstance()
Get instance.
addActionSection(ilObjUser $user, array &$sections)
Class ilUsersGalleryGroup.