当前位置: 首页>>代码示例>>PHP>>正文


PHP SocialManager::get_list_invitation_sent_by_user_id方法代码示例

本文整理汇总了PHP中SocialManager::get_list_invitation_sent_by_user_id方法的典型用法代码示例。如果您正苦于以下问题:PHP SocialManager::get_list_invitation_sent_by_user_id方法的具体用法?PHP SocialManager::get_list_invitation_sent_by_user_id怎么用?PHP SocialManager::get_list_invitation_sent_by_user_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocialManager的用法示例。


在下文中一共展示了SocialManager::get_list_invitation_sent_by_user_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: api_get_user_id

                    $show_message = Display::return_message(get_lang('UserIsNotSubscribedToThisGroup'), 'warning');
                }
                break 2;
            case 'deny':
                // delete invitation
                $usergroup->delete_user_rel_group(api_get_user_id(), $value);
                $show_message = Display::return_message(get_lang('GroupInvitationWasDeny'));
                break 2;
        }
    }
}
$social_left_content = SocialManager::show_social_menu('invitations');
$social_right_content = '<div id="id_response" align="center"></div>';
$user_id = api_get_user_id();
$list_get_invitation = SocialManager::get_list_invitation_of_friends_by_user_id($user_id);
$list_get_invitation_sent = SocialManager::get_list_invitation_sent_by_user_id($user_id);
$pending_invitations = $usergroup->get_groups_by_user($user_id, GROUP_USER_PERMISSION_PENDING_INVITATION);
$number_loop = count($list_get_invitation);
$total_invitations = $number_loop + count($list_get_invitation_sent) + count($pending_invitations);
if ($total_invitations == 0 && count($_GET) <= 0) {
    $social_right_content .= '<div class="span8"><a class="btn" href="search.php">' . get_lang('TryAndFindSomeFriends') . '</a></div>';
}
if ($number_loop != 0) {
    $social_right_content .= '<div class="span8">' . Display::page_subheader(get_lang('InvitationReceived')) . '</div>';
    foreach ($list_get_invitation as $invitation) {
        $sender_user_id = $invitation['user_sender_id'];
        $userInfo = api_get_user_info($sender_user_id);
        $social_right_content .= '<div id="id_' . $sender_user_id . '" class="invitation_confirm span8">';
        $picture = UserManager::get_user_picture_path_by_id($sender_user_id, 'web', false, true);
        $friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92);
        $title = Security::remove_XSS($invitation['title'], STUDENT, true);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:invitations.php

示例2: show_social_menu


//.........这里部分代码省略.........
         $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') {
                 $html .= '<li><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>';
                 $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>';
             }
             $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('style' => 'float:left')) . '' . get_lang('ViewMySharedProfile') . '</a></li>
                       <li><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>
                       <li><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>';
             $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>';
         }
         // My friend profile
         if (api_get_setting('allow_message_tool') == 'true') {
             if ($user_id != api_get_user_id()) {
                 $html .= '<li><a href="javascript:void(0);" onclick="javascript:send_message_to_user(\'' . $user_id . '\');" title="' . get_lang('SendMessage') . '">';
                 $html .= Display::return_icon('compose_message.png', get_lang('SendMessage')) . '&nbsp;&nbsp;' . 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) {
                 $html .= '<li><a href="' . api_get_path(WEB_PATH) . 'main/social/invitations.php">' . Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')) . '&nbsp;&nbsp;' . get_lang('YouAlreadySentAnInvitation') . '</a></li>';
             } else {
                 if (!$show_full_profile) {
                     $html .= '<li><a  href="javascript:void(0);" onclick="javascript:send_invitation_to_user(\'' . $user_id . '\');" title="' . get_lang('SendInvitation') . '">' . Display::return_icon('invitation.png', get_lang('SocialInvitationToFriends')) . '&nbsp;' . get_lang('SendInvitation') . '</a></li>';
                 }
             }
         }
         //@todo check if user is online and if it's a friend to show the chat link
         if (api_is_global_chat_enabled()) {
             $user_name = $user_info['complete_name'];
             if ($user_friend_relation == USER_RELATION_TYPE_FRIEND) {
                 if ($user_id != api_get_user_id()) {
                     //Only show chat if I'm available to talk
                     if ($current_user_info['user_is_online_in_chat'] == 1) {
                         $options = array('onclick' => "javascript:chatWith('" . $user_id . "', '" . Security::remove_XSS($user_name) . "', '" . $user_info['user_is_online_in_chat'] . "')");
                         $chat_icon = $user_info['user_is_online_in_chat'] ? Display::return_icon('online.png', get_lang('Online')) : Display::return_icon('offline.png', get_lang('Offline'));
                         $html .= Display::tag('li', Display::url($chat_icon . '&nbsp;&nbsp;' . get_lang('Chat'), 'javascript:void(0);', $options));
                     }
                 }
             } else {
                 // Do something?
                 if ($user_id != api_get_user_id()) {
                     if ($current_user_info['user_is_online_in_chat'] == 1) {
                         $message = Security::remove_XSS(sprintf(get_lang("YouHaveToAddXAsAFriendFirst"), $user_name));
                         $options = array('onclick' => "javascript:chatNotYetWith('" . $message . "')");
                         $chat_icon = $user_info['user_is_online_in_chat'] ? Display::return_icon('online.png', get_lang('Online')) : Display::return_icon('offline.png', get_lang('Offline'));
                         $html .= Display::tag('li', Display::url($chat_icon . '&nbsp;&nbsp;' . get_lang('Chat'), 'javascript:void(0);', $options));
                     }
                 }
             }
         }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:67,代码来源:social.lib.php

