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


PHP SocialManager类代码示例

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


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

示例1: get_lang

     $friend_html .= '<div id="friend-container" class="social-friend-container">';
     $friend_html .= '<div id="friend-header" >';
     if ($number_friends == 1) {
         $friend_html .= '<div style="float:left;width:80%">' . $number_friends . ' ' . get_lang('Friend') . '</div>';
     } else {
         $friend_html .= '<div style="float:left;width:80%">' . $number_friends . ' ' . get_lang('Friends') . '</div>';
     }
     $friend_html .= '</div>';
     // close div friend-header
     for ($k = 0; $k < $number_friends; $k++) {
         if (isset($friends[$k])) {
             $friend = $friends[$k];
             $name_user = api_get_person_name($friend['firstName'], $friend['lastName']);
             $friend_html .= '<div id=div_' . $friend['friend_user_id'] . ' class="image_friend_network" ><span><center>';
             // the height = 92 must be the sqme in the image_friend_network span style in default.css
             $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92, USER_IMAGE_SIZE_MEDIUM, 'width="85" height="90" ');
             $friend_html .= '<a href="' . $friend['user_info']['profile_url'] . '">';
             $friend_html .= '<img src="' . $friends_profile['file'] . '" ' . $friends_profile['style'] . ' id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $name_user . '" />';
             $friend_html .= '</center></span>';
             $friend_html .= '<center class="friend">' . $name_user . '</a></center>';
             $friend_html .= '</div>';
         }
     }
     echo $friend_html;
     echo '</div>';
 } else {
     $usergroup = new UserGroup();
     // show all groups by user_id
     // MY GROUPS
     $results = $usergroup->get_groups_by_user($user_id, 0);
     $grid_my_groups = array();
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:profile_friends_and_groups.inc.php

示例2: set_header_parameters


//.........这里部分代码省略.........
		        						<img src="'.api_get_path(WEB_IMG_PATH).'bug.large.png" style="vertical-align: middle;" alt="'.get_lang('ReportABug').'" title="'.get_lang(
                    'ReportABug'
                ).'"/></a>
		    						  </li>';
        }

        $this->assign('bug_notification_link', $bug_notification_link);

        $notification = return_notification_menu();
        $this->assign('notification_menu', $notification);

        //Preparing values for the menu

        //Logout link
        if (isset($_configuration['hide_logout_button']) && $_configuration['hide_logout_button'] == 'true') {
            $this->assign('logout_link', null);
        } else {
            $this->assign('logout_link', api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id());
        }

        //Profile link
        if (api_get_setting('allow_social_tool') == 'true') {
            $profile_url  = api_get_path(WEB_CODE_PATH).'social/home.php';
            $profile_link = Display::url(get_lang('Profile'), $profile_url);
        } else {
            $profile_url  = api_get_path(WEB_CODE_PATH).'auth/profile.php';
            $profile_link = Display::url(get_lang('Profile'), $profile_url);
        }
        $this->assign('profile_link', $profile_link);
        $this->assign('profile_url', $profile_url);

        //Message link
        $message_link = null;
        $message_url  = null;
        if (api_get_setting('allow_message_tool') == 'true') {
            $message_url  = api_get_path(WEB_CODE_PATH).'messages/inbox.php';
            $message_link = '<a href="'.api_get_path(WEB_CODE_PATH).'messages/inbox.php">'.get_lang('Inbox').'</a>';
        }
        $this->assign('message_link', $message_link);
        $this->assign('message_url', $message_url);

        $institution = api_get_setting('Institution');
        $portal_name = empty($institution) ? api_get_setting('siteName') : $institution;

        $this->assign('portal_name', $portal_name);

        //Menu
        $menu = return_menu();
        $this->assign('menu', $menu);

        //Setting notifications


        $count_unread_message = 0;
        if (api_get_setting('allow_message_tool') == 'true') {
            // get count unread message and total invitations
            $count_unread_message = MessageManager::get_number_of_messages(true);
        }

        $total_invitations = 0;
        if (api_get_setting('allow_social_tool') == 'true') {
            $number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(
                api_get_user_id()
            );
            $group_pending_invitations        = GroupPortalManager::get_groups_by_user(
                api_get_user_id(),
                GROUP_USER_PERMISSION_PENDING_INVITATION,
                false
            );
            $group_pending_invitations        = 0;
            if (!empty($group_pending_invitations)) {
                $group_pending_invitations = count($group_pending_invitations);
            }
            $total_invitations = intval($number_of_new_messages_of_friend) + $group_pending_invitations + intval(
                    $count_unread_message
                );
        }
        $total_invitations = (!empty($total_invitations) ? Display::badge($total_invitations) : null);

        $this->assign('user_notifications', $total_invitations);


        //Breadcrumb
        $breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools);
        $this->assign('breadcrumb', $breadcrumb);

        //Extra content
        $extra_header = null;
        if (!api_is_platform_admin()) {
            $extra_header = trim(api_get_setting('header_extra_content'));
        }
        $this->assign('header_extra_content', $extra_header);

        //if ($this->show_header == 1) {
            header('Content-Type: text/html; charset='.api_get_system_encoding());
            header(
                'X-Powered-By: '.$_configuration['software_name'].' '.substr($_configuration['system_version'], 0, 1)
            );
        //}
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:101,代码来源:template.lib.php

