예제 #1
0
    }
    $actionsRight = $form->returnForm();
    $social_right_content .= Display::toolbarAction('toolbar', [$actionsLeft, $actionsRight]);
}
//MAIN CONTENT
if (!isset($_GET['del_msg'])) {
    $social_right_content .= MessageManager::inbox_display();
} else {
    $num_msg = intval($_POST['total']);
    for ($i = 0; $i < $num_msg; $i++) {
        if ($_POST[$i]) {
            //the user_id was necesarry to delete a message??
            Display::addFlash(MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_' . $i]));
        }
    }
    $social_right_content .= MessageManager::inbox_display();
}
if (api_get_setting('social.allow_social_tool') == 'true') {
    $social_right_content .= '</div>';
}
$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;