api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('SocialNetwork')];
} else {
$this_section = SECTION_MYPROFILE;
$interbreadcrumb[] = ['url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile')];
}
$interbreadcrumb[] = ['url' => 'inbox.php', 'name' => get_lang('Messages')];
$social_right_content = '
';
$type = isset($_GET['type']) ? (int) $_GET['type'] : MessageManager::MESSAGE_TYPE_INBOX;
$show_menu = 'messages_inbox';
if ($type === MessageManager::MESSAGE_TYPE_OUTBOX) {
$show_menu = 'messages_outbox';
}
$message = '';
$logInfo = [
'tool' => 'Messages',
'tool_id' => $messageId,
'action' => 'view-message',
'action_details' => 'view-message',
];
Event::registerLog($logInfo);
// LEFT COLUMN
if (api_get_setting('allow_social_tool') === 'true') {
// Block Social Menu
$social_menu_block = SocialManager::show_social_menu($show_menu);
}
// MAIN CONTENT
$message .= MessageManager::showMessageBox($messageId, $type);
if (!empty($message)) {
$social_right_content .= $message;
} else {
api_not_allowed(true);
}
$tpl = new Template(get_lang('View'));
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), $show_menu);
if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('social/inbox.tpl');
$tpl->display($social_layout);
} else {
$content = $social_right_content;
$tpl->assign('content', $content);
$tpl->display_one_col_template();
}