示例3: isset

            if (!isset($_POST['group_id'])) {
                $default['users'] = isset($_POST['users']) ? $_POST['users'] : null;
            } else {
                $default['group_id'] = $_POST['group_id'];
            }
            if (isset($_POST['hidden_user'])) {
                $default['users'] = array($_POST['hidden_user']);
            }
            $social_right_content .= manage_form($default);
        } else {
            $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'), 'error');
        }
    }
}
if (api_get_setting('social.allow_social_tool') == 'true') {
    $social_right_content .= '</div>';
    $social_right_content .= '</div>';
}
//$tpl = new Template(get_lang('ComposeMessage'));
$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'messages');
if (api_get_setting('social.allow_social_tool') == 'true') {
    $tpl->addGlobal('social_menu_block', $social_menu_block);
    $tpl->addGlobal('social_right_content', $social_right_content);
    echo $tpl->render('@template_style/social/inbox.html.twig');
} else {
    $content = $social_right_content;
    echo $actions;
    echo $content;
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:new_message.php

示例4: isset

     $messageContent = isset($_REQUEST['content']) ? trim($_REQUEST['content']) : null;
     if (empty($subject) || empty($messageContent)) {
         echo Display::display_error_message(get_lang('ErrorSendingMessage'));
         exit;
     }
     $result = MessageManager::send_message($_REQUEST['user_id'], $subject, $messageContent);
     if ($result) {
         echo Display::display_confirmation_message(get_lang('MessageHasBeenSent'));
     } else {
         echo Display::display_error_message(get_lang('ErrorSendingMessage'));
     }
     break;
 case 'send_invitation':
     $subject = isset($_REQUEST['subject']) ? trim($_REQUEST['subject']) : null;
     $invitationContent = isset($_REQUEST['content']) ? trim($_REQUEST['content']) : null;
     SocialManager::send_invitation_friend_user($_REQUEST['user_id'], $subject, $invitationContent);
     break;
 case 'find_users':
     if (api_is_anonymous()) {
         echo '';
         break;
     }
     $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
     $tbl_my_user = Database::get_main_table(TABLE_MAIN_USER);
     $tbl_my_user_friend = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
     $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
     $tbl_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
     $search = Database::escape_string($_REQUEST['q']);
     $access_url_id = api_get_multiple_access_url() == 'true' ? api_get_current_access_url_id() : 1;
     $user_id = api_get_user_id();
     $is_western_name_order = api_is_western_name_order();
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:message.ajax.php

示例5: isset

        if (!isset($_GET['id'])) {
            if (api_get_setting('allow_social_tool') == 'true') {
                if (!api_is_anonymous()) {
                    $query = isset($_GET['q']) ? $_GET['q'] : null;
                    $social_right_content .= '<div class="span9">' . UserManager::get_search_form($query) . '</div>';
                }
            }
            $social_right_content .= SocialManager::display_user_list($user_list);
        }
    }
    if (isset($_GET['id'])) {
        if (api_get_setting('allow_social_tool') == 'true') {
            header("Location: " . api_get_path(WEB_CODE_PATH) . "social/profile.php?u=" . intval($_GET['id']));
            exit;
        } else {
            SocialManager::display_individual_user($_GET['id']);
        }
    }
} else {
    api_not_allowed();
    exit;
}
$app['title'] = get_lang('UsersOnLineList');
$tpl = $app['template'];
if (api_get_setting('allow_social_tool') == 'true' && !api_is_anonymous()) {
    $tpl->setHelp('Groups');
    $tpl->assign('social_left_content', $social_left_content);
    $tpl->assign('social_right_content', $social_right_content);
    $social_layout = $tpl->get_template('layout/social_layout.tpl');
    $tpl->display($social_layout);
} else {
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:whoisonline.php

示例6: array

    if (count($grid_newest_groups) > 0) {
        $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation' => true, 'per_page' => 100), $query_vars, false, array(true, true, true, false));
    }
    if (count($grid_pop_groups) > 0) {
        $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation' => true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true));
    }
}
if (!empty($create_group_item)) {
    $social_right_content .= Display::page_subheader($create_group_item);
}
$headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups'));
$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse');
$show_message = null;
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'topic_deleted') {
    $show_message = Display::return_message(get_lang('Deleted'), 'success');
}
$tpl = new Template(null);
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, $user_id, $show_menu);
$show_menu = 'browse_groups';
if (isset($_GET['view']) && $_GET['view'] == 'mygroups') {
    $show_menu = $_GET['view'];
}
$social_menu_block = SocialManager::show_social_menu($show_menu);
$templateName = 'social/groups.tpl';
$tpl->setHelp('Groups');
$tpl->assign('message', $show_message);
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template($templateName);
$tpl->display($social_layout);
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:groups.php

