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


PHP SocialManager::show_social_menu方法代码示例

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


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

示例1: elseif

                    $show_message = Display::return_message(get_lang('UserIsSubscribedToThisGroup'), 'success');
                } 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
                $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);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:invitations.php

示例2: api_get_path

        if (api_get_setting('social.allow_social_tool') == 'true' && api_get_setting('message.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('message.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('social.allow_social_tool') == 'true') {
    //Block Social Menu
    $social_menu_block = SocialManager::show_social_menu('messages');
    $social_right_content .= '<div class="row">';
    $social_right_content .= '<div class="col-md-12">';
    $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="col-md-12">';
}
// 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']);
    } else {
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:new_message.php

示例3: 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,代码行数:30,代码来源:group_waiting_list.php

示例4: array

	    	url,
	        {},
	        	function(responseText, textStatus, XMLHttpRequest) {
                    dialog.dialog({
                        modal	: true,
                        width	: 520,
                        height	: 400,
                    });
				});
	            //prevent the browser to follow the link
	            return false;
	        });
        });
</script>';
$this_section = SECTION_SOCIAL;
$interbreadcrumb[] = array('url' => 'groups.php', 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => 'groups.php?id=' . $group_id, 'name' => Security::remove_XSS($group_info['name']));
//$interbreadcrumb[] = array('url' => 'groups.php?id='.$group_id.'#tabs_2',  'name' => get_lang('Discussions'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Discussions'));
$social_left_content = SocialManager::show_social_menu('member_list', $group_id);
$show_message = null;
if (!empty($show_message)) {
    $social_right_content .= Display::return_message($show_message, 'confirmation');
}
$social_right_content .= MessageManager::display_message_for_group($group_id, $topic_id, $is_member, $message_id);
$social_right_content = '<div class="span9">' . $social_right_content . '</div>';
$app['title'] = get_lang('Social');
$tpl = $app['template'];
$tpl->setHelp('Groups');
$tpl->assign('message', $show_message);
$tpl->assign('content', $social_right_content);
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:group_topics.php

示例5: api_not_allowed

if (!$usergroup->is_group_admin($group_id)) {
    api_not_allowed();
}
// Create the form
$form = new FormValidator('group_edit', 'post', '', '');
$form->addElement('hidden', 'id', $group_id);
$usergroup->setGroupType($usergroup::SOCIAL_CLASS);
$usergroup->setForm($form, 'edit', $group_data);
// Set default values
$form->setDefaults($group_data);
// Validate form
if ($form->validate()) {
    $group = $form->exportValues();
    $group['id'] = $group_id;
    $group['type'] = $usergroup::SOCIAL_CLASS;
    $usergroup->update($group);
    $tok = Security::get_token();
    header('Location: groups.php?id=' . $group_id . '&action=show_message&message=' . urlencode(get_lang('GroupUpdated')) . '&sec_token=' . $tok);
    exit;
}
$social_left_content = SocialManager::show_social_menu('group_edit', $group_id);
$social_right_content = '<div class="span9">';
$social_right_content .= $form->return_form();
$social_right_content .= '</div>';
$app['title'] = $tool_name;
$tpl = $app['template'];
$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);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:group_edit.php

