@@ -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; |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | // get message user id for inbox/outbox |
50 | 50 | $message_uid = ''; |
51 | -$message_type = array('inbox','outbox'); |
|
52 | -if (in_array($_GET['type'],$message_type)) { |
|
51 | +$message_type = array('inbox', 'outbox'); |
|
52 | +if (in_array($_GET['type'], $message_type)) { |
|
53 | 53 | if ($_GET['type'] == 'inbox') { |
54 | 54 | $message_uid = $row_users['user_receiver_id']; |
55 | 55 | } else { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | if (!empty($row_users['group_id'])) { |
65 | 65 | $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
66 | - if (!in_array($current_uid,array_keys($users_group))) { |
|
66 | + if (!in_array($current_uid, array_keys($users_group))) { |
|
67 | 67 | $not_allowed_to_edit = true; |
68 | 68 | } |
69 | 69 | } else { |
@@ -93,6 +93,6 @@ discard block |
||
93 | 93 | if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) { |
94 | 94 | // launch event |
95 | 95 | Event::event_download($file_url); |
96 | - DocumentManager::file_send_for_download($full_file_name,TRUE, $title); |
|
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">'. |
@@ -9,11 +9,11 @@ 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' && |
|
13 | - api_get_setting('allow_message_tool')=='true' |
|
12 | + if (api_get_setting('allow_social_tool') == 'true' && |
|
13 | + api_get_setting('allow_message_tool') == 'true' |
|
14 | 14 | ) { |
15 | 15 | $social_link = ''; |
16 | - if ($_REQUEST['f']=='social') { |
|
16 | + if ($_REQUEST['f'] == 'social') { |
|
17 | 17 | $social_link = '&f=social'; |
18 | 18 | } |
19 | 19 | header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (api_get_setting('allow_message_tool')!='true'){ |
|
24 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
25 | 25 | api_not_allowed(); |
26 | 26 | } |
27 | 27 | //jquery thickbox already called from main/inc/header.inc.php |
28 | 28 | |
29 | -$htmlHeadXtra[]='<script language="javascript"> |
|
29 | +$htmlHeadXtra[] = '<script language="javascript"> |
|
30 | 30 | function enviar(miforma) { |
31 | 31 | if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'")) |
32 | 32 | miforma.submit(); |
@@ -53,44 +53,44 @@ discard block |
||
53 | 53 | /* |
54 | 54 | MAIN CODE |
55 | 55 | */ |
56 | -if (isset($_GET['f']) && $_GET['f']=='social') { |
|
56 | +if (isset($_GET['f']) && $_GET['f'] == 'social') { |
|
57 | 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')); |
|
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 | 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')); |
|
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 = ''; |
67 | 67 | if (api_get_setting('extended_profile') == 'true') { |
68 | 68 | if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
69 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
|
69 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
|
70 | 70 | } |
71 | 71 | if (api_get_setting('allow_message_tool') == 'true') { |
72 | 72 | //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>'; |
73 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
74 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
75 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
73 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
74 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
75 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
80 | -$info_delete_outbox =array(); |
|
81 | -$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : ''; |
|
80 | +$info_delete_outbox = array(); |
|
81 | +$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : ''; |
|
82 | 82 | $count_delete_outbox = count($info_delete_outbox) - 1; |
83 | 83 | |
84 | -if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') { |
|
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]); |
|
86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]); |
|
87 | 87 | } |
88 | - $message_box=get_lang('SelectedMessagesDeleted'). |
|
88 | + $message_box = get_lang('SelectedMessagesDeleted'). |
|
89 | 89 | '  |
90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
91 | 91 | get_lang('BackToOutbox'). |
92 | 92 | '</a>'; |
93 | - Display::display_normal_message(api_xml_http_response_encode($message_box),false); |
|
93 | + Display::display_normal_message(api_xml_http_response_encode($message_box), false); |
|
94 | 94 | exit; |
95 | 95 | } |
96 | 96 | |
@@ -117,23 +117,23 @@ discard block |
||
117 | 117 | } |
118 | 118 | //MAIN CONTENT |
119 | 119 | if ($action == 'delete') { |
120 | - $delete_list_id=array(); |
|
120 | + $delete_list_id = array(); |
|
121 | 121 | if (isset($_POST['out'])) { |
122 | - $delete_list_id=$_POST['out']; |
|
122 | + $delete_list_id = $_POST['out']; |
|
123 | 123 | } |
124 | 124 | if (isset($_POST['id'])) { |
125 | - $delete_list_id=$_POST['id']; |
|
125 | + $delete_list_id = $_POST['id']; |
|
126 | 126 | } |
127 | 127 | for ($i = 0; $i < count($delete_list_id); $i++) { |
128 | 128 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]); |
129 | 129 | } |
130 | - $delete_list_id=array(); |
|
130 | + $delete_list_id = array(); |
|
131 | 131 | $social_right_content .= MessageManager::outbox_display($keyword); |
132 | 132 | } elseif ($action == 'deleteone') { |
133 | 133 | $delete_list_id = array(); |
134 | 134 | $id = Security::remove_XSS($_GET['id']); |
135 | 135 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $id); |
136 | - $delete_list_id=array(); |
|
136 | + $delete_list_id = array(); |
|
137 | 137 | $social_right_content .= MessageManager::outbox_display($keyword); |
138 | 138 | } else { |
139 | 139 | $social_right_content .= MessageManager::outbox_display($keyword); |
@@ -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'])) { |
@@ -3,25 +3,25 @@ discard block |
||
3 | 3 | /** |
4 | 4 | * @package chamilo.messages |
5 | 5 | */ |
6 | -$cidReset= true; |
|
6 | +$cidReset = true; |
|
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | -if (api_get_setting('allow_message_tool')!='true') { |
|
9 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
10 | 10 | api_not_allowed(); |
11 | 11 | } |
12 | 12 | |
13 | 13 | if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { |
14 | 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')); |
|
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 | 18 | $this_section = SECTION_MYPROFILE; |
19 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
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 | -if (isset($_GET['f']) && $_GET['f']=='social') { |
|
24 | +if (isset($_GET['f']) && $_GET['f'] == 'social') { |
|
25 | 25 | $social_parameter = '?f=social'; |
26 | 26 | } else { |
27 | 27 | if (api_get_setting('extended_profile') == 'true') { |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | } |
34 | 34 | if (api_get_setting('allow_message_tool') == 'true') { |
35 | 35 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
36 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
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 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
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 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
40 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
41 | 41 | } |
42 | 42 | $social_right_content .= '</div>'; |
43 | 43 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $show_menu = 'messages_inbox'; |
54 | 54 | } |
55 | 55 | |
56 | -$message = ''; |
|
56 | +$message = ''; |
|
57 | 57 | |
58 | 58 | // LEFT COLUMN |
59 | 59 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -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 |
@@ -12,19 +12,19 @@ discard block |
||
12 | 12 | * - reply on message (when pressing reply when viewing a message) |
13 | 13 | * - send to specific user (when pressing send message in the who is online list) |
14 | 14 | */ |
15 | -$cidReset = true; |
|
15 | +$cidReset = true; |
|
16 | 16 | require_once '../inc/global.inc.php'; |
17 | 17 | |
18 | 18 | api_block_anonymous_users(); |
19 | 19 | |
20 | -if (api_get_setting('allow_message_tool') !='true') { |
|
20 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
21 | 21 | api_not_allowed(); |
22 | 22 | } |
23 | 23 | |
24 | 24 | $nameTools = api_xml_http_response_encode(get_lang('Messages')); |
25 | 25 | /* Constants and variables */ |
26 | 26 | |
27 | -$htmlHeadXtra[]=' |
|
27 | +$htmlHeadXtra[] = ' |
|
28 | 28 | <script language="javascript"> |
29 | 29 | function validate(form, list) { |
30 | 30 | if(list.selectedIndex<0) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | function show_compose_to_any($user_id) { |
77 | 77 | $online_user_list = MessageManager::get_online_user_list($user_id); |
78 | 78 | $default['user_list'] = 0; |
79 | - $online_user_list=null; |
|
79 | + $online_user_list = null; |
|
80 | 80 | $html = manage_form($default, $online_user_list); |
81 | 81 | return $html; |
82 | 82 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $query = "SELECT user_sender_id FROM $table_message |
88 | 88 | WHERE user_receiver_id=".intval($receiver_id)." AND id='".intval($message_id)."';"; |
89 | 89 | $result = Database::query($query); |
90 | - $row = Database::fetch_array($result,'ASSOC'); |
|
90 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
91 | 91 | if (!isset($row['user_sender_id'])) { |
92 | 92 | $html = get_lang('InvalidMessageId'); |
93 | 93 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | return $html; |
101 | 101 | } |
102 | 102 | |
103 | -function show_compose_to_user ($receiver_id) { |
|
103 | +function show_compose_to_user($receiver_id) { |
|
104 | 104 | $html = get_lang('To').': <strong>'.GetFullUserName($receiver_id).'</strong>'; |
105 | 105 | $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
106 | 106 | $default['users'] = array($receiver_id); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | function manage_form($default, $select_from_user_list = null, $sent_to = null) |
112 | 112 | { |
113 | 113 | $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; |
114 | - $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
|
114 | + $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
|
115 | 115 | $param_f = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null; |
116 | 116 | |
117 | 117 | $form = new FormValidator('compose_message', null, api_get_self().'?f='.$param_f, null, array('enctype'=>'multipart/form-data')); |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | ) |
129 | 129 | ); |
130 | 130 | $form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required'); |
131 | - $form->addElement('html','<div id="id_div_search" style="padding:0px" class="message-select-box" > </div>'); |
|
132 | - $form->addElement('hidden','user_list', 0, array('id'=>'user_list')); |
|
131 | + $form->addElement('html', '<div id="id_div_search" style="padding:0px" class="message-select-box" > </div>'); |
|
132 | + $form->addElement('hidden', 'user_list', 0, array('id'=>'user_list')); |
|
133 | 133 | } else { |
134 | 134 | if (!empty($sent_to)) { |
135 | 135 | $form->addLabel(get_lang('SendMessageTo'), $sent_to); |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | array(), |
144 | 144 | [ |
145 | 145 | 'multiple' => 'multiple', |
146 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'message.ajax.php?a=find_users' |
|
146 | + 'url' => api_get_path(WEB_AJAX_PATH).'message.ajax.php?a=find_users' |
|
147 | 147 | ] |
148 | 148 | ); |
149 | 149 | } else { |
150 | - $form->addElement('hidden','hidden_user',$default['users'][0],array('id'=>'hidden_user')); |
|
150 | + $form->addElement('hidden', 'hidden_user', $default['users'][0], array('id'=>'hidden_user')); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | } else { |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | $group_info = $userGroup->get($group_id); |
156 | 156 | |
157 | 157 | $form->addElement('label', get_lang('ToGroup'), api_xml_http_response_encode($group_info['name'])); |
158 | - $form->addElement('hidden','group_id',$group_id); |
|
159 | - $form->addElement('hidden','parent_id',$message_id); |
|
158 | + $form->addElement('hidden', 'group_id', $group_id); |
|
159 | + $form->addElement('hidden', 'parent_id', $message_id); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | $form->addText('title', get_lang('Subject'), true); |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | if (isset($_GET['re_id'])) { |
172 | 172 | $message_reply_info = MessageManager::get_message_by_id($_GET['re_id']); |
173 | 173 | $default['title'] = get_lang('MailSubjectReplyShort')." ".$message_reply_info['title']; |
174 | - $form->addElement('hidden','re_id', intval($_GET['re_id'])); |
|
175 | - $form->addElement('hidden','save_form','save_form'); |
|
174 | + $form->addElement('hidden', 're_id', intval($_GET['re_id'])); |
|
175 | + $form->addElement('hidden', 'save_form', 'save_form'); |
|
176 | 176 | |
177 | 177 | //adding reply mail |
178 | 178 | $user_reply_info = api_get_user_info($message_reply_info['user_sender_id']); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | </div>' |
196 | 196 | ); |
197 | 197 | |
198 | - $form->addElement('label', '', '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span> ('.sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize'))).')'); |
|
198 | + $form->addElement('label', '', '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span> ('.sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))).')'); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | $form->addButtonSend(get_lang('SendMessage'), 'compose'); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $content = $default['content']; |
217 | 217 | $group_id = isset($default['group_id']) ? $default['group_id'] : null; |
218 | 218 | $parent_id = isset($default['parent_id']) ? $default['parent_id'] : null; |
219 | - if (is_array($user_list) && count($user_list)> 0) { |
|
219 | + if (is_array($user_list) && count($user_list) > 0) { |
|
220 | 220 | //all is well, send the message |
221 | 221 | foreach ($user_list as $user) { |
222 | 222 | $res = MessageManager::send_message( |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | Security::clear_token(); |
240 | 240 | } else { |
241 | 241 | $token = Security::get_token(); |
242 | - $form->addElement('hidden','sec_token'); |
|
242 | + $form->addElement('hidden', 'sec_token'); |
|
243 | 243 | $form->setConstants(array('sec_token' => $token)); |
244 | 244 | $html .= $form->returnForm(); |
245 | 245 | } |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | if ($group_id != 0) { |
270 | 270 | $social_right_content .= '<div class=actions>'; |
271 | 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>'; |
|
272 | + Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
273 | 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>'; |
|
274 | + Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
275 | 275 | $social_right_content .= '</div>'; |
276 | 276 | } else { |
277 | 277 | if ($socialToolIsActive) { |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | } |
284 | 284 | if (api_get_setting('allow_message_tool') == 'true') { |
285 | 285 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
286 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
286 | + Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
287 | 287 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
288 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
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 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
290 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
291 | 291 | } |
292 | 292 | $social_right_content .= '</div>'; |
293 | 293 | } |
@@ -301,21 +301,21 @@ discard block |
||
301 | 301 | $social_right_content .= '<div class="row">'; |
302 | 302 | $social_right_content .= '<div class="col-md-12">'; |
303 | 303 | $social_right_content .= '<div class="actions">'; |
304 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'. |
|
304 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'. |
|
305 | 305 | Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>'; |
306 | - $social_right_content .= '</div>'; |
|
307 | - $social_right_content .= '</div>'; |
|
306 | + $social_right_content .= '</div>'; |
|
307 | + $social_right_content .= '</div>'; |
|
308 | 308 | $social_right_content .= '<div class="col-md-12">'; |
309 | 309 | } |
310 | 310 | |
311 | 311 | // MAIN CONTENT |
312 | 312 | if (!isset($_POST['compose'])) { |
313 | - if(isset($_GET['re_id'])) { |
|
313 | + if (isset($_GET['re_id'])) { |
|
314 | 314 | $social_right_content .= show_compose_reply_to_message( |
315 | 315 | $_GET['re_id'], |
316 | 316 | api_get_user_id() |
317 | 317 | ); |
318 | - } elseif(isset($_GET['send_to_user'])) { |
|
318 | + } elseif (isset($_GET['send_to_user'])) { |
|
319 | 319 | $social_right_content .= show_compose_to_user($_GET['send_to_user']); |
320 | 320 | } else { |
321 | 321 | $social_right_content .= show_compose_to_any(api_get_user_id()); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $restrict = true; |
327 | 327 | } elseif (isset($_POST['group_id'])) { |
328 | 328 | $restrict = true; |
329 | - } elseif(isset($_POST['hidden_user'])) { |
|
329 | + } elseif (isset($_POST['hidden_user'])) { |
|
330 | 330 | $restrict = true; |
331 | 331 | } |
332 | 332 | |
@@ -349,13 +349,13 @@ discard block |
||
349 | 349 | } |
350 | 350 | $social_right_content .= manage_form($default); |
351 | 351 | } else { |
352 | - $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'),'error'); |
|
352 | + $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'), 'error'); |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | } |
356 | 356 | if (api_get_setting('allow_social_tool') == 'true') { |
357 | - $social_right_content .= '</div>'; |
|
358 | - $social_right_content .= '</div>'; |
|
357 | + $social_right_content .= '</div>'; |
|
358 | + $social_right_content .= '</div>'; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | $tpl = new Template(get_lang('ComposeMessage')); |
@@ -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(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $attendance->set_attendance_qualify_title($_POST['attendance_qualify_title']); |
61 | 61 | $attendance->set_attendance_weight($_POST['attendance_weight']); |
62 | 62 | $link_to_gradebook = false; |
63 | - if ( isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1 ) { |
|
63 | + if (isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1) { |
|
64 | 64 | $link_to_gradebook = true; |
65 | 65 | } |
66 | 66 | $attendance->category_id = $_POST['category_id']; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ) { |
113 | 113 | $link_to_gradebook = true; |
114 | 114 | } |
115 | - $attendance->attendance_edit($attendance_id,$link_to_gradebook); |
|
115 | + $attendance->attendance_edit($attendance_id, $link_to_gradebook); |
|
116 | 116 | Security::clear_token(); |
117 | 117 | header('location:index.php?action=attendance_list&'.api_get_cidreq()); |
118 | 118 | exit; |
@@ -543,17 +543,17 @@ discard block |
||
543 | 543 | } |
544 | 544 | } |
545 | 545 | $max_cols_per_page = 12; //10 dates + 2 name and number |
546 | - $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10 |
|
546 | + $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2; //10 |
|
547 | 547 | $rows = count($data_table); |
548 | 548 | |
549 | 549 | if ($cols > $max_cols_per_page) { |
550 | - $number_tables = round(($cols-2)/$max_dates_per_page); |
|
550 | + $number_tables = round(($cols - 2) / $max_dates_per_page); |
|
551 | 551 | $headers = $data_table[0]; |
552 | 552 | $all = array(); |
553 | 553 | $tables = array(); |
554 | 554 | $changed = 1; |
555 | 555 | |
556 | - for ($i= 0; $i <= $rows; $i++) { |
|
556 | + for ($i = 0; $i <= $rows; $i++) { |
|
557 | 557 | $row = isset($data_table[$i]) ? $data_table[$i] : null; |
558 | 558 | $key = 1; |
559 | 559 | $max_dates_per_page = 10; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | foreach ($item as $value) { |
565 | 565 | if ($count_j >= $max_dates_per_page) { |
566 | 566 | $key++; |
567 | - $max_dates_per_page = $max_dates_per_page_original*$key; |
|
567 | + $max_dates_per_page = $max_dates_per_page_original * $key; |
|
568 | 568 | //magic hack |
569 | 569 | $tables[$key][$i][] = $tables[1][$i][0]; |
570 | 570 | $tables[$key][$i][] = $tables[1][$i][1]; |
@@ -622,8 +622,8 @@ discard block |
||
622 | 622 | $form = new FormValidator( |
623 | 623 | 'search', |
624 | 624 | 'post', |
625 | - api_get_self() . '?' . api_get_cidreq( |
|
626 | - ) . '&action=calendar_logins' |
|
625 | + api_get_self().'?'.api_get_cidreq( |
|
626 | + ).'&action=calendar_logins' |
|
627 | 627 | ); |
628 | 628 | $form->addDateRangePicker('range', get_lang('DateRange')); |
629 | 629 | $form->addButton('submit', get_lang('Submit')); |
@@ -529,10 +529,11 @@ |
||
529 | 529 | $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']); |
530 | 530 | foreach ($data_array['attendant_calendar'] as $class_day) { |
531 | 531 | if ($class_day['done_attendance'] == 1) { |
532 | - if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) |
|
533 | - $result[$class_day['id']] = get_lang('UserAttendedSymbol'); |
|
534 | - else |
|
535 | - $result[$class_day['id']] = '<span style="color:red">'.get_lang('UserNotAttendedSymbol').'</span>'; |
|
532 | + if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) { |
|
533 | + $result[$class_day['id']] = get_lang('UserAttendedSymbol'); |
|
534 | + } else { |
|
535 | + $result[$class_day['id']] = '<span style="color:red">'.get_lang('UserNotAttendedSymbol').'</span>'; |
|
536 | + } |
|
536 | 537 | } else { |
537 | 538 | $result[$class_day['id']] = " "; |
538 | 539 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | if (api_is_allowed_to_edit(null, true)) { |
14 | 14 | echo '<div class="actions">'; |
15 | 15 | echo '<a href="index.php?'.api_get_cidreq().'&action=attendance_add">'. |
16 | - Display::return_icon('new_attendance_list.png', get_lang('CreateANewAttendance'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
16 | + Display::return_icon('new_attendance_list.png', get_lang('CreateANewAttendance'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
17 | 17 | echo '</div>'; |
18 | 18 | } |
19 | 19 | $attendance = new Attendance(); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | // See AttendanceController::calendarLogins function |
5 | 5 | echo '<div class="actions">'; |
6 | 6 | echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list">'. |
7 | - Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
7 | + Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
8 | 8 | echo '</div>'; |
9 | 9 | |
10 | 10 | echo $form; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | // error messages |
14 | 14 | if (isset($error)) { |
15 | - Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); |
|
15 | + Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | if (!isset($error)) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $form->addElement('hidden', 'attendance_id', $attendance_id); |
32 | 32 | |
33 | 33 | $form->addText('title', get_lang('Title'), true); |
34 | -$form->applyFilter('title','html_filter'); |
|
34 | +$form->applyFilter('title', 'html_filter'); |
|
35 | 35 | $form->addHtmlEditor( |
36 | 36 | 'description', |
37 | 37 | get_lang('Description'), |
@@ -49,28 +49,28 @@ discard block |
||
49 | 49 | if (Gradebook::is_active()) { |
50 | 50 | if (!empty($attendance_qualify_title) || !empty($attendance_weight)) { |
51 | 51 | $form->addButtonAdvancedSettings('id_qualify'); |
52 | - $form->addElement('html','<div id="id_qualify_options" style="display:block">'); |
|
53 | - $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')); |
|
54 | - $form->addElement('html','<div id="options_field" style="display:block">'); |
|
52 | + $form->addElement('html', '<div id="id_qualify_options" style="display:block">'); |
|
53 | + $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'), array('checked'=>'true', 'onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')); |
|
54 | + $form->addElement('html', '<div id="options_field" style="display:block">'); |
|
55 | 55 | } else { |
56 | 56 | $form->addButtonAdvancedSettings('id_qualify'); |
57 | - $form->addElement('html','<div id="id_qualify_options" style="display:none">'); |
|
58 | - $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'); |
|
59 | - $form->addElement('html','<div id="options_field" style="display:none">'); |
|
57 | + $form->addElement('html', '<div id="id_qualify_options" style="display:none">'); |
|
58 | + $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'), 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'); |
|
59 | + $form->addElement('html', '<div id="options_field" style="display:none">'); |
|
60 | 60 | } |
61 | 61 | GradebookUtils::load_gradebook_select_in_tool($form); |
62 | 62 | $form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook')); |
63 | 63 | $form->applyFilter('attendance_qualify_title', 'html_filter'); |
64 | - $form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"'); |
|
64 | + $form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'), 'value="0.00" Style="width:40px" onfocus="javascript: this.select();"'); |
|
65 | 65 | $form->applyFilter('attendance_weight', 'html_filter'); |
66 | - $form->addElement('html','</div>'); |
|
67 | - $form->addElement('html','</div>'); |
|
66 | + $form->addElement('html', '</div>'); |
|
67 | + $form->addElement('html', '</div>'); |
|
68 | 68 | } |
69 | 69 | $form->addButtonUpdate(get_lang('Save')); |
70 | 70 | |
71 | 71 | // set default values |
72 | 72 | $default['title'] = Security::remove_XSS($title); |
73 | -$default['description'] = Security::remove_XSS($description,STUDENT); |
|
73 | +$default['description'] = Security::remove_XSS($description, STUDENT); |
|
74 | 74 | $default['attendance_qualify_title'] = $attendance_qualify_title; |
75 | 75 | $default['attendance_weight'] = $attendance_weight; |
76 | 76 |
@@ -14,15 +14,15 @@ discard block |
||
14 | 14 | echo '<div class="actions">'; |
15 | 15 | if ($action == 'calendar_add') { |
16 | 16 | echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'. |
17 | - Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
17 | + Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
18 | 18 | } else { |
19 | 19 | echo '<a href="index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendance_id.'">'. |
20 | - Display::return_icon('back.png',get_lang('AttendanceSheet'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
20 | + Display::return_icon('back.png', get_lang('AttendanceSheet'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
21 | 21 | if (api_is_allowed_to_edit()) { |
22 | 22 | echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_add&attendance_id='.$attendance_id.'">'. |
23 | - Display::return_icon('add.png',get_lang('AddDateAndTime'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
23 | + Display::return_icon('add.png', get_lang('AddDateAndTime'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
24 | 24 | echo '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDeleteAllDates').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=calendar_all_delete&attendance_id='.$attendance_id.'">'. |
25 | - Display::return_icon('clean.png',get_lang('CleanCalendar'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
25 | + Display::return_icon('clean.png', get_lang('CleanCalendar'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | echo '</div>'; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $form = new FormValidator( |
59 | 59 | 'attendance_calendar_add', |
60 | 60 | 'POST', |
61 | - 'index.php?action=calendar_add&attendance_id='.$attendance_id.'&' . api_get_cidreq(), |
|
61 | + 'index.php?action=calendar_add&attendance_id='.$attendance_id.'&'.api_get_cidreq(), |
|
62 | 62 | '' |
63 | 63 | ); |
64 | 64 | $form->addElement('header', get_lang('AddADateTime')); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'weekly' => get_lang('RepeatWeekly'), |
96 | 96 | 'monthlyByDate' => get_lang('RepeatMonthlyByDate') |
97 | 97 | ); |
98 | - $form->addElement('select', 'repeat_type', get_lang('RepeatType') , $a_repeat_type); |
|
98 | + $form->addElement('select', 'repeat_type', get_lang('RepeatType'), $a_repeat_type); |
|
99 | 99 | |
100 | 100 | $form->addElement('date_picker', 'end_date_time', get_lang('RepeatEnd'), array('form_name'=>'attendance_calendar_add')); |
101 | 101 | $defaults['end_date_time'] = date('Y-m-d'); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $form = new FormValidator( |
132 | 132 | 'attendance_calendar_edit', |
133 | 133 | 'POST', |
134 | - 'index.php?action=calendar_edit&attendance_id=' . $attendance_id . '&calendar_id=' . $calendar_id . '&' . api_get_cidreq(), |
|
134 | + 'index.php?action=calendar_edit&attendance_id='.$attendance_id.'&calendar_id='.$calendar_id.'&'.api_get_cidreq(), |
|
135 | 135 | '' |
136 | 136 | ); |
137 | 137 | $form->addDateTimePicker('date_time', array(get_lang('Date')), array('form_name'=>'attendance_calendar_edit'), 5); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | get_lang('DateTime'), |
148 | 148 | null, |
149 | 149 | ICON_SIZE_MEDIUM |
150 | - ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .' '; |
|
150 | + ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time']) - 3).' '; |
|
151 | 151 | |
152 | 152 | if (isset($calendar['groups']) && !empty($calendar['groups'])) { |
153 | 153 | foreach ($calendar['groups'] as $group) { |