示例7: delete_user


//.........这里部分代码省略.........
     }
     $table_user = Database::get_main_table(TABLE_MAIN_USER);
     $usergroup_rel_user = Database::get_main_table(TABLE_USERGROUP_REL_USER);
     $table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
     $table_course = Database::get_main_table(TABLE_MAIN_COURSE);
     $table_session = Database::get_main_table(TABLE_MAIN_SESSION);
     $table_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
     $table_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
     $table_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
     $table_group = Database::get_course_table(TABLE_GROUP_USER);
     $table_work = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
     // Unsubscribe the user from all groups in all his courses
     $sql = "SELECT c.id FROM {$table_course} c, {$table_course_user} cu\n                WHERE\n                    cu.user_id = '" . $user_id . "' AND\n                    relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND\n                    c.id = cu.c_id";
     $res = Database::query($sql);
     while ($course = Database::fetch_object($res)) {
         $sql = "DELETE FROM {$table_group}\n                    WHERE c_id = {$course->id} AND user_id = {$user_id}";
         Database::query($sql);
     }
     // Unsubscribe user from all classes
     //Classes are not longer supported
     /* $sql = "DELETE FROM $table_class_user WHERE user_id = '".$user_id."'";
        Database::query($sql); */
     // Unsubscribe user from usergroup_rel_user
     $sql = "DELETE FROM {$usergroup_rel_user} WHERE user_id = '" . $user_id . "'";
     Database::query($sql);
     // Unsubscribe user from all courses
     $sql = "DELETE FROM {$table_course_user} WHERE user_id = '" . $user_id . "'";
     Database::query($sql);
     // Unsubscribe user from all courses in sessions
     $sql = "DELETE FROM {$table_session_course_user} WHERE user_id = '" . $user_id . "'";
     Database::query($sql);
     // If the user was added as a id_coach then set the current admin as coach see BT#
     $currentUserId = api_get_user_id();
     $sql = "UPDATE {$table_session} SET id_coach = {$currentUserId}  WHERE id_coach = '" . $user_id . "'";
     Database::query($sql);
     $sql = "UPDATE {$table_session} SET id_coach = {$currentUserId}  WHERE session_admin_id = '" . $user_id . "'";
     Database::query($sql);
     // Unsubscribe user from all sessions
     $sql = "DELETE FROM {$table_session_user} WHERE user_id = '" . $user_id . "'";
     Database::query($sql);
     // Delete user picture
     /* TODO: Logic about api_get_setting('split_users_upload_directory') == 'true'
        a user has 4 different sized photos to be deleted. */
     $user_info = api_get_user_info($user_id);
     if (strlen($user_info['picture_uri']) > 0) {
         $path = self::getUserPathById($user_id, 'system');
         $img_path = $path . $user_info['picture_uri'];
         if (file_exists($img_path)) {
             unlink($img_path);
         }
     }
     // Delete the personal course categories
     $course_cat_table = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
     $sql = "DELETE FROM {$course_cat_table} WHERE user_id = '" . $user_id . "'";
     Database::query($sql);
     // Delete user from database
     $sql = "DELETE FROM {$table_user} WHERE id = '" . $user_id . "'";
     Database::query($sql);
     // Delete user from the admin table
     $sql = "DELETE FROM {$table_admin} WHERE user_id = '" . $user_id . "'";
     Database::query($sql);
     // Delete the personal agenda-items from this user
     $agenda_table = Database::get_main_table(TABLE_PERSONAL_AGENDA);
     $sql = "DELETE FROM {$agenda_table} WHERE user = '" . $user_id . "'";
     Database::query($sql);
     $gradebook_results_table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
     $sql = 'DELETE FROM ' . $gradebook_results_table . ' WHERE user_id = ' . $user_id;
     Database::query($sql);
     $extraFieldValue = new ExtraFieldValue('user');
     $extraFieldValue->deleteValuesByItem($user_id);
     if (api_get_multiple_access_url()) {
         $url_id = api_get_current_access_url_id();
         UrlManager::delete_url_rel_user($user_id, $url_id);
     } else {
         //we delete the user from the url_id =1
         UrlManager::delete_url_rel_user($user_id, 1);
     }
     if (api_get_setting('allow_social_tool') == 'true') {
         $userGroup = new UserGroup();
         //Delete user from portal groups
         $group_list = $userGroup->get_groups_by_user($user_id);
         if (!empty($group_list)) {
             foreach ($group_list as $group_id => $data) {
                 $userGroup->delete_user_rel_group($user_id, $group_id);
             }
         }
         // Delete user from friend lists
         SocialManager::remove_user_rel_user($user_id, true);
     }
     // Removing survey invitation
     SurveyManager::delete_all_survey_invitations_by_user($user_id);
     // Delete students works
     $sql = "DELETE FROM {$table_work} WHERE user_id = {$user_id} AND c_id <> 0";
     Database::query($sql);
     // Add event to system log
     $user_id_manager = api_get_user_id();
     Event::addEvent(LOG_USER_DELETE, LOG_USER_ID, $user_id, api_get_utc_datetime(), $user_id_manager);
     Event::addEvent(LOG_USER_DELETE, LOG_USER_OBJECT, $user_info, api_get_utc_datetime(), $user_id_manager);
     return true;
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:101,代码来源:usermanager.lib.php