示例6: api_get_path

    } else {
        $social_right_content .= '<div class=actions>';
        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
if (api_get_setting('allow_social_tool') == 'true') {
    $social_left_content = 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']);
    } else {
        $social_right_content .= show_compose_to_any($_user['user_id']);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:new_message.php

示例7: api_get_user_id

                }
                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(
            'back.png',
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:myfiles.php

示例8: clear_form

	ident="#img_"+id_elem[1];
	$(ident).attr("src","../img/blank.gif");
	$(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_left_content = 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">';
if (count($friends) == 0) {
    $social_right_content .= get_lang('NoFriendsInYourContactList') . '<br /><br />';
    $social_right_content .= '<a class="btn" href="search.php">' . get_lang('TryAndFindSomeFriends') . '</a>';
} else {
    $social_right_content .= get_lang('Search') . '&nbsp;&nbsp; : &nbsp;&nbsp;';
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:friends.php

示例9: api_not_allowed

    api_not_allowed();
}
if (api_get_setting('allow_students_to_create_groups_in_social') == 'false' && !api_is_allowed_to_edit()) {
    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();
    $groupId = $usergroup->save($values);
    header('Location: groups.php?id=' . $groupId . '&action=show_message&message=' . urlencode(get_lang('GroupAdded')));
    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_left_content = SocialManager::show_social_menu('group_add');
$social_right_content = '<div class="span9">';
$social_right_content .= $form->return_form();
$social_right_content .= '</div>';
$tpl = $app['template'];
$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);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:group_add.php

示例10: api_get_anonymous_id

    //deleting anonymous users
    $user_anonymous = api_get_anonymous_id();
    foreach ($nosessionUsersList as $key_user_list => $value_user_list) {
        if ($nosessionUsersList[$key_user_list]['user_id'] == $user_anonymous) {
            unset($nosessionUsersList[$key_user_list]);
        }
    }
}
if ($add_type == 'multiple') {
    $link_add_type_unique = '<a href="' . api_get_self() . '?id=' . $group_id . '&add_type=unique">' . Display::return_icon('single.gif') . 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_type=multiple">' . Display::return_icon('multiple.gif') . get_lang('SessionAddTypeMultiple') . '</a>';
}
$social_left_content = 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('YouNeedToHaveFriendsInYourSocialNetwork');
    } else {
        $social_right_content .= get_lang('YouAlreadyInviteAllYourContacts');
    }
    $social_right_content .= '<div>';
    $social_right_content .= '<a href="search.php">' . get_lang('TryAndFindSomeFriends') . '</a>';
    $social_right_content .= '</div>';
}
$add_true = null;
$ajax = null;
if (!empty($_GET['add'])) {
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:group_invitation.php

示例11: clear_form

	$(ident).attr("src","../img/blank.gif");
	$(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'));
//Block Social Menu
$social_menu_block = SocialManager::show_social_menu('friends');
$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="col-md-12">';
if (count($friends) == 0) {
    $social_right_content .= Display::return_message(Display::tag('p', get_lang('NoFriendsInYourContactList')), 'warning', false);
    $social_right_content .= Display::toolbarButton(get_lang('TryAndFindSomeFriends'), 'search.php', 'search', 'success');
} else {
    $filterForm = new FormValidator('filter');
    $filterForm->addText('id_search_image', get_lang('Search'), false, ['onkeyup' => 'search_image_social()', 'id' => 'id_search_image']);
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:31,代码来源:friends.php

示例12: array

$course_list_code = array();
$i = 1;
if (is_array($personal_course_list)) {
    foreach ($personal_course_list as $my_course) {
        if ($i <= 10) {
            $list[$my_course['code']] = 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 = ArrayClass::array_unique_dimensional($course_list_code);
}
$social_left_content = SocialManager::show_social_menu('shared_profile', null, $user_id, $show_full_profile);
$personal_info = null;
if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) {
    $personal_info .= '<div><h3>' . api_get_person_name($user_info['firstname'], $user_info['lastname']) . '</h3></div>';
} else {
    //--- Basic Information
    $personal_info .= '<div><h3>' . get_lang('Profile') . '</h3></div>';
}
if ($show_full_profile) {
    $personal_info .= '<dl class="dl-horizontal">';
    $personal_info .= '<dt>' . get_lang('UserName') . '</dt><dd>' . $user_info['username'] . '    </dd>';
    if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) {
        $personal_info .= '<dt>' . get_lang('Name') . '</dt><dd>' . api_get_person_name($user_info['firstname'], $user_info['lastname']) . '</dd>';
    }
    if (!empty($user_info['official_code'])) {
        $personal_info .= '<dt>' . get_lang('OfficialCode') . '</dt><dd>' . $user_info['official_code'] . '</dd>';
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php

示例13: get_lang

        $usergroup->delete_user_rel_group($user_join, $group_id);
        $show_message = get_lang('UserDeleted');
    }
}
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 ($usergroup->is_group_admin($group_id)) {
        $usergroup->update_user_role($user_moderator, $group_id, GROUP_USER_PERMISSION_MODERATOR);
        $show_message = get_lang('UserChangeToModerator');
    }
}
$users = $usergroup->get_users_by_group($group_id, true, array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER), 0, 1000);
$new_member_list = array();
$social_left_content = 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;
}
$social_right_content = '<div class="span9">';
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:group_waiting_list.php

示例14: api_get_path

               type: "POST",
               url: "' . api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?a=add_friend",
               data: "friend_id="+user_friend_id+"&is_my_friend="+"friend",
               success: function(data) {
                   $("div#"+name_div_id).hide("slow");
                   $("#id_response").html(data);
               }
		});
    }
}

</script>';
$show_message = null;
$content = null;
// Block Menu Social
$social_menu_block = SocialManager::show_social_menu('invitations');
// Block Invitations
$socialInvitationsBlock = '<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) {
    $socialInvitationsBlock .= '<div class="row">
        <div class="col-md-12">
            <a class="btn btn-success" href="search.php"><em class="fa fa-search"></em> ' . get_lang('TryAndFindSomeFriends') . '
            </a>
            </div>
        </div>';
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:invitations.php

示例15: get_lang

    $form->addRule('picture', get_lang('OnlyImagesAllowed') . ' (' . implode(',', $allowed_picture_types) . ')', 'filetype', $allowed_picture_types);
    $form->addButtonSave(get_lang('SaveSettings'), 'apply_change');
    if ($form->validate()) {
        $user_data = $form->getSubmitValues();
        // upload picture if a new one is provided
        if ($_FILES['picture']['size']) {
            if ($new_picture = UserManager::update_user_picture(api_get_user_id(), $_FILES['picture']['name'], $_FILES['picture']['tmp_name'])) {
                $table_user = Database::get_main_table(TABLE_MAIN_USER);
                $sql = "UPDATE {$table_user}\n                    SET picture_uri = '{$new_picture}' WHERE user_id =  " . api_get_user_id();
                $result = Database::query($sql);
            }
        }
    }
}
//Block Menu
$social_menu_block = SocialManager::show_social_menu('home');
$social_search_block = Display::panel(UserManager::get_search_form(''), get_lang("SearchUsers"));
$results = $userGroup->get_groups_by_age(1, false);
$groups_newest = array();
if (!empty($results)) {
    foreach ($results as $result) {
        $id = $result['id'];
        $result['description'] = Security::remove_XSS($result['description'], STUDENT, true);
        $result['name'] = Security::remove_XSS($result['name'], STUDENT, true);
        if ($result['count'] == 1) {
            $result['count'] = '1 ' . get_lang('Member');
        } else {
            $result['count'] = $result['count'] . ' ' . get_lang('Members');
        }
        $group_url = "group_view.php?id={$id}";
        $result['name'] = '<div class="group-name">' . Display::url(api_ucwords(cut($result['name'], 40, true)), $group_url) . '</div><div class="count-username">' . Display::return_icon('user.png', '', '', ICON_SIZE_TINY) . $result['count'] . '</div>';
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:home.php


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