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


PHP SocialManager::show_social_avatar_block方法代码示例

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


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

示例1: api_not_allowed

    api_not_allowed();
}
$table_message = Database::get_main_table(TABLE_MESSAGE);
$usergroup = new UserGroup();
$form = new FormValidator('add_group');
$usergroup->setGroupType($usergroup::SOCIAL_CLASS);
$usergroup->setForm($form, 'add', array());
if ($form->validate()) {
    $values = $form->exportValues();
    $values['group_type'] = UserGroup::SOCIAL_CLASS;
    $values['relation_type'] = GROUP_USER_PERMISSION_ADMIN;
    $groupId = $usergroup->save($values);
    Display::addFlash(DIsplay::return_message(get_lang('GroupAdded')));
    header('Location: group_view.php?id=' . $groupId);
    exit;
}
$nameTools = get_lang('AddGroup');
$this_section = SECTION_SOCIAL;
$interbreadcrumb[] = array('url' => 'home.php', 'name' => get_lang('Social'));
$interbreadcrumb[] = array('url' => 'groups.php', 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => '#', 'name' => $nameTools);
$social_avatar_block = SocialManager::show_social_avatar_block('group_add');
$social_menu_block = SocialManager::show_social_menu('group_add');
$social_right_content = $form->returnForm();
$tpl = new Template(null);
SocialManager::setSocialUserBlock($tpl, $user_id, null, null);
$tpl->setHelp('Groups');
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('social/add_groups.tpl');
$tpl->display($social_layout);
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:group_add.php

示例2:

}
$create_thread_link = '';

if ($group_id != 0) {
    $social_avatar_block = SocialManager::show_social_avatar_block(
        'groups',
        $group_id
    );
    $social_menu_block = SocialManager::show_social_menu('groups', $group_id);
} else {
    $show_menu = 'browse_groups';
    if (isset($_GET['view']) && $_GET['view'] == 'mygroups') {
        $show_menu = $_GET['view'];
    }
    $social_avatar_block = SocialManager::show_social_avatar_block(
        $show_menu,
        $group_id
    );
    $social_menu_block = SocialManager::show_social_menu($show_menu, $group_id);
}

$social_right_content = null;