示例8: switch

/* For licensing terms, see /license.txt */
//require_once '../global.inc.php';
$action = $_GET['a'];
switch ($action) {
    case 'load_online_user':
        if (isset($_SESSION['who_is_online_counter'])) {
            $_SESSION['who_is_online_counter']++;
        } else {
            $_SESSION['who_is_online_counter'] = 2;
        }
        $images_to_show = 9;
        $page = intval($_REQUEST['online_page_nr']);
        $max_page = ceil(UserManager::whoIsOnlineCount() / $images_to_show);
        $page_rows = ($page - 1) * 9;
        if (!empty($max_page) && $page <= $max_page) {
            if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) {
                $user_list = who_is_online_in_this_course($page_rows, $images_to_show, api_get_user_id(), api_get_setting('display.time_limit_whosonline'), $_GET['cidReq']);
            } else {
                $user_list = UserManager::whoIsOnline($page_rows, $images_to_show);
            }
            if (!empty($user_list)) {
                echo SocialManager::display_user_list($user_list, false);
                exit;
            }
        }
        echo 'end';
        break;
    default:
        break;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:30,代码来源:online.ajax.php

示例9: isset

        }
        $show = isset($_GET['show']) ? '&amp;show=' . Security::remove_XSS($_GET['show']) : '';
        if (isset($_GET['type']) && $_GET['type'] == 'extended') {
            $actions .= '<a href="profile.php?type=reduced' . $show . '">' . Display::return_icon('edit.png', get_lang('EditNormalProfile'), '', 16) . '</a>';
        } else {
            $actions .= '<a href="profile.php?type=extended' . $show . '">' . Display::return_icon('edit.png', get_lang('EditExtendProfile'), '', 16) . '</a>';
        }
        $actions .= '</div>';
    }
}
$show_delete_account_button = api_get_setting('platform_unsubscribe_allowed') == 'true' ? true : false;
$tpl = new Template(get_lang('ModifyProfile'));
$tpl->assign('actions', $actions);
SocialManager::setSocialUserBlock($tpl, $user_id, 'messages');
if (api_get_setting('social.allow_social_tool') == 'true') {
    SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'home');
    $menu = SocialManager::show_social_menu('home', null, api_get_user_id(), false, $show_delete_account_button);
    $tpl->assign('social_menu_block', $menu);
    $tpl->assign('social_right_content', $form->returnForm());
    $social_layout = $tpl->get_template('social/edit_profile.tpl');
    $tpl->display($social_layout);
} else {
    $bigImage = UserManager::getUserPicture(api_get_user_id(), USER_IMAGE_SIZE_BIG);
    $normalImage = UserManager::getUserPicture(api_get_user_id(), USER_IMAGE_SIZE_ORIGINAL);
    $imageToShow = '<div id="image-message-container">';
    $imageToShow .= '<a class="expand-image" href="' . $bigImage . '" /><img src="' . $normalImage . '"></a>';
    $imageToShow .= '</div>';
    $content = $imageToShow . $form->returnForm();
    $tpl->assign('content', $content);
    $tpl->display_one_col_template();
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php

示例10: api_not_allowed

<?php

/* For licensing terms, see /license.txt */
require_once '../../../global.inc.php';
if (api_is_anonymous()) {
    api_not_allowed(true);
}
$roomName = isset($_GET['room']) ? $_GET['room'] : null;
$room = VideoChat::getChatRoomByName($roomName);
if ($room === false) {
    Header::location(api_get_path(WEB_PATH));
}
$friend_html = SocialManager::listMyFriendsBlock($user_id, $link_shared, $show_full_profile);
$isSender = $room['from_user'] == api_get_user_id();
$isReceiver = $room['to_user'] == api_get_user_id();
if (!$isSender && !$isReceiver) {
    Header::location(api_get_path(WEB_PATH));
}
if ($isSender) {
    $chatUser = api_get_user_info($room['to_user']);
} elseif ($isReceiver) {
    $chatUser = api_get_user_info($room['from_user']);
}
$idUserLocal = api_get_user_id();
$userLocal = api_get_user_info($idUserLocal, true);
$htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_PATH) . 'web/assets/simplewebrtc/latest.js' . '"></script>' . "\n";
$template = new Template();
$template->assign('room', $room);
$template->assign('chat_user', $chatUser);
$template->assign('user_local', $userLocal);
$template->assign('block_friends', $friend_html);
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:video.php

