/** * @Route("/{username}") * @Method({"GET"}) */ public function indexAction($username) { $userId = \UserManager::get_user_id_from_username($username); $userInfo = api_get_user_info($userId); $this->getTemplate()->assign('user', $userInfo); $this->getTemplate()->assign('form_send_message', \MessageManager::generate_message_form('send_message')); $this->getTemplate()->assign('form_send_invitation', \MessageManager::generate_invitation_form('send_invitation')); $response = $this->getTemplate()->renderTemplate($this->getTemplatePath() . 'profile.tpl'); return new Response($response, 200, array()); }
} if (!empty($user_info['teach'])) { $more_info .= '<div class="social-actions-message"><strong>' . get_lang('MyTeach') . '</strong></div>'; $more_info .= '<div class="social-profile-extended">' . $user_info['teach'] . '</div>'; $more_info .= '<br />'; } $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); } } $tpl = new Template(get_lang('Social')); // Block Avatar Social SocialManager::setSocialUserBlock($tpl, $user_id, 'shared_profile'); $tpl->assign('social_friend_block', $friend_html); $tpl->assign('social_menu_block', $social_menu_block); $tpl->assign('social_wall_block', $social_wall_block); $tpl->assign('social_post_wall_block', $social_post_wall_block); $tpl->assign('social_extra_info_block', $social_extra_info_block); $tpl->assign('social_course_block', $social_course_block); $tpl->assign('social_group_info_block', $social_group_info_block); $tpl->assign('social_rss_block', $social_rss_block); $tpl->assign('social_skill_block', SocialManager::getSkillBlock($my_user_id)); $tpl->assign('sessionList', $social_session_block); $tpl->assign('social_right_information', $socialRightInformation); $tpl->assign('social_auto_extend_link', $socialAutoExtendLink); $formModalTpl = new Template(); $formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); $formModalTpl->assign('invitationForm', MessageManager::generate_invitation_form('send_invitation')); $formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); $tpl->assign('formModals', $formModals); $social_layout = $tpl->get_template('social/profile.tpl'); $tpl->display($social_layout);
echo ' $("#send_message_link").on("click", function() { var url = "' . $ajax_url . '?a=send_message&user_id=' . $user_info['user_id'] . '"; var params = $("#send_message").serialize(); $.ajax({ url: url+"&"+params, success:function(data) { $("#subject_id").val(""); $("#content_id").val(""); $("#send_message").html(data); $("#send_message_link").hide(); } }); });'; echo '</script>'; echo MessageManager::generate_message_form('send_message', array(), 'block'); echo ' <div class="row"> <div class="col-sm-10 col-sm-offset-2"> <a class="btn btn-primary" id="send_message_link"> <em class="fa fa-envelope"></em> ' . get_lang('Send') . ' </a> </div> </div> '; } break; case 'user_id_exists': if (api_is_anonymous()) { echo ''; } else {
/** * @Route("/{username}") * @Method({"GET"}) * @Template("ChamiloCoreBundle:User:profile.html.twig") */ public function profileAction($username) { $userId = \UserManager::get_user_id_from_username($username); $userInfo = api_get_user_info($userId); return array('user' => $userInfo, 'form_send_message' => \MessageManager::generate_message_form('send_message'), 'form_send_invitation' => \MessageManager::generate_invitation_form('send_invitation')); }
$more_info .= '<br />'; } if (!empty($user_info['openarea'])) { $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>'; $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>'; $more_info .= '<br />'; } if (!empty($user_info['teach'])) { $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>'; $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>'; $more_info .= '<br />'; } $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); } } $social_right_content .= MessageManager::generate_message_form('send_message'); $social_right_content .= MessageManager::generate_invitation_form('send_invitation'); $tpl = new Template(get_lang('Social')); $tpl->assign('social_avatar_block', $social_avatar_block); $tpl->assign('social_menu_block', $social_menu_block); $tpl->assign('social_right_content', $social_right_content); $tpl->assign('socialRightInformation', $socialRightInformation); $tpl->assign('socialAutoExtendLink', $socialAutoExtendLink); $social_layout = $tpl->get_template('layout/social_layout.tpl'); $tpl->display($social_layout); /* * function list my friends */