";*/
- $number_of_new_messages = -1;
- if($number_of_new_messages > 0)
- {
- ?>
-
- ';
- //echo ' ';
+if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') {
+ header('Location:inbox.php?f=social');
+} elseif ( api_get_setting('allow_message_tool')=='true') {
+ header('Location:inbox.php');
}
?>
\ No newline at end of file
diff --git a/main/messages/view_message.php b/main/messages/view_message.php
index 5f14db1e1f..c898e06464 100755
--- a/main/messages/view_message.php
+++ b/main/messages/view_message.php
@@ -4,7 +4,6 @@
* @package dokeos.messages
*/
-
$language_file = array('registration','messages','userInfo');
$cidReset= true;
require_once '../inc/global.inc.php';
@@ -77,8 +76,7 @@ echo '
';
} else {
$id_message = $_GET['id'];
$source = 'inbox';
- }
-
+ }
$message = MessageManager::show_message_box($id_message,$source);
if (!empty($message)) {
echo $message;
diff --git a/main/social/contacts.inc.php b/main/social/contacts.inc.php
deleted file mode 100755
index 838d7398fb..0000000000
--- a/main/social/contacts.inc.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- */
-
-$language_file = array('registration','messages','userInfo','admin');
-require '../inc/global.inc.php';
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
-require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
-require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
-require_once api_get_path(LIBRARY_PATH).'image.lib.php';
-require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
-require_once '../inc/lib/social.lib.php';
-$this_section = SECTION_MYPROFILE;
-$_SESSION['this_section']=$this_section;
-//$list_path_friends=array();
-$request=api_is_xml_http_request();
-$language_variable=api_xml_http_response_encode(get_lang('Contacts'));
-//api_display_tool_title($language_variable);
-
-$user_id=api_get_user_id();
-$image_path = UserManager::get_user_picture_path_by_id ($user_id,'web',false,true);
-?>
-
-
-
-
-
- |
-
-
-
- |
-
-
-
-
-
-
- |
-
-
-
-';
-require_once 'show_search_image.inc.php';
-echo '';
-?>
- |
-
- |
-
-
-
\ No newline at end of file
diff --git a/main/social/data_personal.inc.php b/main/social/data_personal.inc.php
deleted file mode 100755
index 7ac9dc8273..0000000000
--- a/main/social/data_personal.inc.php
+++ /dev/null
@@ -1,151 +0,0 @@
-
- */
-
-$language_file = array('registration','messages','userInfo','admin','forum','blog');
-require_once '../inc/global.inc.php';
-require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
-require_once api_get_path(LIBRARY_PATH).'social.lib.php';
-require_once api_get_path(LIBRARY_PATH).'course.lib.php';
-
-// @todo here we must show the user information as read only
-//User picture size is calculated from SYSTEM path
-$user_info= UserManager::get_user_info_by_id(api_get_user_id());
-$img_array= UserManager::get_user_picture_path_by_id(api_get_user_id(),'web',true,true);
-
-if (isset($_POST['load_ajax'])) {
- require_once api_get_path(LIBRARY_PATH).'blog.lib.php';
- require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
- $user_id = intval($_SESSION['social_user_id']);
- if ($_POST['action']) {$action = $_POST['action'];}
- switch($action) {
- case 'load_course' :
- $course_db = $_POST['course_code'];
- // @todo goto the course link
- //echo '
'.get_lang('GotoCourse').'';
- $course_id=CourseManager::get_course_id_by_database_name($course_db);
-
- if (api_is_user_of_course($course_id,api_get_user_id())) {
-
- $table_forums = Database :: get_course_table(TABLE_FORUM,$course_db);
- $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD,$course_db);
- $table_posts = Database :: get_course_table(TABLE_FORUM_POST,$course_db);
- $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY,$course_db);
- $table_users = Database :: get_main_table(TABLE_MAIN_USER);
-
- //------Forum messages
-
- $forum_result = get_all_post_from_user($user_id, $course_db);
- $all_result_data = 0;
- if ($forum_result !='') {
- api_display_tool_title(get_lang('Forum'));
- echo '
';
- echo api_xml_http_response_encode($forum_result);
- echo '
';
- echo '
';
- $all_result_data++;
- }
-
- //------Blog posts
- $result = get_blog_post_from_user($course_db, $user_id);
- if (!empty($result)) {
- api_display_tool_title(api_xml_http_response_encode(get_lang('Blog')));
- echo '
';
- echo api_xml_http_response_encode($result);
- echo '
';
- echo '
';
- $all_result_data++;
- }
-
- //------Blog comments
- $result = get_blog_comment_from_user($course_db, $user_id);
- if (!empty($result)) {
- echo '
';
- api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments')));
- echo api_xml_http_response_encode($result);
- echo '
';
- echo '
';
- $all_result_data++;
- }
- if ($all_result_data == 0) {
- echo api_xml_http_response_encode(get_lang('NoDataAvailable'));
- }
-
- } else {
- echo '
';
- api_display_tool_title(api_xml_http_response_encode(get_lang('Details')));
- echo '
';
- echo api_xml_http_response_encode(get_lang('UserNonRegisteredAtTheCourse'));
- echo '
';
- echo '
';
- echo '
';
- }
- break;
- case 'unload_course' :
- //echo 'load2';
- break;
- default:
-
- }
-} else {
- // normal behavior
-$request=api_is_xml_http_request();
-$language_variable=api_xml_http_response_encode(get_lang('PersonalData'));
-//api_display_tool_title($language_variable);
-
- echo '
';
- echo '
';
- echo '
';
- echo '
- '.api_xml_http_response_encode(get_lang('UserName')).'
- - '. api_xml_http_response_encode($user_info['username']).'
';
- if (api_is_western_name_order()) {
- echo '
- '.api_xml_http_response_encode(get_lang('FirstName')).'
- - '. api_xml_http_response_encode($user_info['firstname']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('LastName')).'
- - '. api_xml_http_response_encode($user_info['lastname']).'
';
- } else {
- echo '
- '.api_xml_http_response_encode(get_lang('LastName')).'
- '. api_xml_http_response_encode($user_info['lastname']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('FirstName')).'
- '. api_xml_http_response_encode($user_info['firstname']).'
';
- }
- echo '
- '.api_xml_http_response_encode(get_lang('OfficialCode')).'
- - '. api_xml_http_response_encode($user_info['official_code']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('Email')).'
- - '. api_xml_http_response_encode($user_info['email']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('Phone')).'
- - '. api_xml_http_response_encode($user_info['phone']).'
';
- echo '
';
- echo '
';
- echo '
';
- echo '

';
- echo '
';
- /*if (api_get_setting('allow_message_tool')=='true') {
- require_once api_get_path(LIBRARY_PATH).'message.lib.php';
- $number_of_new_messages = MessageManager::get_new_messages();
- $number_of_outbox_message=MessageManager::get_number_of_messages_sent();
- $cant_out_box=' ('.$number_of_outbox_message.')';
- $cant_msg = ' ('.$number_of_new_messages.')';
- $number_of_new_messages_of_friend=SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
- //echo '
'.get_lang('ViewMessages').'
';
- echo '
-
'.get_lang('Messages').'
-
- '.get_lang('Inbox').$cant_msg.'
- '.get_lang('Outbox').$cant_out_box.'
-
';
- echo '

';
- if ($number_of_new_messages_of_friend>0) {
- echo '
';
- }
- echo '
';
- }*/
- echo '
';
-}
-?>
\ No newline at end of file
diff --git a/main/social/group_contact.inc.php b/main/social/group_contact.inc.php
deleted file mode 100755
index b16602b9b7..0000000000
--- a/main/social/group_contact.inc.php
+++ /dev/null
@@ -1,97 +0,0 @@
-
- */
-
-
-$language_file = array('registration','messages','userInfo','admin');
-require '../inc/global.inc.php';
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
-require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
-require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
-require_once api_get_path(LIBRARY_PATH).'image.lib.php';
-require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
-require_once '../inc/lib/social.lib.php';
-$this_section = SECTION_MYPROFILE;
-$_SESSION['this_section']=$this_section;
-$list_path_friends=array();
-$list_groups=array();
-$request=api_is_xml_http_request();
-$language_variable=api_xml_http_response_encode(get_lang('ContactsGroups'));
-//api_display_tool_title($language_variable);
-$user_id=api_get_user_id();
-$list_groups=SocialManager::show_list_type_friends();
-
-
-
-for ($p=0;$p
-
-
-
-
- |
-
- 'btn_'.$list_groups[$p]['id'])); ?>
-
- |
-
-
-
-
-
- for ($k=0;$k<$loop_friends;$k++) {
- if ($j==$number_of_images) {
- $number_of_images=$number_of_images*2;
- }
- while ($j<$number_of_images) {
- if ($list_friends_file[$j]<>"") {
- $user_info=api_get_user_info($list_friends_id[$j]);
- $user_name=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
- if($list_friends_file[$j]==='unknown.jpg') {
- $big='';
- } else {
- $big='big_';
- }
- $friends_profile = SocialManager::get_picture_user($list_friends_id[$j], $list_friends_file[$j], 92);
- $friend_html.=' ';
- }
- $j++;
- }
- }
- echo $friend_html;
- }
- else {
- echo api_xml_http_response_encode(get_lang('YouDontHaveContactsInThisGroup'));
- }
- ?>
-
- |
-
-
-
\ No newline at end of file
diff --git a/main/social/personal_data.php b/main/social/personal_data.php
deleted file mode 100755
index f8859fcc34..0000000000
--- a/main/social/personal_data.php
+++ /dev/null
@@ -1,148 +0,0 @@
-'.get_lang('GotoCourse').'';
- $course_id=CourseManager::get_course_id_by_database_name($course_db);
-
- if (api_is_user_of_course($course_id,api_get_user_id())) {
-
- $table_forums = Database :: get_course_table(TABLE_FORUM,$course_db);
- $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD,$course_db);
- $table_posts = Database :: get_course_table(TABLE_FORUM_POST,$course_db);
- $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY,$course_db);
- $table_users = Database :: get_main_table(TABLE_MAIN_USER);
-
- //------Forum messages
-
- $forum_result = get_all_post_from_user($user_id, $course_db);
- $all_result_data = 0;
- if ($forum_result !='') {
- api_display_tool_title(get_lang('Forum'));
- echo '';
- echo api_xml_http_response_encode($forum_result);
- echo '
';
- echo '
';
- $all_result_data++;
- }
-
- //------Blog posts
- $result = get_blog_post_from_user($course_db, $user_id);
- if (!empty($result)) {
- echo '
';
- api_display_tool_title(api_xml_http_response_encode(get_lang('BlogPosts')));
- echo '';
- echo api_xml_http_response_encode($result);
- echo '
';
- echo '
';
- $all_result_data++;
- }
-
- //------Blog comments
- $result = get_blog_comment_from_user($course_db, $user_id);
- if (!empty($result)) {
- api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments')));
- echo '';
- echo api_xml_http_response_encode($result);
- echo '
';
- echo '
';
- $all_result_data++;
- }
- if ($all_result_data == 0) {
- echo api_xml_http_response_encode(get_lang('NoDataAvailable'));
- }
-
- } else {
- echo '
';
- api_display_tool_title(api_xml_http_response_encode(get_lang('Details')));
- echo '';
- echo api_xml_http_response_encode(get_lang('UserNonRegisteredAtTheCourse'));
- echo '
';
- echo '
';
- echo '
';
- }
- break;
- case 'unload_course' :
- //echo 'load2';
- break;
- default:
-
- }
-} else {
- // normal behavior
-$request=api_is_xml_http_request();
-$language_variable=api_xml_http_response_encode(get_lang('PersonalData'));
-//api_display_tool_title($language_variable);
-
- echo '';
- echo '';
- echo '
';
- echo '
- '.api_xml_http_response_encode(get_lang('UserName')).'
- - '. api_xml_http_response_encode($user_info['username']).'
';
- if (api_is_western_name_order()) {
- echo '
- '.api_xml_http_response_encode(get_lang('FirstName')).'
- - '. api_xml_http_response_encode($user_info['firstname']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('LastName')).'
- - '. api_xml_http_response_encode($user_info['lastname']).'
';
- } else {
- echo '
- '.api_xml_http_response_encode(get_lang('LastName')).'
- '. api_xml_http_response_encode($user_info['lastname']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('FirstName')).'
- '. api_xml_http_response_encode($user_info['firstname']).'
';
- }
- echo '
- '.api_xml_http_response_encode(get_lang('OfficialCode')).'
- - '. api_xml_http_response_encode($user_info['official_code']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('Email')).'
- - '. api_xml_http_response_encode($user_info['email']).'
';
- echo '
- '.api_xml_http_response_encode(get_lang('Phone')).'
- - '. api_xml_http_response_encode($user_info['phone']).'
';
- echo '
';
- echo '
';
- echo '
';
- echo '

';
- echo '
';
- /*if (api_get_setting('allow_message_tool')=='true') {
- require_once api_get_path(LIBRARY_PATH).'message.lib.php';
- $number_of_new_messages = MessageManager::get_new_messages();
- $number_of_outbox_message=MessageManager::get_number_of_messages_sent();
- $cant_out_box=' ('.$number_of_outbox_message.')';
- $cant_msg = ' ('.$number_of_new_messages.')';
- $number_of_new_messages_of_friend=SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
- //echo '
'.get_lang('ViewMessages').'
';
- echo '
-
'.get_lang('Messages').'
-
- '.get_lang('Inbox').$cant_msg.'
- '.get_lang('Outbox').$cant_out_box.'
-
';
- echo '

';
- if ($number_of_new_messages_of_friend>0) {
- echo '
';
- }
- echo '
';
- }*/
- echo '
';
-}
-?>
\ No newline at end of file
diff --git a/main/social/profile.php b/main/social/profile.php
index 489c477623..74b97fd25c 100755
--- a/main/social/profile.php
+++ b/main/social/profile.php
@@ -67,7 +67,7 @@ $htmlHeadXtra[] = '