示例11: return_profile_block

 /**
  * @return null|string|void
  */
 public function return_profile_block()
 {
     global $_configuration;
     $user_id = api_get_user_id();
     if (empty($user_id)) {
         return;
     }
     $userGroup = new UserGroup();
     $profile_content = '<ul class="nav nav-pills nav-stacked">';
     //  @todo Add a platform setting to add the user image.
     if (api_get_setting('message.allow_message_tool') == 'true') {
         // New messages.
         $number_of_new_messages = MessageManager::get_new_messages();
         // New contact invitations.
         $number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
         // New group invitations sent by a moderator.
         $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;
         $cant_msg = Display::badge($number_of_new_messages);
         $link = '';
         if (api_get_setting('social.allow_social_tool') == 'true') {
             $link = '?f=social';
         }
         $profile_content .= '<li class="inbox-message-social"><a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php' . $link . '">' . Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_SMALL) . get_lang('Inbox') . $cant_msg . ' </a></li>';
         $profile_content .= '<li class="new-message-social"><a href="' . api_get_path(WEB_PATH) . 'main/messages/new_message.php' . $link . '">' . Display::return_icon('new-message.png', get_lang('Compose'), null, ICON_SIZE_SMALL) . get_lang('Compose') . ' </a></li>';
         if (api_get_setting('social.allow_social_tool') == 'true') {
             $total_invitations = Display::badge($total_invitations);
             $profile_content .= '<li class="invitations-social"><a href="' . api_get_path(WEB_PATH) . 'main/social/invitations.php">' . Display::return_icon('invitations.png', get_lang('PendingInvitations'), null, ICON_SIZE_SMALL) . get_lang('PendingInvitations') . $total_invitations . '</a></li>';
         }
         if (isset($_configuration['allow_my_files_link_in_homepage']) && $_configuration['allow_my_files_link_in_homepage']) {
             $profile_content .= '<li class="myfiles-social"><a href="' . api_get_path(WEB_PATH) . 'main/social/myfiles.php">' . get_lang('MyFiles') . '</a></li>';
         }
     }
     $editProfileUrl = Display::getProfileEditionLink($user_id);
     $profile_content .= '<li class="profile-social"><a href="' . $editProfileUrl . '">' . Display::return_icon('edit-profile.png', get_lang('EditProfile'), null, ICON_SIZE_SMALL) . get_lang('EditProfile') . '</a></li>';
     $profile_content .= '</ul>';
     $html = self::show_right_block(get_lang('Profile'), $profile_content, 'profile_block', null, 'profile', 'profileCollapse');
     return $html;
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:43,代码来源:userportal.lib.php

