本文整理汇总了PHP中UserGroup::show_group_column_information方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::show_group_column_information方法的具体用法?PHP UserGroup::show_group_column_information怎么用?PHP UserGroup::show_group_column_information使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::show_group_column_information方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_social_menu
/**
* Shows the right menu of the Social Network tool
*
* @param string highlight link possible values: group_add, home, messages, messages_inbox, messages_compose ,messages_outbox ,invitations, shared_profile, friends, groups search
* @param int group id
* @param int user id
* @param bool show profile or not (show or hide the user image/information)
*
*/
public static function show_social_menu($show = '', $group_id = 0, $user_id = 0, $show_full_profile = false, $show_delete_account_button = false)
{
if (empty($user_id)) {
$user_id = api_get_user_id();
}
$usergroup = new UserGroup();
$user_info = api_get_user_info($user_id, true);
$current_user_id = api_get_user_id();
$current_user_info = api_get_user_info($current_user_id, true);
if ($current_user_id == $user_id) {
$user_friend_relation = null;
} else {
$user_friend_relation = SocialManager::get_relation_between_contacts($current_user_id, $user_id);
}
$show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
// get count unread message and total invitations
$count_unread_message = MessageManager::get_number_of_messages(true);
$count_unread_message = !empty($count_unread_message) ? Display::badge($count_unread_message) : '';
$number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
$group_pending_invitations = $usergroup->get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION, false);
$group_pending_invitations = count($group_pending_invitations);
$total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
$total_invitations = !empty($total_invitations) ? Display::badge($total_invitations) : '';
$html = '<div class="social-menu">';
if (in_array($show, $show_groups) && !empty($group_id)) {
//--- Group image
$group_info = $usergroup->get($group_id);
$big = $usergroup->get_picture_group($group_id, $group_info['picture'], 160, GROUP_IMAGE_SIZE_BIG);
$html .= '<div class="social-content-image">';
$html .= '<div class="well social-background-content">';
$html .= Display::url('<img src=' . $big['file'] . ' class="social-groups-image" /> </a><br /><br />', api_get_path(WEB_PATH) . 'main/social/groups.php?id=' . $group_id);
if ($usergroup->is_group_admin($group_id, api_get_user_id())) {
$html .= '<div id="edit_image" class="hidden_message" style="display:none"><a href="' . api_get_path(WEB_PATH) . 'main/social/group_edit.php?id=' . $group_id . '">' . get_lang('EditGroup') . '</a></div>';
}
$html .= '</div>';
$html .= '</div>';
} else {
$img_array = UserManager::get_user_picture_path_by_id($user_id, 'web', true, true);
$big_image = UserManager::get_picture_user($user_id, $img_array['file'], '', USER_IMAGE_SIZE_BIG);
$big_image = $big_image['file'];
$normal_image = $img_array['dir'] . $img_array['file'];
//--- User image
$html .= '<div class="well social-background-content">';
if ($img_array['file'] != 'unknown.jpg') {
$html .= '<a class="thumbnail ajax" href="' . $big_image . '"><img src=' . $normal_image . ' /> </a>';
} else {
$html .= '<img src=' . $normal_image . ' width="110px" />';
}
if (api_get_user_id() == $user_id) {
$html .= '<div id="edit_image" class="hidden_message" style="display:none">';
$html .= '<a href="' . api_get_path(WEB_PATH) . 'main/auth/profile.php">' . get_lang('EditProfile') . '</a></div>';
}
$html .= '</div>';
}
if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends'))) {
$html .= '<div class="well sidebar-nav"><ul class="nav nav-list">';
$active = $show == 'home' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/home.php">' . Display::return_icon('home.png', get_lang('Home'), array()) . get_lang('Home') . '</a></li>';
if (api_get_setting('allow_message_tool') == 'true') {
$active = $show == 'messages' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php?f=social">' . Display::return_icon('instant_message.png', get_lang('Messages'), array()) . get_lang('Messages') . $count_unread_message . '</a></li>';
}
// Invitations
if (api_get_setting('allow_message_tool') == 'true') {
$active = $show == 'invitations' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/invitations.php">' . Display::return_icon('invitation.png', get_lang('Invitations'), array()) . get_lang('Invitations') . $total_invitations . '</a></li>';
}
//Shared profile and groups
$active = $show == 'shared_profile' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php">' . Display::return_icon('my_shared_profile.png', get_lang('ViewMySharedProfile'), array()) . get_lang('ViewMySharedProfile') . '</a></li>';
$active = $show == 'friends' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/friends.php">' . Display::return_icon('friend.png', get_lang('Friends'), array()) . get_lang('Friends') . '</a></li>';
$active = $show == 'browse_groups' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/groups.php">' . Display::return_icon('group_s.png', get_lang('SocialGroups'), array()) . get_lang('SocialGroups') . '</a></li>';
//Search users
$active = $show == 'search' ? 'active' : null;
$html .= '<li class="' . $active . '"><a href="' . api_get_path(WEB_PATH) . 'main/social/search.php">' . Display::return_icon('zoom.png', get_lang('Search'), array()) . get_lang('Search') . '</a></li>';
$html .= '</ul>
</div>';
}
if (in_array($show, $show_groups) && !empty($group_id)) {
$html .= $usergroup->show_group_column_information($group_id, api_get_user_id(), $show);
}
if ($show == 'shared_profile') {
//echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';
$html .= '<div class="well sidebar-nav">
<ul class="nav nav-list">';
// My own profile
if ($show_full_profile && $user_id == intval(api_get_user_id())) {
$html .= '<li><a href="' . api_get_path(WEB_PATH) . 'main/social/home.php">' . Display::return_icon('home.png', get_lang('Home'), array()) . get_lang('Home') . '</a></li>';
if (api_get_setting('allow_message_tool') == 'true') {
//.........这里部分代码省略.........
示例2: show_social_menu
//.........这里部分代码省略.........
</a>
</li>';
$active = $show == 'browse_groups' ? 'active' : null;
$links .= '
<li class="browse-groups-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
</a>
</li>';
//Search users
$active = $show == 'search' ? 'active' : null;
$links .= '
<li class="search-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
' . $searchIcon . ' ' . get_lang('Search') . '
</a>
</li>';
//My files
$active = $show == 'myfiles' ? 'active' : null;
$myFiles = '
<li class="myfiles-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
' . $filesIcon . ' ' . get_lang('MyFiles') . '
</a>
</li>';
if (api_get_setting('platform.allow_my_files') === 'false') {
$myFiles = '';
}
$links .= $myFiles;
$links .= '</ul>';
$html .= Display::panelCollapse(get_lang('SocialNetwork'), $links, 'social-network-menu', null, 'sn-sidebar', 'sn-sidebar-collapse');
}
if (in_array($show, $show_groups) && !empty($group_id)) {
$html .= $usergroup->show_group_column_information($group_id, api_get_user_id(), $show);
}
if ($show == 'shared_profile') {
$links = '<ul class="nav nav-pills nav-stacked">';
// My own profile
if ($show_full_profile && $user_id == intval(api_get_user_id())) {
$links .= '
<li class="home-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
' . $homeIcon . ' ' . get_lang('Home') . '
</a>
</li>
<li class="messages-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
</a>
</li>';
$active = $show == 'invitations' ? 'active' : null;
$links .= '
<li class="invitations-icon' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
</a>
</li>';
$links .= '
<li class="shared-profile-icon active">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
</a>
</li>
<li class="friends-icon">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
' . $friendsIcon . ' ' . get_lang('Friends') . '
示例3: show_social_menu
/**
* Shows the right menu of the Social Network tool
*
* @param string $show highlight link possible values:
* group_add,
* home,
* messages,
* messages_inbox,
* messages_compose ,
* messages_outbox,
* invitations,
* shared_profile,
* friends,
* groups search
* @param int $group_id group id
* @param int $user_id user id
* @param bool $show_full_profile show profile or not (show or hide the user image/information)
* @param bool $show_delete_account_button
*
*/
public static function show_social_menu($show = '', $group_id = 0, $user_id = 0, $show_full_profile = false, $show_delete_account_button = false)
{
if (empty($user_id)) {
$user_id = api_get_user_id();
}
$usergroup = new UserGroup();
$user_info = api_get_user_info($user_id, true);
$current_user_id = api_get_user_id();
$current_user_info = api_get_user_info($current_user_id, true);
if ($current_user_id == $user_id) {
$user_friend_relation = null;
} else {
$user_friend_relation = SocialManager::get_relation_between_contacts($current_user_id, $user_id);
}
$show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups');
// get count unread message and total invitations
$count_unread_message = MessageManager::get_number_of_messages(true);
$count_unread_message = !empty($count_unread_message) ? Display::badge($count_unread_message) : null;
$number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
$group_pending_invitations = $usergroup->get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION, false);
$group_pending_invitations = count($group_pending_invitations);
$total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
$total_invitations = !empty($total_invitations) ? Display::badge($total_invitations) : '';
$html = '';
$active = null;
if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends'))) {
$html .= '<div class="panel panel-default sidebar-nav">';
$html .= '<div class="panel-body">';
$html .= '<ul class="nav nav-pills nav-stacked">';
$active = $show == 'home' ? 'active' : null;
$html .= '<li class="home-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">' . Display::return_icon('social-home.png', get_lang('Home'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Home') . '</a></li>';
$active = $show == 'messages' ? 'active' : null;
$html .= '<li class="messages-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">' . Display::return_icon('social-message.png', get_lang('Messages'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Messages') . $count_unread_message . '</a></li>';
//Invitations
$active = $show == 'invitations' ? 'active' : null;
$html .= '<li class="invitations-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">' . Display::return_icon('social-invitations.png', get_lang('Invitations'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Invitations') . $total_invitations . '</a></li>';
//Shared profile and groups
$active = $show == 'shared_profile' ? 'active' : null;
$html .= '<li class="shared-profile-icon' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">' . Display::return_icon('social-profile.png', get_lang('ViewMySharedProfile'), '', ICON_SIZE_SMALL) . ' ' . get_lang('ViewMySharedProfile') . '</a></li>';
$active = $show == 'friends' ? 'active' : null;
$html .= '<li class="friends-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">' . Display::return_icon('social-friends.png', get_lang('Friends'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Friends') . '</a></li>';
$active = $show == 'browse_groups' ? 'active' : null;
$html .= '<li class="browse-groups-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">' . Display::return_icon('social-groups.png', get_lang('SocialGroups'), '', ICON_SIZE_SMALL) . ' ' . get_lang('SocialGroups') . '</a></li>';
//Search users
$active = $show == 'search' ? 'active' : null;
$html .= '<li class="search-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">' . Display::return_icon('social-search.png', get_lang('Search'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Search') . '</a></li>';
//My files
$active = $show == 'myfiles' ? 'active' : null;
$html .= '<li class="myfiles-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">' . Display::return_icon('social-files.png', get_lang('MyFiles'), '', ICON_SIZE_SMALL) . ' ' . get_lang('MyFiles') . '</span></a></li>';
$html .= '</ul></div></div>';
}
if (in_array($show, $show_groups) && !empty($group_id)) {
$html .= $usergroup->show_group_column_information($group_id, api_get_user_id(), $show);
}
if ($show == 'shared_profile') {
$html .= '<div class="panel panel-default sidebar-nav">';
$html .= '<div class="panel-body">';
$html .= '<ul class="nav nav-pills nav-stacked">';
// My own profile
if ($show_full_profile && $user_id == intval(api_get_user_id())) {
$html .= '<li class="home-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">' . Display::return_icon('social-home.png', get_lang('Home'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Home') . '</a></li>
<li class="messages-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">' . Display::return_icon('social-message.png', get_lang('Messages'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Messages') . $count_unread_message . '</a></li>';
$active = $show == 'invitations' ? 'active' : null;
$html .= '<li class="invitations-icon' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">' . Display::return_icon('social-invitations.png', get_lang('Invitations'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Invitations') . $total_invitations . '</a></li>';
$html .= '<li class="shared-profile-icon active"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">' . Display::return_icon('social-profile.png', get_lang('ViewMySharedProfile'), '', ICON_SIZE_SMALL) . ' ' . get_lang('ViewMySharedProfile') . '</a></li>
<li class="friends-icon"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">' . Display::return_icon('social-friends.png', get_lang('Friends'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Friends') . '</a></li>
<li class="browse-groups-icon"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">' . Display::return_icon('social-groups.png', get_lang('SocialGroups'), '', ICON_SIZE_SMALL) . ' ' . get_lang('SocialGroups') . '</a></li>';
$active = $show == 'search' ? 'active' : null;
$html .= '<li class="search-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">' . Display::return_icon('social-search.png', get_lang('Search'), '', ICON_SIZE_SMALL) . ' ' . get_lang('Search') . '</a></li>';
$active = $show == 'myfiles' ? 'active' : null;
$html .= '<li class="myfiles-icon ' . $active . '"><a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">' . Display::return_icon('social-files.png', get_lang('MyFiles'), '', ICON_SIZE_SMALL) . ' ' . get_lang('MyFiles') . '</a></li>';
}
// My friend profile.
if ($user_id != api_get_user_id()) {
$html .= '<li><a href="#" class="btn-to-send-message" data-send-to="' . $user_id . '" title="' . get_lang('SendMessage') . '">';
$html .= Display::return_icon('compose_message.png', get_lang('SendMessage')) . ' ' . get_lang('SendMessage') . '</a></li>';
}
// Check if I already sent an invitation message
$invitation_sent_list = SocialManager::get_list_invitation_sent_by_user_id(api_get_user_id());
if (isset($invitation_sent_list[$user_id]) && is_array($invitation_sent_list[$user_id]) && count($invitation_sent_list[$user_id]) > 0) {
//.........这里部分代码省略.........