@@ -7,40 +7,40 @@ |
||
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | 9 | if (api_get_setting('allow_message_tool')!='true') { |
10 | - api_not_allowed(); |
|
10 | + api_not_allowed(); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { |
14 | - $this_section = SECTION_SOCIAL; |
|
15 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
16 | - $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox')); |
|
14 | + $this_section = SECTION_SOCIAL; |
|
15 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
16 | + $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox')); |
|
17 | 17 | } else { |
18 | - $this_section = SECTION_MYPROFILE; |
|
19 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
18 | + $this_section = SECTION_MYPROFILE; |
|
19 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $social_right_content = null; |
23 | 23 | |
24 | 24 | if (isset($_GET['f']) && $_GET['f']=='social') { |
25 | - $social_parameter = '?f=social'; |
|
25 | + $social_parameter = '?f=social'; |
|
26 | 26 | } else { |
27 | - if (api_get_setting('extended_profile') == 'true') { |
|
28 | - $social_right_content .= '<div class="actions">'; |
|
27 | + if (api_get_setting('extended_profile') == 'true') { |
|
28 | + $social_right_content .= '<div class="actions">'; |
|
29 | 29 | |
30 | - if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
31 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
30 | + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
31 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
32 | 32 | Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
33 | - } |
|
34 | - if (api_get_setting('allow_message_tool') == 'true') { |
|
35 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
33 | + } |
|
34 | + if (api_get_setting('allow_message_tool') == 'true') { |
|
35 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
36 | 36 | Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
37 | 37 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
38 | 38 | Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
39 | 39 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
40 | 40 | Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
41 | - } |
|
42 | - $social_right_content .= '</div>'; |
|
43 | - } |
|
41 | + } |
|
42 | + $social_right_content .= '</div>'; |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if (empty($_GET['id'])) { |
@@ -74,37 +74,37 @@ discard block |
||
74 | 74 | * Shows the compose area + a list of users to select from. |
75 | 75 | */ |
76 | 76 | function show_compose_to_any($user_id) { |
77 | - $online_user_list = MessageManager::get_online_user_list($user_id); |
|
78 | - $default['user_list'] = 0; |
|
79 | - $online_user_list=null; |
|
80 | - $html = manage_form($default, $online_user_list); |
|
77 | + $online_user_list = MessageManager::get_online_user_list($user_id); |
|
78 | + $default['user_list'] = 0; |
|
79 | + $online_user_list=null; |
|
80 | + $html = manage_form($default, $online_user_list); |
|
81 | 81 | return $html; |
82 | 82 | } |
83 | 83 | |
84 | 84 | function show_compose_reply_to_message($message_id, $receiver_id) |
85 | 85 | { |
86 | - $table_message = Database::get_main_table(TABLE_MESSAGE); |
|
87 | - $query = "SELECT user_sender_id FROM $table_message |
|
86 | + $table_message = Database::get_main_table(TABLE_MESSAGE); |
|
87 | + $query = "SELECT user_sender_id FROM $table_message |
|
88 | 88 | WHERE user_receiver_id=".intval($receiver_id)." AND id='".intval($message_id)."';"; |
89 | - $result = Database::query($query); |
|
90 | - $row = Database::fetch_array($result,'ASSOC'); |
|
91 | - if (!isset($row['user_sender_id'])) { |
|
92 | - $html = get_lang('InvalidMessageId'); |
|
89 | + $result = Database::query($query); |
|
90 | + $row = Database::fetch_array($result,'ASSOC'); |
|
91 | + if (!isset($row['user_sender_id'])) { |
|
92 | + $html = get_lang('InvalidMessageId'); |
|
93 | 93 | |
94 | - return $html; |
|
95 | - } |
|
96 | - $userInfo = api_get_user_info($row['user_sender_id']); |
|
97 | - $default['users'] = array($row['user_sender_id']); |
|
98 | - $html = manage_form($default, null, $userInfo['complete_name']); |
|
94 | + return $html; |
|
95 | + } |
|
96 | + $userInfo = api_get_user_info($row['user_sender_id']); |
|
97 | + $default['users'] = array($row['user_sender_id']); |
|
98 | + $html = manage_form($default, null, $userInfo['complete_name']); |
|
99 | 99 | |
100 | 100 | return $html; |
101 | 101 | } |
102 | 102 | |
103 | 103 | function show_compose_to_user ($receiver_id) { |
104 | - $html = get_lang('To').': <strong>'.GetFullUserName($receiver_id).'</strong>'; |
|
105 | - $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
|
106 | - $default['users'] = array($receiver_id); |
|
107 | - $html .= manage_form($default); |
|
104 | + $html = get_lang('To').': <strong>'.GetFullUserName($receiver_id).'</strong>'; |
|
105 | + $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
|
106 | + $default['users'] = array($receiver_id); |
|
107 | + $html .= manage_form($default); |
|
108 | 108 | return $html; |
109 | 109 | } |
110 | 110 | |
@@ -251,13 +251,13 @@ discard block |
||
251 | 251 | |
252 | 252 | /* MAIN SECTION */ |
253 | 253 | if ($socialToolIsActive) { |
254 | - $this_section = SECTION_SOCIAL; |
|
254 | + $this_section = SECTION_SOCIAL; |
|
255 | 255 | $interbreadcrumb[] = array( |
256 | 256 | 'url' => api_get_path(WEB_PATH).'main/social/home.php', |
257 | 257 | 'name' => get_lang('SocialNetwork'), |
258 | 258 | ); |
259 | 259 | } else { |
260 | - $this_section = SECTION_MYPROFILE; |
|
260 | + $this_section = SECTION_MYPROFILE; |
|
261 | 261 | $interbreadcrumb[] = array( |
262 | 262 | 'url' => api_get_path(WEB_PATH).'main/auth/profile.php', |
263 | 263 | 'name' => get_lang('Profile'), |
@@ -267,30 +267,30 @@ discard block |
||
267 | 267 | $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; |
268 | 268 | $social_right_content = null; |
269 | 269 | if ($group_id != 0) { |
270 | - $social_right_content .= '<div class=actions>'; |
|
271 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
|
272 | - Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
273 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
|
274 | - Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
275 | - $social_right_content .= '</div>'; |
|
270 | + $social_right_content .= '<div class=actions>'; |
|
271 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
|
272 | + Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
273 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
|
274 | + Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
275 | + $social_right_content .= '</div>'; |
|
276 | 276 | } else { |
277 | - if ($socialToolIsActive) { |
|
278 | - } else { |
|
279 | - $social_right_content .= '<div class=actions>'; |
|
280 | - if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
281 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
277 | + if ($socialToolIsActive) { |
|
278 | + } else { |
|
279 | + $social_right_content .= '<div class=actions>'; |
|
280 | + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
281 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
282 | 282 | Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
283 | - } |
|
284 | - if (api_get_setting('allow_message_tool') == 'true') { |
|
285 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
283 | + } |
|
284 | + if (api_get_setting('allow_message_tool') == 'true') { |
|
285 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
286 | 286 | Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
287 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
287 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
288 | 288 | Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
289 | 289 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
290 | 290 | Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
291 | - } |
|
292 | - $social_right_content .= '</div>'; |
|
293 | - } |
|
291 | + } |
|
292 | + $social_right_content .= '</div>'; |
|
293 | + } |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | // LEFT COLUMN |
@@ -636,11 +636,11 @@ |
||
636 | 636 | } |
637 | 637 | $formToDisplay = $form->returnForm(); |
638 | 638 | } else { |
639 | - if (!empty($sessionId)) { |
|
640 | - $sessionInfo = api_get_session_info($sessionId); |
|
641 | - $startDate = $sessionInfo['access_start_date']; |
|
642 | - $endDate = $sessionInfo['access_end_date']; |
|
643 | - } |
|
639 | + if (!empty($sessionId)) { |
|
640 | + $sessionInfo = api_get_session_info($sessionId); |
|
641 | + $startDate = $sessionInfo['access_start_date']; |
|
642 | + $endDate = $sessionInfo['access_end_date']; |
|
643 | + } |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | $attendance = new Attendance(); |
@@ -91,7 +91,7 @@ |
||
91 | 91 | $content .= '<div class="courseadminview-activity-3col"><span class="viewcaption">'.get_lang('SessionData').'</span> |
92 | 92 | <table width="100%">'; |
93 | 93 | $content .= CourseHome::show_session_data($session_id); |
94 | - $content .= '</table></div>'; |
|
94 | + $content .= '</table></div>'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $content .= '<div class="Authoringview">'; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | if (Database::num_rows($result) == 0) { |
229 | 229 | $condition = ''; |
230 | 230 | } else { |
231 | - //great, there is an specific auto launch for this session we leave the $condition |
|
231 | + //great, there is an specific auto launch for this session we leave the $condition |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $lp_data = Database::fetch_array($result,'ASSOC'); |
241 | 241 | if (!empty($lp_data['id'])) { |
242 | 242 | if (api_is_platform_admin() || api_is_allowed_to_edit()) { |
243 | - $show_autolaunch_lp_warning = true; |
|
243 | + $show_autolaunch_lp_warning = true; |
|
244 | 244 | } else { |
245 | 245 | $session_key = 'lp_autolaunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id(); |
246 | 246 | if (!isset($_SESSION[$session_key])) { |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | |
266 | 266 | /* Introduction section (editable by course admins) */ |
267 | 267 | $content = Display::return_introduction_section(TOOL_COURSE_HOMEPAGE, array( |
268 | - 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', |
|
269 | - 'CreateDocumentDir' => 'document/', |
|
270 | - 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/' |
|
271 | - ) |
|
268 | + 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', |
|
269 | + 'CreateDocumentDir' => 'document/', |
|
270 | + 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/' |
|
271 | + ) |
|
272 | 272 | ); |
273 | 273 | |
274 | 274 | /* SWITCH TO A DIFFERENT HOMEPAGE VIEW |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | if (api_get_setting('homepage_view') == 'activity' || |
286 | 286 | api_get_setting('homepage_view') == 'activity_big' |
287 | 287 | ) { |
288 | - require 'activity.php'; |
|
288 | + require 'activity.php'; |
|
289 | 289 | } elseif (api_get_setting('homepage_view') == '2column') { |
290 | - require '2column.php'; |
|
290 | + require '2column.php'; |
|
291 | 291 | } elseif (api_get_setting('homepage_view') == '3column') { |
292 | - require '3column.php'; |
|
292 | + require '3column.php'; |
|
293 | 293 | } elseif (api_get_setting('homepage_view') == 'vertical_activity') { |
294 | - require 'vertical_activity.php'; |
|
294 | + require 'vertical_activity.php'; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $mycourseid = api_get_course_id(); |
38 | 38 | if (!empty($mycourseid) && $mycourseid != -1) { |
39 | - $open_chat_window = api_get_course_setting('allow_open_chat_window'); |
|
39 | + $open_chat_window = api_get_course_setting('allow_open_chat_window'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $courseCode = Security::remove_XSS($_GET['cidReq']); |
@@ -54,21 +54,21 @@ discard block |
||
54 | 54 | |
55 | 55 | // If it is a group chat then the breadcrumbs. |
56 | 56 | if (!empty($groupId)) { |
57 | - $group_properties = GroupManager :: get_group_properties($groupId); |
|
57 | + $group_properties = GroupManager :: get_group_properties($groupId); |
|
58 | 58 | $interbreadcrumb[] = array( |
59 | 59 | 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), |
60 | 60 | 'name' => get_lang('Groups') |
61 | 61 | ); |
62 | - $interbreadcrumb[] = array( |
|
62 | + $interbreadcrumb[] = array( |
|
63 | 63 | 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
64 | 64 | 'name' => get_lang('GroupSpace').' '.$group_properties['name'] |
65 | 65 | ); |
66 | - $noPHP_SELF = true; |
|
67 | - $shortBanner = false; |
|
68 | - $add_group_to_title = ' ('.$group_properties['name'].')'; |
|
69 | - $groupfilter = 'group_id="'.$groupId.'"'; |
|
66 | + $noPHP_SELF = true; |
|
67 | + $shortBanner = false; |
|
68 | + $add_group_to_title = ' ('.$group_properties['name'].')'; |
|
69 | + $groupfilter = 'group_id="'.$groupId.'"'; |
|
70 | 70 | } else { |
71 | - $groupfilter = 'group_id=0'; |
|
71 | + $groupfilter = 'group_id=0'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | if (empty($open_chat_window)) { |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | $filename_chat = 'messages-'.$date_now.'.log.html'; |
79 | 79 | } |
80 | 80 | |
81 | - if (!file_exists($chat_path.$filename_chat)) { |
|
82 | - @fclose(fopen($chat_path.$filename_chat, 'w')); |
|
83 | - if (!api_is_anonymous()) { |
|
84 | - $doc_id = add_document($_course, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat); |
|
81 | + if (!file_exists($chat_path.$filename_chat)) { |
|
82 | + @fclose(fopen($chat_path.$filename_chat, 'w')); |
|
83 | + if (!api_is_anonymous()) { |
|
84 | + $doc_id = add_document($_course, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat); |
|
85 | 85 | api_item_property_update( |
86 | 86 | $_course, |
87 | 87 | TOOL_DOCUMENT, |
@@ -107,28 +107,28 @@ discard block |
||
107 | 107 | $session_id |
108 | 108 | ); |
109 | 109 | item_property_update_on_folder($_course, $basepath_chat, $userId); |
110 | - } |
|
111 | - } |
|
110 | + } |
|
111 | + } |
|
112 | 112 | |
113 | - $basename_chat = ''; |
|
114 | - if (!empty($group_id)) { |
|
115 | - $basename_chat = 'messages-'.$date_now.'_gid-'.$group_id; |
|
116 | - } else if (!empty($session_id)) { |
|
117 | - $basename_chat = 'messages-'.$date_now.'_sid-'.$session_id; |
|
118 | - } else { |
|
119 | - $basename_chat = 'messages-'.$date_now; |
|
120 | - } |
|
113 | + $basename_chat = ''; |
|
114 | + if (!empty($group_id)) { |
|
115 | + $basename_chat = 'messages-'.$date_now.'_gid-'.$group_id; |
|
116 | + } else if (!empty($session_id)) { |
|
117 | + $basename_chat = 'messages-'.$date_now.'_sid-'.$session_id; |
|
118 | + } else { |
|
119 | + $basename_chat = 'messages-'.$date_now; |
|
120 | + } |
|
121 | 121 | |
122 | - if ($reset && $isMaster) { |
|
122 | + if ($reset && $isMaster) { |
|
123 | 123 | |
124 | - $i = 1; |
|
125 | - while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) { |
|
126 | - $i++; |
|
127 | - } |
|
124 | + $i = 1; |
|
125 | + while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) { |
|
126 | + $i++; |
|
127 | + } |
|
128 | 128 | |
129 | - @rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html'); |
|
130 | - @fclose(fopen($chat_path.$basename_chat.'.log.html', 'w')); |
|
131 | - $doc_id = add_document($_course, $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html', 'file', filesize($chat_path.$basename_chat.'-'.$i.'.log.html'), $basename_chat.'-'.$i.'.log.html'); |
|
129 | + @rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html'); |
|
130 | + @fclose(fopen($chat_path.$basename_chat.'.log.html', 'w')); |
|
131 | + $doc_id = add_document($_course, $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html', 'file', filesize($chat_path.$basename_chat.'-'.$i.'.log.html'), $basename_chat.'-'.$i.'.log.html'); |
|
132 | 132 | |
133 | 133 | api_item_property_update( |
134 | 134 | $_course, |
@@ -161,57 +161,57 @@ discard block |
||
161 | 161 | $basepath_chat.'/'.$basename_chat.'.log.html' |
162 | 162 | ); |
163 | 163 | |
164 | - update_existing_document($_course, $doc_id, 0); |
|
165 | - } |
|
166 | - |
|
167 | - $remove = 0; |
|
168 | - $content = array(); |
|
169 | - if (file_exists($chat_path.$basename_chat.'.log.html')) { |
|
170 | - $content = file($chat_path.$basename_chat.'.log.html'); |
|
171 | - $nbr_lines = sizeof($content); |
|
172 | - $remove = $nbr_lines - 100; |
|
173 | - } |
|
174 | - |
|
175 | - if ($remove < 0) { |
|
176 | - $remove = 0; |
|
177 | - } |
|
178 | - |
|
179 | - array_splice($content, 0, $remove); |
|
180 | - require 'header_frame.inc.php'; |
|
181 | - |
|
182 | - if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') { |
|
183 | - //the caller |
|
184 | - $content[0] = get_lang('CallSent').'<br />'.$content[0]; |
|
185 | - } |
|
186 | - if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonlinejoin') { |
|
187 | - //the joiner (we have to delete the chat request to him when he joins the chat) |
|
188 | - $track_user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
189 | - $sql = "UPDATE $track_user_table SET |
|
164 | + update_existing_document($_course, $doc_id, 0); |
|
165 | + } |
|
166 | + |
|
167 | + $remove = 0; |
|
168 | + $content = array(); |
|
169 | + if (file_exists($chat_path.$basename_chat.'.log.html')) { |
|
170 | + $content = file($chat_path.$basename_chat.'.log.html'); |
|
171 | + $nbr_lines = sizeof($content); |
|
172 | + $remove = $nbr_lines - 100; |
|
173 | + } |
|
174 | + |
|
175 | + if ($remove < 0) { |
|
176 | + $remove = 0; |
|
177 | + } |
|
178 | + |
|
179 | + array_splice($content, 0, $remove); |
|
180 | + require 'header_frame.inc.php'; |
|
181 | + |
|
182 | + if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') { |
|
183 | + //the caller |
|
184 | + $content[0] = get_lang('CallSent').'<br />'.$content[0]; |
|
185 | + } |
|
186 | + if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonlinejoin') { |
|
187 | + //the joiner (we have to delete the chat request to him when he joins the chat) |
|
188 | + $track_user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
189 | + $sql = "UPDATE $track_user_table SET |
|
190 | 190 | chatcall_user_id = '', |
191 | 191 | chatcall_date = '', |
192 | 192 | chatcall_text='' |
193 | 193 | WHERE (user_id = ".$userId.")"; |
194 | - $result = Database::query($sql); |
|
195 | - } |
|
194 | + $result = Database::query($sql); |
|
195 | + } |
|
196 | 196 | |
197 | - echo '<div id="content-chat"'; |
|
198 | - foreach ($content as & $this_line) { |
|
197 | + echo '<div id="content-chat"'; |
|
198 | + foreach ($content as & $this_line) { |
|
199 | 199 | echo $this_line; |
200 | - } |
|
201 | - echo '</div>'; |
|
202 | - echo '<a name="bottom" style="text-decoration:none;"> </a>'; |
|
203 | - if ($isMaster || $is_courseCoach) { |
|
204 | - $rand = mt_rand(1, 1000); |
|
205 | - echo '<div id="clear-chat">'; |
|
206 | - echo '<a class="btn btn-danger btn-small " href="'.api_get_self().'?rand='.$rand.'&reset=1&'.api_get_cidreq().'#bottom" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmReset'), ENT_QUOTES)).'\')) return false;">'. |
|
200 | + } |
|
201 | + echo '</div>'; |
|
202 | + echo '<a name="bottom" style="text-decoration:none;"> </a>'; |
|
203 | + if ($isMaster || $is_courseCoach) { |
|
204 | + $rand = mt_rand(1, 1000); |
|
205 | + echo '<div id="clear-chat">'; |
|
206 | + echo '<a class="btn btn-danger btn-small " href="'.api_get_self().'?rand='.$rand.'&reset=1&'.api_get_cidreq().'#bottom" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmReset'), ENT_QUOTES)).'\')) return false;">'. |
|
207 | 207 | get_lang('ClearList'). |
208 | 208 | '</a>'; |
209 | - echo '</div>'; |
|
210 | - } |
|
209 | + echo '</div>'; |
|
210 | + } |
|
211 | 211 | } else { |
212 | - echo '</div>'; |
|
213 | - require 'header_frame.inc.php'; |
|
214 | - $message = get_lang('CloseOtherSession'); |
|
215 | - Display :: display_error_message($message); |
|
212 | + echo '</div>'; |
|
213 | + require 'header_frame.inc.php'; |
|
214 | + $message = get_lang('CloseOtherSession'); |
|
215 | + Display :: display_error_message($message); |
|
216 | 216 | } |
217 | 217 | require 'footer_frame.inc.php'; |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | |
36 | 36 | $extra_condition = ''; |
37 | 37 | if (!empty($group_id)) { |
38 | - $extra_condition = $group_condition; |
|
38 | + $extra_condition = $group_condition; |
|
39 | 39 | } else { |
40 | - $extra_condition = $session_condition; |
|
40 | + $extra_condition = $session_condition; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $extra_condition.= " AND c_id = $course_id"; |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | $chat_path = ''; |
47 | 47 | $document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
48 | 48 | if (!empty($group_id)) { |
49 | - $group_info = GroupManager :: get_group_properties($group_id); |
|
50 | - $chat_path = $document_path.$group_info['directory'].'/chat_files/'; |
|
49 | + $group_info = GroupManager :: get_group_properties($group_id); |
|
50 | + $chat_path = $document_path.$group_info['directory'].'/chat_files/'; |
|
51 | 51 | } else { |
52 | - $chat_path = $document_path.'/chat_files/'; |
|
52 | + $chat_path = $document_path.'/chat_files/'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | // get chat file |
56 | 56 | $basename_chat = ''; |
57 | 57 | if (!empty($group_id)) { |
58 | - $basename_chat = 'messages-'.$date_now.'_gid-'.$group_id; |
|
58 | + $basename_chat = 'messages-'.$date_now.'_gid-'.$group_id; |
|
59 | 59 | } elseif (!empty($session_id)) { |
60 | - $basename_chat = 'messages-'.$date_now.'_sid-'.$session_id; |
|
60 | + $basename_chat = 'messages-'.$date_now.'_sid-'.$session_id; |
|
61 | 61 | } else { |
62 | - $basename_chat = 'messages-'.$date_now; |
|
62 | + $basename_chat = 'messages-'.$date_now; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $chat_size_old = isset($_POST['chat_size_old']) ? intval($_POST['chat_size_old']) : null; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $current_time = api_get_utc_datetime(); |
79 | 79 | |
80 | 80 | if (Database::num_rows($result) == 0) { |
81 | - $query = "INSERT INTO $tbl_chat_connected(c_id, user_id, last_connection,session_id,to_group_id) |
|
81 | + $query = "INSERT INTO $tbl_chat_connected(c_id, user_id, last_connection,session_id,to_group_id) |
|
82 | 82 | VALUES($course_id, '".$userId."','$current_time','$session_id','$group_id')"; |
83 | 83 | Database::query($query); |
84 | 84 | $id = Database::insert_id(); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | Database::query($sql); |
88 | 88 | } |
89 | 89 | } else { |
90 | - $query = "UPDATE $tbl_chat_connected SET |
|
90 | + $query = "UPDATE $tbl_chat_connected SET |
|
91 | 91 | last_connection='".$current_time."' |
92 | 92 | WHERE c_id = $course_id AND user_id='".$userId."' AND session_id='$session_id' AND to_group_id='$group_id'"; |
93 | 93 | Database::query($query); |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | Event::event_access_tool(TOOL_GLOSSARY); |
35 | 35 | |
36 | 36 | function sorter($item1, $item2) { |
37 | - if ($item1[2] == $item2[2]) |
|
38 | - return 0; |
|
39 | - return $item1[2] < $item2[2] ? -1 : 1; |
|
37 | + if ($item1[2] == $item2[2]) |
|
38 | + return 0; |
|
39 | + return $item1[2] < $item2[2] ? -1 : 1; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | // Displaying the header |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $list[] = array ($line[0], $line[1]); |
81 | 81 | } |
82 | 82 | $filename = 'glossary_course_'.api_get_course_id(); |
83 | - Export::arrayToCsv($list, $filename); |
|
83 | + Export::arrayToCsv($list, $filename); |
|
84 | 84 | } |
85 | 85 | if (isset($_GET['action']) && $_GET['action'] == 'export_to_pdf') { |
86 | 86 | GlossaryManager::export_to_pdf(); |