示例12: getWallMessagesByUser

 /**
  * @param int $userId
  * @param int $friendId
  * @return string
  */
 public static function getWallMessagesByUser($userId, $friendId)
 {
     $messages = SocialManager::getWallMessagesPostHTML($userId, $friendId);
     $html = '';
     foreach ($messages as $message) {
         $post = $message['html'];
         $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $message['id']);
         $html .= $post . $comment;
     }
     return $html;
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:16,代码来源:social.lib.php

示例13: isset

                    echo '<div class="clear"></div><br />';
                }
                break;
            case 'unload_course':
                break;
            default:
                break;
        }
        break;
    case 'listWallMessage':
        $start = isset($_REQUEST['start']) ? intval($_REQUEST['start']) - 1 : 0;
        $length = isset($_REQUEST['length']) ? intval($_REQUEST['length']) : 10;
        $userId = isset($_REQUEST['u']) ? intval($_REQUEST['u']) : api_get_user_id();
        $friendId = $userId;
        $array = SocialManager::getWallMessagesPostHTML($userId, $friendId, null, $length, $start);
        if (!empty($array)) {
            ksort($array);
            $html = '';
            for ($i = 0; $i < count($array); $i++) {
                $post = $array[$i]['html'];
                $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']);
                $html .= '<div class="well_border">' . $post . $comment . '</div>';
            }
            $html .= Display::div(Display::url(get_lang('SeeMore'), api_get_self() . '?u=' . $userId . '&a=listWallMessage&start=' . ($start + $length + 1) . '&length=' . $length, array('class' => 'nextPage')), array('class' => 'next'));
            echo $html;
        }
        break;
    default:
        echo '';
}
exit;
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:social.ajax.php