if ($group_id != 0) {

    $group_info = GroupPortalManager::get_group_data($group_id);

    //Loading group information
    if (isset($_GET['status']) && $_GET['status'] == 'sent') {
        $social_right_content .= Display::return_message(
            get_lang('MessageHasBeenSent'),
            'confirmation',
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:32,代码来源:groups.php

示例3: foreach

if (is_array($personal_course_list)) {
    foreach ($personal_course_list as $my_course) {
        if ($i<=10) {
            $list[] = SocialManager::get_logged_user_course_html($my_course, $i);
            $course_list_code[] = array('code'=> $my_course['code']);
        } else {
            break;
        }
        $i++;
    }
    //to avoid repeted courses
    $course_list_code = array_unique_dimensional($course_list_code);
}

$social_avatar_block = SocialManager::show_social_avatar_block('shared_profile', null, $user_id);
$social_menu_block = SocialManager::show_social_menu('shared_profile', null, $user_id, $show_full_profile);

//Setting some session info
$user_info = api_get_user_info($my_user_id);
$sessionList = SessionManager::getSessionsFollowedByUser($my_user_id, $user_info['status']);
$htmlSessionList = null;
foreach ($sessionList as $session) {
    $htmlSessionList .= '<div>';
    $htmlSessionList .= Display::return_icon('session.png', get_lang('Session'));
    $htmlSessionList .= $session['name'];
    $htmlSessionList .= '</div>';
}

// My friends
$friend_html = listMyFriends($user_id, $link_shared ,$show_full_profile);
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:30,代码来源:profile.php

示例4: setSocialUserBlock

 /**
  * Generate the social block for a user
  * @param Template $template
  * @param int $userId The user id
  * @param string $groupBlock Optional. Highlight link possible values:
  * group_add, home, messages, messages_inbox, messages_compose,
  * messages_outbox, invitations, shared_profile, friends, groups, search
  * @param int $groupId Optional. Group ID
  * @param boolean $show_full_profile - Optional. Shows the Full Profile or Not
  * @return string The HTML code with the social block
  */
 public static function setSocialUserBlock($template, $userId, $groupBlock = '', $groupId = 0, $show_full_profile = true)
 {
     if (api_get_setting('social.allow_social_tool') != 'true') {
         return '';
     }
     $socialAvatarBlock = SocialManager::show_social_avatar_block($groupBlock, $groupId, $userId);
     $profileEditionLink = null;
     if (api_get_user_id() == $userId) {
         $profileEditionLink = Display::getProfileEditionLink($userId);
     }
     $vCardUserLink = Display::getVCardUserLink($userId);
     $userInfo = api_get_user_info($userId, true, false, true, true);
     $template->addGlobal('user', $userInfo);
     $template->addGlobal('social_avatar_block', $socialAvatarBlock);
     $template->addGlobal('profile_edition_link', $profileEditionLink);
     //If not friend $show_full_profile is False and the user can't see Email Address and Vcard Download Link
     if ($show_full_profile) {
         //Added the link to export the vCard to the Template
         $template->addGlobal('vcard_user_link', $vCardUserLink);
     }
     if (api_get_setting('platform.gamification_mode') === '1') {
         $gamificationPoints = GamificationUtils::getTotalUserPoints($userId, $userInfo['status']);
         $template->addGlobal('gamification_points', $gamificationPoints);
     }
     $chatEnabled = api_is_global_chat_enabled();
     $template->addGlobal('chat_enabled', $chatEnabled);
     $templateName = $template->render('@template_style/social/user_block.html.twig');
     if (in_array($groupBlock, ['groups', 'group_edit', 'member_list'])) {
         $templateName = $template->render('@template_style/social/group_block.html.twig');
     }
     $template->addGlobal('social_avatar_block', $templateName);
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:43,代码来源:social.lib.php

示例5: setSocialUserBlock

 /**
  * Generate the social block for a user
  * @param Template $template
  * @param int $userId The user id
  * @param string $groupBlock Optional. Highlight link possible values:
  * group_add, home, messages, messages_inbox, messages_compose,
  * messages_outbox, invitations, shared_profile, friends, groups, search
  * @param int $groupId Optional. Group ID
  * @return string The HTML code with the social block
  */
 public static function setSocialUserBlock(Template $template, $userId, $groupBlock = '', $groupId = 0)
 {
     if (api_get_setting('allow_social_tool') != 'true') {
         return '';
     }
     $socialAvatarBlock = SocialManager::show_social_avatar_block($groupBlock, $groupId, $userId);
     $profileEditionLink = null;
     if (api_get_user_id() == $userId) {
         $profileEditionLink = Display::getProfileEditionLink($userId);
     }
     $vCardUserLink = Display::getVCardUserLink($userId);
     $userInfo = api_get_user_info($userId, true, false, true);
     $template->assign('user', $userInfo);
     $template->assign('social_avatar_block', $socialAvatarBlock);
     $template->assign('profile_edition_link', $profileEditionLink);
     //Added the link to export the vCard to the Template
     $template->assign('vcard_user_link', $vCardUserLink);
     if (api_get_setting('gamification_mode') === '1') {
         $gamificationPoints = GamificationUtils::getTotalUserPoints($userId, $userInfo['status']);
         $template->assign('gamification_points', $gamificationPoints);
     }
     $chatEnabled = api_is_global_chat_enabled();
     $template->assign('chat_enabled', $chatEnabled);
     $templateName = $template->get_template('social/user_block.tpl');
     if (in_array($groupBlock, ['groups', 'group_edit', 'member_list'])) {
         $templateName = $template->get_template('social/group_block.tpl');
     }
     $template->assign('social_avatar_block', $template->fetch($templateName));
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:39,代码来源:social.lib.php

示例6:

if (empty($_GET['id'])) {
    $id_message = $_GET['id_send'];
    $source = 'outbox';
    $show_menu = 'messages_outbox';
} else {
    $id_message = $_GET['id'];
    $source = 'inbox';
    $show_menu = 'messages_inbox';
}

$message  = '';

//LEFT COLUMN
if (api_get_setting('allow_social_tool') == 'true') {
    $social_avatar_block = SocialManager::show_social_avatar_block($show_menu);
    $social_menu_block = SocialManager::show_social_menu($show_menu);
    $message .='<div class="span9">';
}
//MAIN CONTENT
$message .= MessageManager::show_message_box($id_message,$source);

if (api_get_setting('allow_social_tool') == 'true') {
    $message .='</div>';
}

if (!empty($message)) {
    $social_right_content .= $message;
} else {
    api_not_allowed();
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:30,代码来源:view_message.php

示例7: clear_form

	$(ident).attr("alt","");
	$(ident).attr("title","");
}

function clear_form () {
	$("input[@type=radio]").attr("checked", false);
	$("div#div_qualify_image").html("");
	$("div#div_info_user").html("");
}

</script>';

$interbreadcrumb[] = array('url' => 'profile.php', 'name' => get_lang('SocialNetwork'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Friends'));

$social_avatar_block = SocialManager::show_social_avatar_block('friends');
$social_menu_block = SocialManager::show_social_menu('friends');

$user_id = api_get_user_id();

$user_id = api_get_user_id();
$name_search = isset($_POST['search_name_q']) ? $_POST['search_name_q'] : null;
$number_friends = 0;

if (isset($name_search) && $name_search != 'undefined') {
    $friends = SocialManager::get_friends($user_id, null, $name_search);
} else {
    $friends = SocialManager::get_friends($user_id);
}

$social_right_content = '<div class="span8">';
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:friends.php

示例8: get_lang

    ) . get_lang('SessionAddTypeUnique') . '</a>';
    $link_add_type_multiple = Display::return_icon('multiple.gif') . get_lang(
        'SessionAddTypeMultiple'
    );
} else {
    $link_add_type_unique = Display::return_icon('single.gif') . get_lang(
        'SessionAddTypeUnique'
    );
    $link_add_type_multiple = '<a href="' . api_get_self(
    ) . '?id=' . $group_id . '&add=' . $add . '&add_type=multiple">' . Display::return_icon(
        'multiple.gif'
    ) . get_lang('SessionAddTypeMultiple') . '</a>';
}

$social_avatar_block = SocialManager::show_social_avatar_block(
    'invite_friends',
    $group_id
);
$social_menu_block = SocialManager::show_social_menu(
    'invite_friends',
    $group_id
);
$social_right_content = '<h2>' . Security::remove_XSS(
    $group_info['name'],
    STUDENT,
    true
) . '</h2>';

if (count($nosessionUsersList) == 0) {
    $friends = SocialManager::get_friends(api_get_user_id());
    if ($friends == 0) {
        $social_right_content .= get_lang(
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:32,代码来源:group_invitation.php

示例9: foreach

foreach ($sessionCourseSubscriptions as $subscription) {
    $session = $subscription->getSession();
    if (array_key_exists($session->getId(), $sessionList)) {
        continue;
    }
    if ($currentSession && $currentSession->getId() === $session->getId()) {
        $allowAccess = true;
    }
    $sessionList[$session->getId()] = $session;
}
if ($currentSession && !$allowAccess) {
    api_not_allowed(true);
}
$template = new Template($nameTools);
$template->assign('user', $user);
$template->assign('user_avatar', SocialManager::show_social_avatar_block('home', 0, $user->getId()));
$template->assign('gamification_stars', GamificationUtils::getTotalUserStars($user->getId(), $user->getStatus()));
$template->assign('gamification_points', GamificationUtils::getTotalUserPoints($user->getId(), $user->getStatus()));
$template->assign('gamification_progress', GamificationUtils::getTotalUserProgress($user->getId(), $user->getStatus()));
$template->assign('sessions', $sessionList);
$template->assign('current_session', $currentSession);
if ($currentSession) {
    $sessionData = [];
    $sessionCourses = $currentSession->getCourses();
    foreach ($sessionCourses as $sessionCourse) {
        $course = $sessionCourse->getCourse();
        $courseData = ['title' => $course->getTitle(), 'stats' => []];
        $learningPathList = new LearnpathList($user->getId(), $course->getCode(), $currentSession->getId());
        foreach ($learningPathList->list as $learningPathId => $learningPath) {
            $courseData['stats'][] = [$learningPath['lp_name'], 'newscorm/lp_controller.php?' . http_build_query(['action' => 'stats', 'cidReq' => $course->getCode(), 'id_session' => $currentSession->getId(), 'gidReq' => 0, 'lp_id' => $learningPathId]) . api_get_cidreq()];
        }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:31,代码来源:my_progress.php

示例10: get_main_table

            )
            ) {
                $table_user = Database :: get_main_table(TABLE_MAIN_USER);

                $sql = "UPDATE $table_user
                    SET picture_uri = '$new_picture' WHERE user_id =  " . api_get_user_id();

                $result = Database::query($sql);
            }
        }
    }
}

$user_info = UserManager :: get_user_info_by_id(api_get_user_id());

$social_avatar_block = SocialManager::show_social_avatar_block('home');
$social_menu_block = SocialManager::show_social_menu('home');

$socialRightContent = '<div class="span5">';
$socialRightContent .= '<div class="well_border">';
$socialRightContent .= '<h3>' . get_lang('ContactInformation') . '</h3>';

$list = array(
    array(
        'title' => get_lang('Name'),
        'content' => api_get_person_name(
            $user_info['firstname'],
            $user_info['lastname']
        )
    ),
    array('title' => get_lang('Email'), 'content' => $user_info['email']),
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:home.php

示例11: array

$interbreadcrumb[] = array('url' => 'profile.php', 'name' => get_lang('SocialNetwork'));

$query = isset($_GET['q']) ? Security::remove_XSS($_GET['q']): null;
$query_search_type = isset($_GET['search_type']) && in_array($_GET['search_type'], array('0','1','2')) ? $_GET['search_type'] : null;
$extra_fields = UserManager::get_extra_filtrable_fields();
$query_vars = array('q' => $query, 'search_type' => $query_search_type);
if (!empty($extra_fields)) {
    foreach ($extra_fields as $extra_field) {
        $field_name = 'field_' . $extra_field['variable'];
        if (isset($_GET[$field_name]) && $_GET[$field_name] != '0') {
            $query_vars[$field_name] = $_GET[$field_name];
        }
    }
}

$social_avatar_block = SocialManager::show_social_avatar_block('search');
$social_menu_block = SocialManager::show_social_menu('search');
$social_right_content = '<div class="span9">'.UserManager::get_search_form($query).'</div>';

$groups = array();
$totalGroups = array();

// I'm searching something
if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) ) {
    $itemPerPage = 9;

    if ($_GET['search_type']=='0' || $_GET['search_type']=='1') {
        $page = isset($_GET['users_page_nr']) ? intval($_GET['users_page_nr']) : 1;
        $totalUsers = UserManager::get_all_user_tags($_GET['q'], 0, 0, $itemPerPage, true);

        $from = intval(($page - 1) * $itemPerPage);
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:search.php

示例12: intval



if (isset($_GET['action']) && $_GET['action']=='set_moderator') {
    // we add a user only if is a open group
    $user_moderator= intval($_GET['u']);
    //if i'm the admin
    if (GroupPortalManager::is_group_admin($group_id)) {
        GroupPortalManager::update_user_role($user_moderator, $group_id, GROUP_USER_PERMISSION_MODERATOR);
        $show_message = get_lang('UserChangeToModerator');
    }
}

$users	= GroupPortalManager::get_users_by_group($group_id, true, array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER), 0, 1000);
$new_member_list = array();

$social_avatar_block = SocialManager::show_social_avatar_block('waiting_list', $group_id);
$social_menu_block = SocialManager::show_social_menu('waiting_list', $group_id);

if (!empty($show_message)){
    $social_right_content .= Display :: return_message($show_message);
}
// Display form
foreach($users as $user) {
    switch ($user['relation_type']) {
        case  GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER:
        $user['link']  = '<a href="group_waiting_list.php?id='.$group_id.'&u='.$user['user_id'].'&action=accept">'.Display::return_icon('invitation_friend.png', get_lang('AddNormalUser')).'</a>';
        $user['link'] .= '<a href="group_waiting_list.php?id='.$group_id.'&u='.$user['user_id'].'&action=set_moderator">'.Display::return_icon('social_moderator_add.png', get_lang('AddModerator')).'</a>';
        $user['link'] .= '<a href="group_waiting_list.php?id='.$group_id.'&u='.$user['user_id'].'&action=deny">'.Display::return_icon('user_delete.png', get_lang('DenyEntry')).'</a>';
        break;
    }
    $new_member_list[] = $user;
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:29,代码来源:group_waiting_list.php

示例13: elseif

                } elseif (in_array($user_role, array(GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) {
                    $show_message = Display::return_message(get_lang('UserIsAlreadySubscribedToThisGroup'), 'warning');
                } else {
                    $show_message = Display::return_message(get_lang('UserIsNotSubscribedToThisGroup'), 'warning');
                }
                break 2;
            case 'deny':
                // delete invitation
                GroupPortalManager::delete_user_rel_group(api_get_user_id(), $value);
                $show_message = Display::return_message(get_lang('GroupInvitationWasDeny'));
                break 2;
        }
    }
}

$social_avatar_block = SocialManager::show_social_avatar_block('invitations');
$social_menu_block = SocialManager::show_social_menu('invitations');
$social_right_content = '<div class="span9">
                            <div id="id_response" align="center"></div>
                        </div></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 		= GroupPortalManager::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="row"><div class="span9"><a class="btn" href="search.php">'.get_lang('TryAndFindSomeFriends').'</a></div></div>';
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:invitations.php

示例14: get_lang

                    $show_message = get_lang('UserIsNotSubscribedToThisGroup');
                }
                break 2;
            case 'deny':
                // delete invitation
                GroupPortalManager::delete_user_rel_group(
                    api_get_user_id(),
                    $value
                );
                $show_message = get_lang('GroupInvitationWasDeny');
                break 2;
        }
    }
}