示例3: show_social_menu


//.........这里部分代码省略.........
                     </a>
                 </li>
                 <li class="friends-icon">
                     <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
                         ' . $friendsIcon . ' ' . get_lang('Friends') . '
                     </a>
                 </li>
                 <li class="browse-groups-icon">
                     <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
                         ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
                     </a>
                 </li>';
             $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>';
             $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;
         }
         // My friend profile.
         if ($user_id != api_get_user_id()) {
             $sendMessageText = get_lang('SendMessage');
             $sendMessageIcon = Display::return_icon('new-message.png', $sendMessageText);
             $sendMesssageUrl = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?' . http_build_query(['a' => 'get_user_popup', 'user_id' => $user_id]);
             $links .= '<li>';
             $links .= Display::url("{$sendMessageIcon} {$sendMessageText}", $sendMesssageUrl, ['class' => 'ajax', 'title' => $sendMessageText, 'data-title' => $sendMessageText]);
             $links .= '</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) {
             $links .= '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">' . Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')) . '&nbsp;&nbsp;' . get_lang('YouAlreadySentAnInvitation') . '</a></li>';
         } else {
             if (!$show_full_profile) {
                 $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="' . get_lang('SendInvitation') . '">' . Display::return_icon('invitation.png', get_lang('SocialInvitationToFriends')) . '&nbsp;' . get_lang('SendInvitation') . '</a></li>';
             }
         }
         $links .= '</ul>';
         $html .= Display::panelCollapse(get_lang('SocialNetwork'), $links, 'social-network-menu', null, 'sn-sidebar', 'sn-sidebar-collapse');
         if ($show_full_profile && $user_id == intval(api_get_user_id())) {
             $personal_course_list = UserManager::get_personal_session_course_list($user_id);
             $course_list_code = array();
             $i = 1;
             if (is_array($personal_course_list)) {
                 foreach ($personal_course_list as $my_course) {
                     if ($i <= 10) {
                         $course_list_code[] = array('code' => $my_course['code']);
                     } else {
                         break;
                     }
                     $i++;
                 }
                 // To avoid repeated courses
                 $course_list_code = ArrayClass::array_unique_dimensional($course_list_code);
             }
             // Announcements
             $my_announcement_by_user_id = intval($user_id);
             $announcements = array();
             foreach ($course_list_code as $course) {
                 $course_info = api_get_course_info($course['code']);
                 if (!empty($course_info)) {
                     $content = AnnouncementManager::get_all_annoucement_by_user_course($course_info['code'], $my_announcement_by_user_id);
                     if (!empty($content)) {
                         $url = Display::url(Display::return_icon('announcement.png', get_lang('Announcements')) . $course_info['name'] . ' (' . $content['count'] . ')', api_get_path(WEB_CODE_PATH) . 'announcements/announcements.php?cidReq=' . $course['code']);
                         $announcements[] = Display::tag('li', $url);
                     }
                 }
             }
             if (!empty($announcements)) {
                 $html .= '<div class="social_menu_items">';
                 $html .= '<ul>';
                 foreach ($announcements as $announcement) {
                     $html .= $announcement;
                 }
                 $html .= '</ul>';
                 $html .= '</div>';
             }
         }
     }
     if ($show_delete_account_button) {
         $html .= '<div class="sidebar-nav"><ul><li>';
         $url = api_get_path(WEB_CODE_PATH) . 'auth/unsubscribe_account.php';
         $html .= Display::url(Display::return_icon('delete.png', get_lang('Unsubscribe'), array(), ICON_SIZE_TINY) . get_lang('Unsubscribe'), $url);
         $html .= '</li></ul></div>';
     }
     $html .= '';
     return $html;
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:101,代码来源:social.lib.php

示例4: 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')) . '&nbsp;&nbsp;' . 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) {
//.........这里部分代码省略.........
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:101,代码来源:social.lib.php


注:本文中的SocialManager::get_list_invitation_sent_by_user_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。