示例14: api_not_allowed

} else {
    $id_message = $_GET['id'];
    $source = 'inbox';
    $show_menu = 'messages_inbox';
}
$message = '';
// LEFT COLUMN
if (api_get_setting('social.allow_social_tool') == 'true') {
    //Block Social Menu
    $social_menu_block = SocialManager::show_social_menu($show_menu);
}
//MAIN CONTENT
$message .= MessageManager::show_message_box($id_message, $source);
if (!empty($message)) {
    $social_right_content .= $message;
} else {
    api_not_allowed();
}
//$tpl = new Template(get_lang('View'));
$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), $show_menu);
if (api_get_setting('social.allow_social_tool') == 'true') {
    $tpl->addGlobal('social_menu_block', $social_menu_block);
    $tpl->addGlobal('social_right_content', $social_right_content);
    echo $tpl->render('@template_style/social/inbox.html.twig');
} else {
    $content = $social_right_content;
    echo $actions;
    echo $content;
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:view_message.php

示例15: set_header_parameters


//.........这里部分代码省略.........
            $resize .= '<a title="' . get_lang('ResetFontSize') . '" href="#" class="reset_font btn btn-default"><em class="fa fa-font"></em></a>';
            $resize .= '<a title="' . get_lang('IncreaseFontSize') . '" href="#" class="increase_font btn btn-default"><em class="fa fa-font"></em></a>';
            $resize .= '</div>';
            $resize .= '</div>';
        }
        $this->assign('accessibility', $resize);
        // Preparing values for the menu
        // Logout link
        $hideLogout = api_get_setting('hide_logout_button');
        if ($hideLogout === 'true') {
            $this->assign('logout_link', null);
        } else {
            $this->assign('logout_link', api_get_path(WEB_PATH) . 'index.php?logout=logout&uid=' . api_get_user_id());
        }
        //Profile link
        if (api_get_setting('social.allow_social_tool') == 'true') {
            $profile_url = api_get_path(WEB_CODE_PATH) . 'social/home.php';
            $profile_link = Display::url(get_lang('Profile'), $profile_url);
        } else {
            $profile_url = api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
            $profile_link = Display::url(get_lang('Profile'), $profile_url);
        }
        $this->assign('profile_link', $profile_link);
        $this->assign('profile_url', $profile_url);
        //Message link
        $message_link = null;
        $message_url = null;
        if (api_get_setting('message.allow_message_tool') == 'true') {
            $message_url = api_get_path(WEB_CODE_PATH) . 'messages/inbox.php';
            $message_link = '<a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php">' . get_lang('Inbox') . '</a>';
        }
        $this->assign('message_link', $message_link);
        $this->assign('message_url', $message_url);
        $institution = api_get_setting('platform.institution');
        $portal_name = empty($institution) ? api_get_setting('platform.site_name') : $institution;
        $this->assign('portal_name', $portal_name);
        //Menu
        $menu = return_menu();
        $this->assign('menu', $menu);
        // Setting notifications
        $count_unread_message = 0;
        if (api_get_setting('message.allow_message_tool') == 'true') {
            // get count unread message and total invitations
            $count_unread_message = MessageManager::get_number_of_messages(true);
        }
        $total_invitations = 0;
        if (api_get_setting('social.allow_social_tool') == 'true') {
            $number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
            $usergroup = new UserGroup();
            $group_pending_invitations = $usergroup->get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION, false);
            if (!empty($group_pending_invitations)) {
                $group_pending_invitations = count($group_pending_invitations);
            } else {
                $group_pending_invitations = 0;
            }
            $total_invitations = intval($number_of_new_messages_of_friend) + $group_pending_invitations + intval($count_unread_message);
        }
        $total_invitations = !empty($total_invitations) ? Display::badge($total_invitations) : null;
        $this->assign('user_notifications', $total_invitations);
        // Block Breadcrumb
        $breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools);
        $this->assign('breadcrumb', $breadcrumb);
        //Extra content
        $extra_header = null;
        if (!api_is_platform_admin()) {
            $extra_header = trim(api_get_setting('header_extra_content'));
        }
        $this->assign('header_extra_content', $extra_header);
        if ($sendHeaders) {
            header('Content-Type: text/html; charset=' . api_get_system_encoding());
            header('X-Powered-By: ' . $_configuration['software_name'] . ' ' . substr($_configuration['system_version'], 0, 1));
        }
        $socialMeta = '';
        $metaTitle = api_get_setting('meta_title');
        if (!empty($metaTitle)) {
            $socialMeta .= '<meta name="twitter:card" content="summary" />' . "\n";
            $socialMeta .= '<meta property="og:title" content="' . $metaTitle . '" />' . "\n";
            $socialMeta .= '<meta property="og:url" content="' . api_get_path(WEB_PATH) . '" />' . "\n";
            $metaDescription = api_get_setting('meta_description');
            if (!empty($metaDescription)) {
                $socialMeta .= '<meta property="og:description" content="' . $metaDescription . '" />' . "\n";
            }
            $metaSite = api_get_setting('meta_twitter_site');
            if (!empty($metaSite)) {
                $socialMeta .= '<meta name="twitter:site" content="' . $metaSite . '" />' . "\n";
                $metaCreator = api_get_setting('meta_twitter_creator');
                if (!empty($metaCreator)) {
                    $socialMeta .= '<meta name="twitter:creator" content="' . $metaCreator . '" />' . "\n";
                }
            }
            $metaImage = api_get_setting('meta_image_path');
            if (!empty($metaImage)) {
                if (is_file(api_get_path(SYS_PATH) . $metaImage)) {
                    $path = api_get_path(WEB_PATH) . $metaImage;
                    $socialMeta .= '<meta property="og:image" content="' . $path . '" />' . "\n";
                }
            }
        }
        $this->assign('social_meta', $socialMeta);
    }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:101,代码来源:template.lib.php


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