$social_avatar_block = SocialManager::show_social_avatar_block('myfiles');
$social_menu_block = SocialManager::show_social_menu('myfiles');
$actions = null;

if (isset($_GET['cidReq'])) {
    $actions = '<a href="' . api_get_path(
            WEB_CODE_PATH
        ) . 'document/document.php?cidReq=' . Security::remove_XSS(
            $_GET['cidReq']
        ) . '&amp;id_session=' . Security::remove_XSS(
            $_GET['id_session']
        ) . '&amp;gidReq=' . Security::remove_XSS(
            $_GET['gidReq']
        ) . '&amp;id=' . Security::remove_XSS(
            $_GET['parent_id']
        ) . '">' . Display::return_icon(
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:myfiles.php

示例15: get_lang

		if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
		}
		if (api_get_setting('allow_message_tool') == 'true') {
			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
		}
		$social_right_content .= '</div>';
	}
}

// LEFT COLUMN
$social_left_content = null;
if (api_get_setting('allow_social_tool') == 'true') {
    $social_avatar_block = SocialManager::show_social_avatar_block('messages');
    $social_menu_block = SocialManager::show_social_menu('messages');
    $social_right_content .= '<div class="span9">';
    $social_right_content .= '<div class="actions">';
    $social_right_content .=  '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>';
    $social_right_content .=  '</div>';
    $social_right_content .=  '</div>';
    $social_right_content .= '<div class="span9">';
}

// MAIN CONTENT
if (!isset($_POST['compose'])) {
    if(isset($_GET['re_id'])) {
        $social_right_content .= show_compose_reply_to_message($_GET['re_id'], api_get_user_id());
    } elseif(isset($_GET['send_to_user'])) {
        $social_right_content .= show_compose_to_user($_GET['send_to_user']);
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:new_message.php


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