@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | $message_uid = ''; |
| 51 | 51 | $message_type = array('inbox','outbox'); |
| 52 | 52 | if (in_array($_GET['type'],$message_type)) { |
| 53 | - if ($_GET['type'] == 'inbox') { |
|
| 54 | - $message_uid = $row_users['user_receiver_id']; |
|
| 55 | - } else { |
|
| 56 | - $message_uid = $row_users['user_sender_id']; |
|
| 57 | - } |
|
| 53 | + if ($_GET['type'] == 'inbox') { |
|
| 54 | + $message_uid = $row_users['user_receiver_id']; |
|
| 55 | + } else { |
|
| 56 | + $message_uid = $row_users['user_sender_id']; |
|
| 57 | + } |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // allow to the correct user for download this file |
@@ -62,19 +62,19 @@ discard block |
||
| 62 | 62 | $userGroup = new UserGroup(); |
| 63 | 63 | |
| 64 | 64 | if (!empty($row_users['group_id'])) { |
| 65 | - $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
|
| 66 | - if (!in_array($current_uid,array_keys($users_group))) { |
|
| 67 | - $not_allowed_to_edit = true; |
|
| 68 | - } |
|
| 65 | + $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
|
| 66 | + if (!in_array($current_uid,array_keys($users_group))) { |
|
| 67 | + $not_allowed_to_edit = true; |
|
| 68 | + } |
|
| 69 | 69 | } else { |
| 70 | - if ($current_uid != $message_uid) { |
|
| 71 | - $not_allowed_to_edit = true; |
|
| 72 | - } |
|
| 70 | + if ($current_uid != $message_uid) { |
|
| 71 | + $not_allowed_to_edit = true; |
|
| 72 | + } |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if ($not_allowed_to_edit) { |
| 76 | - api_not_allowed(); |
|
| 77 | - exit; |
|
| 76 | + api_not_allowed(); |
|
| 77 | + exit; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // set the path directory file |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | true |
| 86 | 86 | ); |
| 87 | 87 | } else { |
| 88 | - $path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system'); |
|
| 88 | + $path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $full_file_name = $path_user_info['dir'].'message_attachments/'.$file_url; |
| 92 | 92 | |
| 93 | 93 | if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) { |
| 94 | 94 | // launch event |
| 95 | - Event::event_download($file_url); |
|
| 95 | + Event::event_download($file_url); |
|
| 96 | 96 | DocumentManager::file_send_for_download($full_file_name,TRUE, $title); |
| 97 | 97 | } |
| 98 | 98 | exit; |
@@ -9,20 +9,20 @@ discard block |
||
| 9 | 9 | api_block_anonymous_users(); |
| 10 | 10 | |
| 11 | 11 | if (isset($_GET['messages_page_nr'])) { |
| 12 | - if (api_get_setting('allow_social_tool')=='true' && |
|
| 12 | + if (api_get_setting('allow_social_tool')=='true' && |
|
| 13 | 13 | api_get_setting('allow_message_tool')=='true' |
| 14 | 14 | ) { |
| 15 | - $social_link = ''; |
|
| 16 | - if ($_REQUEST['f']=='social') { |
|
| 17 | - $social_link = '&f=social'; |
|
| 18 | - } |
|
| 19 | - header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
|
| 20 | - exit; |
|
| 21 | - } |
|
| 15 | + $social_link = ''; |
|
| 16 | + if ($_REQUEST['f']=='social') { |
|
| 17 | + $social_link = '&f=social'; |
|
| 18 | + } |
|
| 19 | + header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
|
| 20 | + exit; |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if (api_get_setting('allow_message_tool')!='true'){ |
| 25 | - api_not_allowed(); |
|
| 25 | + api_not_allowed(); |
|
| 26 | 26 | } |
| 27 | 27 | //jquery thickbox already called from main/inc/header.inc.php |
| 28 | 28 | |
@@ -54,13 +54,13 @@ discard block |
||
| 54 | 54 | MAIN CODE |
| 55 | 55 | */ |
| 56 | 56 | if (isset($_GET['f']) && $_GET['f']=='social') { |
| 57 | - $this_section = SECTION_SOCIAL; |
|
| 58 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
| 59 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
| 57 | + $this_section = SECTION_SOCIAL; |
|
| 58 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
| 59 | + $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
| 60 | 60 | } else { |
| 61 | - $this_section = SECTION_MYPROFILE; |
|
| 62 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
| 63 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
| 61 | + $this_section = SECTION_MYPROFILE; |
|
| 62 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
| 63 | + $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $actions = ''; |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') { |
| 85 | 85 | for ($i = 1; $i <= $count_delete_outbox; $i++) { |
| 86 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
| 87 | - } |
|
| 86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
| 87 | + } |
|
| 88 | 88 | $message_box=get_lang('SelectedMessagesDeleted'). |
| 89 | 89 | '  |
| 90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
@@ -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 | |
@@ -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(); |
@@ -56,40 +56,40 @@ discard block |
||
| 56 | 56 | $theme = 'chamilo'; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $css_path = 'app/Resources/public/css/'; |
|
| 60 | - $css_web_assets = 'web/assets/'; |
|
| 61 | - $css_web_path = 'web/css/'; |
|
| 59 | + $css_path = 'app/Resources/public/css/'; |
|
| 60 | + $css_web_assets = 'web/assets/'; |
|
| 61 | + $css_web_path = 'web/css/'; |
|
| 62 | 62 | $themePath = $css_path.'themes/'.$theme.'/default.css'; |
| 63 | 63 | $css_web_fontawesome = $css_web_assets.'fontawesome/css/font-awesome.css'; |
| 64 | - $bootstrap_file = $css_web_assets.'bootstrap/dist/css/bootstrap.min.css'; |
|
| 65 | - $css_base_file = $css_web_path.'base.css'; |
|
| 64 | + $bootstrap_file = $css_web_assets.'bootstrap/dist/css/bootstrap.min.css'; |
|
| 65 | + $css_base_file = $css_web_path.'base.css'; |
|
| 66 | 66 | |
| 67 | 67 | $css_list = array($bootstrap_file, $css_base_file, $themePath); |
| 68 | 68 | |
| 69 | 69 | $web_img = 'main/img'; |
| 70 | - $root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/'; |
|
| 71 | - $root_rel = htmlentities($_SERVER['PHP_SELF']); |
|
| 72 | - if (!empty($root_rel)) { |
|
| 73 | - $pos = strrpos($root_rel, '/'); |
|
| 74 | - $root_rel = substr($root_rel, 0, $pos - strlen($root_rel) + 1); |
|
| 75 | - if (strpos($root_rel, '/main/') !== false) { |
|
| 76 | - $pos = 0; |
|
| 77 | - while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/main/')) !== false) { |
|
| 78 | - $pos = $test_pos + 1; |
|
| 79 | - } |
|
| 80 | - $root_rel = substr($root_rel, 0, $pos); |
|
| 81 | - } elseif (strpos($root_rel, '/courses/') !== false) { |
|
| 82 | - $pos = 0; |
|
| 83 | - while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) { |
|
| 84 | - $pos = $test_pos + 1; |
|
| 85 | - } |
|
| 86 | - $root_rel = substr($root_rel, 0, $pos); |
|
| 87 | - } |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - $installation_guide_url = $root_rel.'documentation/installation_guide.html'; |
|
| 91 | - |
|
| 92 | - $css_def = ''; |
|
| 70 | + $root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/'; |
|
| 71 | + $root_rel = htmlentities($_SERVER['PHP_SELF']); |
|
| 72 | + if (!empty($root_rel)) { |
|
| 73 | + $pos = strrpos($root_rel, '/'); |
|
| 74 | + $root_rel = substr($root_rel, 0, $pos - strlen($root_rel) + 1); |
|
| 75 | + if (strpos($root_rel, '/main/') !== false) { |
|
| 76 | + $pos = 0; |
|
| 77 | + while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/main/')) !== false) { |
|
| 78 | + $pos = $test_pos + 1; |
|
| 79 | + } |
|
| 80 | + $root_rel = substr($root_rel, 0, $pos); |
|
| 81 | + } elseif (strpos($root_rel, '/courses/') !== false) { |
|
| 82 | + $pos = 0; |
|
| 83 | + while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) { |
|
| 84 | + $pos = $test_pos + 1; |
|
| 85 | + } |
|
| 86 | + $root_rel = substr($root_rel, 0, $pos); |
|
| 87 | + } |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + $installation_guide_url = $root_rel.'documentation/installation_guide.html'; |
|
| 91 | + |
|
| 92 | + $css_def = ''; |
|
| 93 | 93 | foreach ($css_list as $css_item) { |
| 94 | 94 | $css_base_chamilo_file = $root_sys.$css_item; |
| 95 | 95 | if (file_exists($css_base_chamilo_file)) { |
@@ -97,33 +97,33 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $global_error_message = array(); |
|
| 101 | - |
|
| 102 | - switch ($global_error_code) { |
|
| 103 | - case 1: |
|
| 104 | - $global_error_message['section'] = $SectionSystemRequirementsProblem; |
|
| 105 | - $global_error_message['title'] = $IncorrectPhpVersionTitle; |
|
| 106 | - $php_version = function_exists('phpversion') ? phpversion() : (defined('PHP_VERSION') ? PHP_VERSION : ''); |
|
| 107 | - $php_version = empty($php_version) ? '' : '(PHP '.$php_version.')'; |
|
| 108 | - $IncorrectPhpVersionDescription = str_replace('%s1', $php_version, $IncorrectPhpVersionDescription); |
|
| 109 | - $IncorrectPhpVersionDescription = str_replace('%s2', REQUIRED_PHP_VERSION, $IncorrectPhpVersionDescription); |
|
| 110 | - $pos = strpos($IncorrectPhpVersionDescription, '%s3'); |
|
| 111 | - if ($pos !== false) { |
|
| 112 | - $length = strlen($IncorrectPhpVersionDescription); |
|
| 113 | - $read_installation_guide = substr($IncorrectPhpVersionDescription, $pos + 3, $length); |
|
| 114 | - $IncorrectPhpVersionDescription = substr($IncorrectPhpVersionDescription, 0, $pos); |
|
| 115 | - $IncorrectPhpVersionDescription .= '<br /><a class="btn btn-default" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>'; |
|
| 116 | - } |
|
| 117 | - $global_error_message['description'] = $IncorrectPhpVersionDescription; |
|
| 118 | - break; |
|
| 119 | - case 2: |
|
| 120 | - $global_error_message['section'] = $SectionInstallation; |
|
| 121 | - $global_error_message['title'] = $InstallationTitle; |
|
| 122 | - if (($pos = strpos($InstallationDescription, '%s')) === false) { |
|
| 123 | - $InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide'; |
|
| 124 | - } |
|
| 125 | - $read_installation_guide = substr($InstallationDescription, $pos + 2); |
|
| 126 | - $InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get"> |
|
| 100 | + $global_error_message = array(); |
|
| 101 | + |
|
| 102 | + switch ($global_error_code) { |
|
| 103 | + case 1: |
|
| 104 | + $global_error_message['section'] = $SectionSystemRequirementsProblem; |
|
| 105 | + $global_error_message['title'] = $IncorrectPhpVersionTitle; |
|
| 106 | + $php_version = function_exists('phpversion') ? phpversion() : (defined('PHP_VERSION') ? PHP_VERSION : ''); |
|
| 107 | + $php_version = empty($php_version) ? '' : '(PHP '.$php_version.')'; |
|
| 108 | + $IncorrectPhpVersionDescription = str_replace('%s1', $php_version, $IncorrectPhpVersionDescription); |
|
| 109 | + $IncorrectPhpVersionDescription = str_replace('%s2', REQUIRED_PHP_VERSION, $IncorrectPhpVersionDescription); |
|
| 110 | + $pos = strpos($IncorrectPhpVersionDescription, '%s3'); |
|
| 111 | + if ($pos !== false) { |
|
| 112 | + $length = strlen($IncorrectPhpVersionDescription); |
|
| 113 | + $read_installation_guide = substr($IncorrectPhpVersionDescription, $pos + 3, $length); |
|
| 114 | + $IncorrectPhpVersionDescription = substr($IncorrectPhpVersionDescription, 0, $pos); |
|
| 115 | + $IncorrectPhpVersionDescription .= '<br /><a class="btn btn-default" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>'; |
|
| 116 | + } |
|
| 117 | + $global_error_message['description'] = $IncorrectPhpVersionDescription; |
|
| 118 | + break; |
|
| 119 | + case 2: |
|
| 120 | + $global_error_message['section'] = $SectionInstallation; |
|
| 121 | + $global_error_message['title'] = $InstallationTitle; |
|
| 122 | + if (($pos = strpos($InstallationDescription, '%s')) === false) { |
|
| 123 | + $InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide'; |
|
| 124 | + } |
|
| 125 | + $read_installation_guide = substr($InstallationDescription, $pos + 2); |
|
| 126 | + $InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get"> |
|
| 127 | 127 | <div class="row"><div class="col-md-12"> |
| 128 | 128 | |
| 129 | 129 | <div class="office"> |
@@ -135,38 +135,38 @@ discard block |
||
| 135 | 135 | </p> |
| 136 | 136 | </div> |
| 137 | 137 | </form>'; |
| 138 | - $global_error_message['description'] = $InstallationDescription; |
|
| 139 | - break; |
|
| 140 | - case 3: |
|
| 141 | - case 4: |
|
| 142 | - case 5: |
|
| 143 | - $global_error_message['section'] = $SectionDatabaseUnavailable; |
|
| 144 | - $global_error_message['title'] = $DatabaseUnavailableTitle; |
|
| 145 | - $global_error_message['description'] = $DatabaseUnavailableDescription; |
|
| 146 | - break; |
|
| 147 | - case 6: |
|
| 148 | - $global_error_message['section'] = $SectionProtection; |
|
| 149 | - $global_error_message['title'] = $AlreadyInstalledTitle; |
|
| 150 | - $global_error_message['description'] = $AlreadyInstalledDescription; |
|
| 151 | - break; |
|
| 152 | - default: |
|
| 153 | - $global_error_message['section'] = $SectionTechnicalIssues; |
|
| 154 | - $global_error_message['title'] = $TechnicalIssuesTitle; |
|
| 155 | - $global_error_message['description'] = $TechnicalIssuesDescription; |
|
| 156 | - break; |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - $show_error_codes = defined('SHOW_ERROR_CODES') && SHOW_ERROR_CODES && $global_error_code != 2; |
|
| 160 | - $global_error_message['code'] = $show_error_codes ? $ErrorCode.': '.$global_error_code.'<br /><br />' : ''; |
|
| 161 | - $global_error_message['details'] = empty($global_error_message['details']) ? '' : ($show_error_codes ? ': '.$global_error_message['details'] : $global_error_message['details']); |
|
| 162 | - $global_error_message['organisation'] = $Organisation; |
|
| 163 | - $global_error_message['powered_by'] = $PoweredBy; |
|
| 164 | - $global_error_message['encoding'] = 'UTF-8'; |
|
| 165 | - $global_error_message['chamilo_logo'] = "data:image/png;base64,".base64_encode(file_get_contents($root_sys.'web/css/themes/'.$theme.'/images/header-logo.png')); |
|
| 138 | + $global_error_message['description'] = $InstallationDescription; |
|
| 139 | + break; |
|
| 140 | + case 3: |
|
| 141 | + case 4: |
|
| 142 | + case 5: |
|
| 143 | + $global_error_message['section'] = $SectionDatabaseUnavailable; |
|
| 144 | + $global_error_message['title'] = $DatabaseUnavailableTitle; |
|
| 145 | + $global_error_message['description'] = $DatabaseUnavailableDescription; |
|
| 146 | + break; |
|
| 147 | + case 6: |
|
| 148 | + $global_error_message['section'] = $SectionProtection; |
|
| 149 | + $global_error_message['title'] = $AlreadyInstalledTitle; |
|
| 150 | + $global_error_message['description'] = $AlreadyInstalledDescription; |
|
| 151 | + break; |
|
| 152 | + default: |
|
| 153 | + $global_error_message['section'] = $SectionTechnicalIssues; |
|
| 154 | + $global_error_message['title'] = $TechnicalIssuesTitle; |
|
| 155 | + $global_error_message['description'] = $TechnicalIssuesDescription; |
|
| 156 | + break; |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + $show_error_codes = defined('SHOW_ERROR_CODES') && SHOW_ERROR_CODES && $global_error_code != 2; |
|
| 160 | + $global_error_message['code'] = $show_error_codes ? $ErrorCode.': '.$global_error_code.'<br /><br />' : ''; |
|
| 161 | + $global_error_message['details'] = empty($global_error_message['details']) ? '' : ($show_error_codes ? ': '.$global_error_message['details'] : $global_error_message['details']); |
|
| 162 | + $global_error_message['organisation'] = $Organisation; |
|
| 163 | + $global_error_message['powered_by'] = $PoweredBy; |
|
| 164 | + $global_error_message['encoding'] = 'UTF-8'; |
|
| 165 | + $global_error_message['chamilo_logo'] = "data:image/png;base64,".base64_encode(file_get_contents($root_sys.'web/css/themes/'.$theme.'/images/header-logo.png')); |
|
| 166 | 166 | |
| 167 | 167 | $installChamiloImage = base64_encode(file_get_contents("$root_sys/main/img/install-chamilo.gif")); |
| 168 | 168 | |
| 169 | - $global_error_message_page = |
|
| 169 | + $global_error_message_page = |
|
| 170 | 170 | <<<EOM |
| 171 | 171 | <!DOCTYPE html> |
| 172 | 172 | <html> |
@@ -236,9 +236,9 @@ discard block |
||
| 236 | 236 | </body> |
| 237 | 237 | </html> |
| 238 | 238 | EOM; |
| 239 | - foreach ($global_error_message as $key => $value) { |
|
| 240 | - $global_error_message_page = str_replace('{'.strtoupper($key).'}', $value, $global_error_message_page); |
|
| 241 | - } |
|
| 242 | - header('Content-Type: text/html; charset='.$global_error_message['encoding']); |
|
| 243 | - die($global_error_message_page); |
|
| 239 | + foreach ($global_error_message as $key => $value) { |
|
| 240 | + $global_error_message_page = str_replace('{'.strtoupper($key).'}', $value, $global_error_message_page); |
|
| 241 | + } |
|
| 242 | + header('Content-Type: text/html; charset='.$global_error_message['encoding']); |
|
| 243 | + die($global_error_message_page); |
|
| 244 | 244 | } |