|
@@ -14,69 +14,46 @@ if (api_get_setting('allow_message_tool') != 'true') {
|
|
api_not_allowed(true);
|
|
api_not_allowed(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+$allowSocial = api_get_setting('allow_social_tool') == 'true';
|
|
|
|
+$allowMessage = api_get_setting('allow_message_tool') == 'true';
|
|
|
|
+
|
|
if (isset($_GET['messages_page_nr'])) {
|
|
if (isset($_GET['messages_page_nr'])) {
|
|
- if (api_get_setting('allow_social_tool') == 'true' &&
|
|
|
|
- api_get_setting('allow_message_tool') == 'true'
|
|
|
|
- ) {
|
|
|
|
- $social_link = '';
|
|
|
|
- if ($_REQUEST['f'] == 'social') {
|
|
|
|
- $social_link = '&f=social';
|
|
|
|
- }
|
|
|
|
- header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.'');
|
|
|
|
|
|
+ if ($allowSocial && $allowMessage) {
|
|
|
|
+ header('Location:outbox.php?pager='.intval($_GET['messages_page_nr']));
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-$htmlHeadXtra[] = '<script>
|
|
|
|
-function enviar(miforma) {
|
|
|
|
- if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'"))
|
|
|
|
- miforma.submit();
|
|
|
|
-}
|
|
|
|
-function select_all(formita) {
|
|
|
|
- for (i=0;i<formita.elements.length;i++)
|
|
|
|
- {
|
|
|
|
- if(formita.elements[i].type == "checkbox")
|
|
|
|
- formita.elements[i].checked=1
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-function deselect_all(formita) {
|
|
|
|
- for (i=0;i<formita.elements.length;i++) {
|
|
|
|
- if(formita.elements[i].type == "checkbox")
|
|
|
|
- formita.elements[i].checked=0
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</script>';
|
|
|
|
-
|
|
|
|
-/*
|
|
|
|
- MAIN CODE
|
|
|
|
-*/
|
|
|
|
-if (isset($_GET['f']) && $_GET['f'] === 'social') {
|
|
|
|
|
|
+if ($allowSocial) {
|
|
$this_section = SECTION_SOCIAL;
|
|
$this_section = SECTION_SOCIAL;
|
|
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
|
|
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
|
|
- $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
|
|
|
|
} else {
|
|
} else {
|
|
$this_section = SECTION_MYPROFILE;
|
|
$this_section = SECTION_MYPROFILE;
|
|
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
|
|
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
|
|
- $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+$interbreadcrumb[] = array(
|
|
|
|
+ 'url' => api_get_path(WEB_PATH).'main/messages/inbox.php',
|
|
|
|
+ 'name' => get_lang('Messages')
|
|
|
|
+);
|
|
|
|
+
|
|
$actions = '';
|
|
$actions = '';
|
|
-if (api_get_setting('extended_profile') == 'true') {
|
|
|
|
- if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
|
|
|
|
- $actions .= '<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') {
|
|
|
|
- //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
|
|
|
|
- $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
|
|
|
|
- Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
|
|
|
|
- $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
|
|
|
|
- Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
|
|
|
|
- $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
|
|
|
|
- Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+if ($allowSocial && $allowMessage) {
|
|
|
|
+ $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
|
|
|
|
+ Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+if ($allowMessage) {
|
|
|
|
+ $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
|
|
|
|
+ Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
|
|
|
|
+ $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
|
|
|
|
+ Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
|
|
|
|
+ $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
|
|
|
|
+ Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
$info_delete_outbox = array();
|
|
$info_delete_outbox = array();
|
|
$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : '';
|
|
$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : '';
|
|
$count_delete_outbox = count($info_delete_outbox) - 1;
|
|
$count_delete_outbox = count($info_delete_outbox) - 1;
|
|
@@ -107,8 +84,8 @@ if (isset($_REQUEST['action'])) {
|
|
|
|
|
|
$keyword = '';
|
|
$keyword = '';
|
|
$social_right_content = '';
|
|
$social_right_content = '';
|
|
-if (api_get_setting('allow_social_tool') == 'true') {
|
|
|
|
- //Block Social Menu
|
|
|
|
|
|
+if ($allowSocial) {
|
|
|
|
+ // Block Social Menu
|
|
$social_menu_block = SocialManager::show_social_menu('messages');
|
|
$social_menu_block = SocialManager::show_social_menu('messages');
|
|
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.
|
|
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.
|
|
Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>';
|
|
Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>';
|
|
@@ -151,10 +128,11 @@ if ($action == 'delete') {
|
|
$social_right_content .= MessageManager::outbox_display($keyword);
|
|
$social_right_content .= MessageManager::outbox_display($keyword);
|
|
}
|
|
}
|
|
|
|
|
|
-$tpl = new Template(get_lang('ComposeMessage'));
|
|
|
|
|
|
+$tpl = new Template(get_lang('Outbox'));
|
|
// Block Social Avatar
|
|
// Block Social Avatar
|
|
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'messages');
|
|
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'messages');
|
|
-if (api_get_setting('allow_social_tool') == 'true') {
|
|
|
|
|
|
+
|
|
|
|
+if ($allowSocial) {
|
|
$tpl->assign('social_menu_block', $social_menu_block);
|
|
$tpl->assign('social_menu_block', $social_menu_block);
|
|
$tpl->assign('social_right_content', $social_right_content);
|
|
$tpl->assign('social_right_content', $social_right_content);
|
|
$social_layout = $tpl->get_template('social/inbox.tpl');
|
|
$social_layout = $tpl->get_template('social/inbox.tpl');
|