diff --git a/main/messages/inbox.php b/main/messages/inbox.php index c879325a23..679aa0e3c2 100755 --- a/main/messages/inbox.php +++ b/main/messages/inbox.php @@ -135,33 +135,73 @@ if ($_GET['f']=='social') { echo ''; } else { //comes from normal profile + /* echo '
'; echo ''.Display::return_icon('inbox.png',api_xml_http_response_encode(get_lang('Inbox'))).api_xml_http_response_encode(get_lang('Inbox')).''; echo ''.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).''; echo ''.Display::return_icon('outbox.png',api_xml_http_response_encode(get_lang('Outbox'))).api_xml_http_response_encode(get_lang('Outbox')).''; - echo '
'; -} + echo ''; */ + + if (api_get_setting('extended_profile') == 'true') { + echo '
'; + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { + echo ''.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).' '.get_lang('ViewSharedProfile').''; + } + if (api_get_setting('allow_message_tool') == 'true') { + echo ''.Display::return_icon('inbox.png').' '.get_lang('Messages').''; + } + $show = isset($_GET['show']) ? '&show='.Security::remove_XSS($_GET['show']) : ''; + + //echo ''; + + if (isset($_GET['type']) && $_GET['type'] == 'extended') { + echo ''.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).' '.get_lang('EditNormalProfile').''; + } else { + echo ''.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).' '.get_lang('EditExtendProfile').''; + } + //echo ''; -if (!isset($_GET['del_msg'])) { - 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?? - MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_'.$i]); + echo '
'; +} + +} + + +echo '
'; + //LEFT CONTENT + echo '
'; + echo ''; + echo '
'; + + echo '
'; + //MAIN CONTENT + if (!isset($_GET['del_msg'])) { + 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?? + MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_'.$i]); + } } + inbox_display(); } - inbox_display(); -} + echo '
'; + +echo '
'; /* ============================================================================== FOOTER ============================================================================== */ -if ($request===false) { - Display::display_footer(); -} + +Display::display_footer(); + ?> diff --git a/main/messages/new_message.php b/main/messages/new_message.php index 984d3af642..b7f3a423f3 100755 --- a/main/messages/new_message.php +++ b/main/messages/new_message.php @@ -29,7 +29,6 @@ require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php'; require_once api_get_path(LIBRARY_PATH).'message.lib.php'; -$request=api_is_xml_http_request(); $nameTools = api_xml_http_response_encode(get_lang('Messages')); /* ----------------------------------------------------------- @@ -143,8 +142,7 @@ function show_compose_to_user ($receiver_id) { function manage_form ($default, $select_from_user_list = null) { global $charset; $table_message = Database::get_main_table(TABLE_MESSAGE); - $request=api_is_xml_http_request(); - + $group_id = intval($_REQUEST['group_id']); $message_id = intval($_GET['message_id']); @@ -239,59 +237,95 @@ if ($group_id != 0) { echo ''.Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('BackToGroup')).''; echo ''.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).''; } else { - echo ''.Display::return_icon('inbox.png',api_xml_http_response_encode(get_lang('Inbox'))).api_xml_http_response_encode(get_lang('Inbox')).''; - echo ''.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).''; - echo ''.Display::return_icon('outbox.png',api_xml_http_response_encode(get_lang('Outbox'))).api_xml_http_response_encode(get_lang('Outbox')).''; + if (api_get_setting('extended_profile') == 'true') { + + + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { + echo ''.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).' '.get_lang('ViewSharedProfile').''; + } + if (api_get_setting('allow_message_tool') == 'true') { + echo ''.Display::return_icon('inbox.png').' '.get_lang('Messages').''; + } + $show = isset($_GET['show']) ? '&show='.Security::remove_XSS($_GET['show']) : ''; + + //echo ''; + + if (isset($_GET['type']) && $_GET['type'] == 'extended') { + echo ''.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).' '.get_lang('EditNormalProfile').''; + } else { + echo ''.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).' '.get_lang('EditExtendProfile').''; + } + //echo ''; + + + } } echo ''; + +echo '
'; + //LEFT COLUMN + echo '
'; + echo ''; + echo '
'; + + echo '
'; -if (!isset($_POST['compose'])) { - if(isset($_GET['re_id'])) { - $message_id = $_GET['re_id']; - $receiver_id = api_get_user_id(); - show_compose_reply_to_message($message_id, $receiver_id); - } elseif(isset($_GET['send_to_user'])) { - show_compose_to_user($_GET['send_to_user']); - } else { - show_compose_to_any($_user['user_id']); - } -} else { - - $restrict = false; - if (isset($_POST['id_text_name'])) { - $restrict = $_POST['id_text_name']; - } else if (isset($_POST['group_id'])) { - $restrict = $_POST['group_id']; - } - - if (isset($_GET['re_id'])) { - $default['title'] = api_xml_http_response_encode($_POST['title']); - $default['content'] = api_xml_http_response_encode($_POST['content']); - //$default['user_list'] = $_POST['user_list']; - manage_form($default); - } else { - if ($restrict) { - $default['title'] = api_xml_http_response_encode($_POST['title']); - if (!isset($_POST['group_id'])) { - $default['id_text_name'] = api_xml_http_response_encode($_POST['id_text_name']); - $default['user_list'] = $_POST['user_list']; + //MAIN CONTENT + + if (!isset($_POST['compose'])) { + if(isset($_GET['re_id'])) { + $message_id = $_GET['re_id']; + $receiver_id = api_get_user_id(); + show_compose_reply_to_message($message_id, $receiver_id); + } elseif(isset($_GET['send_to_user'])) { + show_compose_to_user($_GET['send_to_user']); } else { - $default['group_id'] = $_POST['group_id']; - } - manage_form($default); + show_compose_to_any($_user['user_id']); + } } else { - Display::display_error_message(api_xml_http_response_encode(get_lang('ErrorSendingMessage'))); + + $restrict = false; + if (isset($_POST['id_text_name'])) { + $restrict = $_POST['id_text_name']; + } else if (isset($_POST['group_id'])) { + $restrict = $_POST['group_id']; + } + + if (isset($_GET['re_id'])) { + $default['title'] = api_xml_http_response_encode($_POST['title']); + $default['content'] = api_xml_http_response_encode($_POST['content']); + //$default['user_list'] = $_POST['user_list']; + manage_form($default); + } else { + if ($restrict) { + $default['title'] = api_xml_http_response_encode($_POST['title']); + if (!isset($_POST['group_id'])) { + $default['id_text_name'] = api_xml_http_response_encode($_POST['id_text_name']); + $default['user_list'] = $_POST['user_list']; + } else { + $default['group_id'] = $_POST['group_id']; + } + manage_form($default); + } else { + Display::display_error_message(api_xml_http_response_encode(get_lang('ErrorSendingMessage'))); + } + } } - } -} + echo '
'; + +echo '
'; + /* ============================================================================== FOOTER ============================================================================== */ -if ($request===false) { - Display::display_footer(); -} +Display::display_footer(); + ?> diff --git a/main/messages/outbox.php b/main/messages/outbox.php index db97ab1621..d891118373 100755 --- a/main/messages/outbox.php +++ b/main/messages/outbox.php @@ -69,11 +69,30 @@ if ($_GET['f']=='social') { Display::display_header(''); -echo '
'; - echo ''.Display::return_icon('inbox.png',api_xml_http_response_encode(get_lang('Inbox'))).api_xml_http_response_encode(get_lang('Inbox')).''; - echo ''.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).''; - echo ''.Display::return_icon('outbox.png',api_xml_http_response_encode(get_lang('Outbox'))).api_xml_http_response_encode(get_lang('Outbox')).''; -echo '
'; + +if (api_get_setting('extended_profile') == 'true') { +echo '
'; + +if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { + echo ''.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).' '.get_lang('ViewSharedProfile').''; +} +if (api_get_setting('allow_message_tool') == 'true') { + echo ''.Display::return_icon('inbox.png').' '.get_lang('Messages').''; +} +$show = isset($_GET['show']) ? '&show='.Security::remove_XSS($_GET['show']) : ''; + +//echo ''; + +if (isset($_GET['type']) && $_GET['type'] == 'extended') { + echo ''.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).' '.get_lang('EditNormalProfile').''; +} else { + echo ''.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).' '.get_lang('EditExtendProfile').''; +} +//echo ''; + +echo '
'; +} + /**************************************************************/ $info_delete_outbox=array(); @@ -96,28 +115,47 @@ if( trim($info_delete_outbox[0])=='delete' ) { $table_message = Database::get_main_table(TABLE_MESSAGE); $user_sender_id=api_get_user_id(); -if ($_REQUEST['action']=='delete') { - $delete_list_id=array(); - if (isset($_POST['out'])) { - $delete_list_id=$_POST['out']; - } - if (isset($_POST['id'])) { - $delete_list_id=$_POST['id']; - } - for ($i=0;$i'; + //LEFT COLUMN + echo '
'; + echo ''; + echo '
'; + + echo '
'; + //MAIN CONTENT + if ($_REQUEST['action']=='delete') { + $delete_list_id=array(); + if (isset($_POST['out'])) { + $delete_list_id=$_POST['out']; + } + if (isset($_POST['id'])) { + $delete_list_id=$_POST['id']; + } + for ($i=0;$i'; + +echo '
'; + + + /* ============================================================================== FOOTER