@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | public function get_foruns_id($username, $password, $course_code) |
21 | 21 | { |
22 | - if($this->verifyUserPass($username, $password) == "valid") |
|
22 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
23 | 23 | { |
24 | 24 | $course_db = CourseManager::get_course_information($course_code); |
25 | - $foruns_info = get_forums($id='', $course_db['code']); |
|
25 | + $foruns_info = get_forums($id = '', $course_db['code']); |
|
26 | 26 | $foruns_id = '#'; |
27 | 27 | foreach ($foruns_info as $forum) |
28 | 28 | { |
29 | - if( isset($forum['forum_id'])) |
|
29 | + if (isset($forum['forum_id'])) |
|
30 | 30 | { |
31 | 31 | $foruns_id .= $forum['forum_id']."#"; |
32 | 32 | } |
@@ -38,18 +38,18 @@ discard block |
||
38 | 38 | |
39 | 39 | public function get_forum_title($username, $password, $course_code, $forum_id) |
40 | 40 | { |
41 | - if($this->verifyUserPass($username, $password) == "valid") |
|
41 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
42 | 42 | { |
43 | 43 | $course_db = CourseManager::get_course_information($course_code); |
44 | 44 | $table_forums = Database :: get_course_table(TABLE_FORUM, $course_db['db_name']); |
45 | 45 | $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY, $course_db['db_name']); |
46 | 46 | |
47 | - $sql="SELECT * FROM ".$table_forums." forums, ".$table_item_property." item_properties |
|
47 | + $sql = "SELECT * FROM ".$table_forums." forums, ".$table_item_property." item_properties |
|
48 | 48 | WHERE item_properties.tool='".TOOL_FORUM."' |
49 | 49 | AND item_properties.ref='".Database::escape_string($forum_id)."' |
50 | 50 | AND forums.forum_id='".Database::escape_string($forum_id)."'"; |
51 | - $result=Database::query($sql); |
|
52 | - $forum_info=Database::fetch_array($result); |
|
51 | + $result = Database::query($sql); |
|
52 | + $forum_info = Database::fetch_array($result); |
|
53 | 53 | $forum_info['approval_direct_post'] = 0; // we can't anymore change this option, so it should always be activated |
54 | 54 | |
55 | 55 | $forum_title = utf8_decode($forum_info['forum_title']); |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | |
61 | 61 | public function get_forum_threads_id($username, $password, $course_code, $forum_id) |
62 | 62 | { |
63 | - if($this->verifyUserPass($username, $password) == "valid") { |
|
63 | + if ($this->verifyUserPass($username, $password) == "valid") { |
|
64 | 64 | $threads_info = get_threads($forum_id, $course_code); |
65 | 65 | $threads_id = '#'; |
66 | 66 | foreach ($threads_info as $thread) |
67 | 67 | { |
68 | - if( isset($thread['thread_id'])) |
|
68 | + if (isset($thread['thread_id'])) |
|
69 | 69 | { |
70 | 70 | $threads_id .= $thread['thread_id']."#"; |
71 | 71 | } |
@@ -79,18 +79,18 @@ discard block |
||
79 | 79 | |
80 | 80 | public function get_forum_thread_data($username, $password, $course_code, $thread_id, $field) |
81 | 81 | { |
82 | - if($this->verifyUserPass($username, $password) == "valid") |
|
82 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
83 | 83 | { |
84 | 84 | $course_db = CourseManager::get_course_information($course_code); |
85 | 85 | $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY, $course_db['db_name']); |
86 | 86 | $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD, $course_db['db_name']); |
87 | 87 | |
88 | - $sql="SELECT * FROM ".$table_threads." threads, ".$table_item_property." item_properties |
|
88 | + $sql = "SELECT * FROM ".$table_threads." threads, ".$table_item_property." item_properties |
|
89 | 89 | WHERE item_properties.tool='".TOOL_FORUM_THREAD."' |
90 | 90 | AND item_properties.ref='".Database::escape_string($thread_id)."' |
91 | 91 | AND threads.thread_id='".Database::escape_string($thread_id)."'"; |
92 | - $result=Database::query($sql); |
|
93 | - $thread_info=Database::fetch_array($result); |
|
92 | + $result = Database::query($sql); |
|
93 | + $thread_info = Database::fetch_array($result); |
|
94 | 94 | |
95 | 95 | switch ($field) |
96 | 96 | { |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | |
122 | 122 | public function get_forum_thread_title($username, $password, $course_code, $thread_id) |
123 | 123 | { |
124 | - if($this->verifyUserPass($username, $password) == "valid") |
|
124 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
125 | 125 | { |
126 | 126 | $course_db = CourseManager::get_course_information($course_code); |
127 | 127 | $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY, $course_db['db_name']); |
128 | 128 | $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD, $course_db['db_name']); |
129 | 129 | |
130 | - $sql="SELECT * FROM ".$table_threads." threads, ".$table_item_property." item_properties |
|
130 | + $sql = "SELECT * FROM ".$table_threads." threads, ".$table_item_property." item_properties |
|
131 | 131 | WHERE item_properties.tool='".TOOL_FORUM_THREAD."' |
132 | 132 | AND item_properties.ref='".Database::escape_string($thread_id)."' |
133 | 133 | AND threads.thread_id='".Database::escape_string($thread_id)."'"; |
134 | - $result=Database::query($sql); |
|
135 | - $thread_info=Database::fetch_array($result); |
|
134 | + $result = Database::query($sql); |
|
135 | + $thread_info = Database::fetch_array($result); |
|
136 | 136 | |
137 | 137 | $htmlcode = true; |
138 | 138 | $field_table = "thread_title"; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | public function get_posts_id($username, $password, $course_code, $thread_id) |
148 | 148 | { |
149 | - if($this->verifyUserPass($username, $password) == "valid") |
|
149 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
150 | 150 | { |
151 | 151 | $course_db = CourseManager::get_course_information($course_code); |
152 | 152 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $table_posts = Database :: get_course_table(TABLE_FORUM_POST, $course_db['db_name']); |
155 | 155 | |
156 | 156 | // note: change these SQL so that only the relevant fields of the user table are used |
157 | - if (api_is_allowed_to_edit(null,true)) { |
|
157 | + if (api_is_allowed_to_edit(null, true)) { |
|
158 | 158 | $sql = "SELECT * FROM $table_posts posts |
159 | 159 | LEFT JOIN $table_users users |
160 | 160 | ON posts.poster_id=users.user_id |
@@ -169,16 +169,16 @@ discard block |
||
169 | 169 | AND posts.visible='1' |
170 | 170 | ORDER BY posts.post_id ASC"; |
171 | 171 | } |
172 | - $result=Database::query($sql); |
|
173 | - while ($row=Database::fetch_array($result)) { |
|
174 | - $posts_info[]=$row; |
|
172 | + $result = Database::query($sql); |
|
173 | + while ($row = Database::fetch_array($result)) { |
|
174 | + $posts_info[] = $row; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | $posts_id = '#'; |
178 | 178 | |
179 | 179 | foreach ($posts_info as $post) |
180 | 180 | { |
181 | - if( isset($post['post_id'])) |
|
181 | + if (isset($post['post_id'])) |
|
182 | 182 | { |
183 | 183 | $posts_id .= $post['post_id']."#"; |
184 | 184 | } |
@@ -190,16 +190,16 @@ discard block |
||
190 | 190 | |
191 | 191 | public function get_post_data($username, $password, $course_code, $post_id, $field) |
192 | 192 | { |
193 | - if($this->verifyUserPass($username, $password) == "valid") |
|
193 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
194 | 194 | { |
195 | 195 | $course_db = CourseManager::get_course_information($course_code); |
196 | 196 | |
197 | 197 | $table_posts = Database :: get_course_table(TABLE_FORUM_POST, $course_db['db_name']); |
198 | 198 | $table_users = Database :: get_main_table(TABLE_MAIN_USER); |
199 | 199 | |
200 | - $sql="SELECT * FROM ".$table_posts."posts, ".$table_users." users WHERE posts.poster_id=users.user_id AND posts.post_id='".Database::escape_string($post_id)."'"; |
|
201 | - $result=Database::query($sql); |
|
202 | - $post_info =Database::fetch_array($result); |
|
200 | + $sql = "SELECT * FROM ".$table_posts."posts, ".$table_users." users WHERE posts.poster_id=users.user_id AND posts.post_id='".Database::escape_string($post_id)."'"; |
|
201 | + $result = Database::query($sql); |
|
202 | + $post_info = Database::fetch_array($result); |
|
203 | 203 | |
204 | 204 | $htmlcode = false; |
205 | 205 | switch ($field) |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | public function send_post($username, $password, $course_code, $forum_id, $thread_id, $title, $content) |
234 | 234 | { |
235 | - if($this->verifyUserPass($username, $password) == "valid") |
|
235 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
236 | 236 | { |
237 | 237 | $em = Database::getManager(); |
238 | 238 | $course_db = CourseManager::get_course_information($course_code); |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD, $course_db['db_name']); |
242 | 242 | $forum_table_attachment = Database :: get_course_table(TABLE_FORUM_ATTACHMENT, $course_db['db_name']); |
243 | 243 | $table_posts = Database :: get_course_table(TABLE_FORUM_POST, $course_db['db_name']); |
244 | - $post_date=date('Y-m-d H:i:s'); |
|
245 | - $visible=1; |
|
246 | - $has_attachment=false; |
|
244 | + $post_date = date('Y-m-d H:i:s'); |
|
245 | + $visible = 1; |
|
246 | + $has_attachment = false; |
|
247 | 247 | $my_post = ''; |
248 | 248 | $post_notification = ''; |
249 | 249 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $indent = $post['indent_cnt']; |
57 | 57 | |
58 | 58 | $html = ''; |
59 | - $html .= '<div class="col-md-offset-' . $indent . '" >'; |
|
59 | + $html .= '<div class="col-md-offset-'.$indent.'" >'; |
|
60 | 60 | $html .= '<div class="panel panel-default forum-post">'; |
61 | 61 | $html .= '<div class="panel-body">'; |
62 | 62 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($origin != 'learnpath') { |
75 | 75 | if (api_get_course_setting('allow_user_image_forum')) { |
76 | - $html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>'; |
|
76 | + $html .= '<div class="thumbnail">'.display_user_image($post['user_id'], $name, $origin).'</div>'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $html .= Display::tag( |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ); |
84 | 84 | } else { |
85 | 85 | if (api_get_course_setting('allow_user_image_forum')) { |
86 | - $html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>'; |
|
86 | + $html .= '<div class="thumbnail">'.display_user_image($post['user_id'], $name, $origin).'</div>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | $html .= Display::tag( |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) |
125 | 125 | ) { |
126 | 126 | if ($locked == false) { |
127 | - $iconEdit .= "<a href=\"editpost.php?" . api_get_cidreq() |
|
127 | + $iconEdit .= "<a href=\"editpost.php?".api_get_cidreq() |
|
128 | 128 | . "&forum=$clean_forum_id&thread=$clean_thread_id&post={$post['post_id']}&id_attach=$id_attach" |
129 | 129 | . "\">" |
130 | 130 | . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) |
139 | 139 | ) { |
140 | 140 | if ($locked == false) { |
141 | - $deleteUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
141 | + $deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
142 | 142 | 'forum' => $clean_forum_id, |
143 | 143 | 'thread' => $clean_thread_id, |
144 | 144 | 'action' => 'delete', |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | ); |
177 | 177 | |
178 | 178 | if ($count > 0) { |
179 | - $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() |
|
179 | + $iconEdit .= "<a href=\"viewthread.php?".api_get_cidreq() |
|
180 | 180 | . "&forum=$clean_forum_id&thread=$clean_thread_id&action=move&origin=$origin&post={$post['post_id']}" |
181 | - . "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>"; |
|
181 | + . "\">".Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL)."</a>"; |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | '1', $post['user_id'], $_GET['thread'] |
198 | 198 | ); |
199 | 199 | if ($locked == false) { |
200 | - $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() |
|
200 | + $iconEdit .= "<a href=\"forumqualify.php?".api_get_cidreq() |
|
201 | 201 | . "&forum=$clean_forum_id&thread=$clean_thread_id&action=list&post={$post['post_id']}" |
202 | 202 | . "&user={$post['user_id']}&user_id={$post['user_id']}&origin=$origin" |
203 | 203 | . "&idtextqualify=$current_qualify_thread" |
204 | - . "\" >" . Display::return_icon('quiz.gif', get_lang('Qualify')) . "</a>"; |
|
204 | + . "\" >".Display::return_icon('quiz.gif', get_lang('Qualify'))."</a>"; |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $statusIcon = getPostStatus($current_forum, $post); |
210 | 210 | |
211 | 211 | if ($iconEdit != '') { |
212 | - $html .= '<div class="tools-icons">' . $iconEdit . ' '.$statusIcon.'</div>'; |
|
212 | + $html .= '<div class="tools-icons">'.$iconEdit.' '.$statusIcon.'</div>'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | if (($current_forum_category && $current_forum_category['locked'] == 0) && |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
220 | 220 | $buttonReply = Display::toolbarButton( |
221 | 221 | get_lang('ReplyToMessage'), |
222 | - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
222 | + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ |
|
223 | 223 | 'forum' => $clean_forum_id, |
224 | 224 | 'thread' => $clean_thread_id, |
225 | 225 | 'post' => $post['post_id'], |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | $buttonQuote = Display::toolbarButton( |
234 | 234 | get_lang('QuoteMessage'), |
235 | - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
235 | + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ |
|
236 | 236 | 'forum' => $clean_forum_id, |
237 | 237 | 'thread' => $clean_thread_id, |
238 | 238 | 'post' => $post['post_id'], |
@@ -248,21 +248,21 @@ discard block |
||
248 | 248 | if ($current_forum_category && $current_forum_category['locked'] == 1) { |
249 | 249 | $closedPost = Display::tag( |
250 | 250 | 'div', |
251 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumcategoryLocked'), |
|
251 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumcategoryLocked'), |
|
252 | 252 | array('class' => 'alert alert-warning post-closed') |
253 | 253 | ); |
254 | 254 | } |
255 | 255 | if ($current_forum['locked'] == 1) { |
256 | 256 | $closedPost = Display::tag( |
257 | 257 | 'div', |
258 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumLocked'), |
|
258 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumLocked'), |
|
259 | 259 | array('class' => 'alert alert-warning post-closed') |
260 | 260 | ); |
261 | 261 | } |
262 | 262 | if ($current_thread['locked'] == 1) { |
263 | 263 | $closedPost = Display::tag( |
264 | 264 | 'div', |
265 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ThreadLocked'), |
|
265 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ThreadLocked'), |
|
266 | 266 | array('class' => 'alert alert-warning post-closed') |
267 | 267 | ); |
268 | 268 | } |
@@ -314,24 +314,24 @@ discard block |
||
314 | 314 | $html .= Display::return_icon('attachment.gif', get_lang('Attachment')); |
315 | 315 | $html .= '<a href="download.php?file='; |
316 | 316 | $html .= $realname; |
317 | - $html .= ' "> ' . $user_filename . ' </a>'; |
|
318 | - $html .= '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span>'; |
|
317 | + $html .= ' "> '.$user_filename.' </a>'; |
|
318 | + $html .= '<span class="forum_attach_comment" >'.$attachment['comment'].'</span>'; |
|
319 | 319 | if (($current_forum['allow_edit'] == 1 && $post['user_id'] == $userId) || |
320 | 320 | (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) |
321 | 321 | ) { |
322 | - $html .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&origin=' |
|
323 | - . Security::remove_XSS($_GET['origin']) . '&action=delete_attach&id_attach=' |
|
324 | - . $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id |
|
322 | + $html .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&origin=' |
|
323 | + . Security::remove_XSS($_GET['origin']).'&action=delete_attach&id_attach=' |
|
324 | + . $attachment['iid'].'&forum='.$clean_forum_id.'&thread='.$clean_thread_id |
|
325 | 325 | . '" onclick="javascript:if(!confirm(\'' |
326 | - . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . '\')) return false;">' |
|
327 | - . Display::return_icon('delete.gif', get_lang('Delete')) . '</a><br />'; |
|
326 | + . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;">' |
|
327 | + . Display::return_icon('delete.gif', get_lang('Delete')).'</a><br />'; |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | } |
331 | 331 | |
332 | 332 | $html .= '</div>'; |
333 | 333 | $html .= '<div class="col-md-6 text-right">'; |
334 | - $html .= $buttonReply . ' ' . $buttonQuote; |
|
334 | + $html .= $buttonReply.' '.$buttonQuote; |
|
335 | 335 | $html .= '</div>'; |
336 | 336 | $html .= '</div>'; |
337 | 337 | // The post has been displayed => it can be removed from the what's new array |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
65 | 65 | $buttonReply = Display::toolbarButton( |
66 | 66 | get_lang('ReplyToMessage'), |
67 | - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
67 | + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ |
|
68 | 68 | 'forum' => $clean_forum_id, |
69 | 69 | 'thread' => $clean_thread_id, |
70 | 70 | 'post' => $row['post_id'], |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $buttonQuote = Display::toolbarButton( |
79 | 79 | get_lang('QuoteMessage'), |
80 | - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
80 | + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ |
|
81 | 81 | 'forum' => $clean_forum_id, |
82 | 82 | 'thread' => $clean_thread_id, |
83 | 83 | 'post' => $row['post_id'], |
@@ -94,21 +94,21 @@ discard block |
||
94 | 94 | if (($current_forum_category && $current_forum_category['locked'] == 1)) { |
95 | 95 | $closedPost = Display::tag( |
96 | 96 | 'div', |
97 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumcategoryLocked'), |
|
97 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumcategoryLocked'), |
|
98 | 98 | array('class' => 'alert alert-warning post-closed') |
99 | 99 | ); |
100 | 100 | } |
101 | 101 | if ($current_forum['locked'] == 1) { |
102 | 102 | $closedPost = Display::tag( |
103 | 103 | 'div', |
104 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumLocked'), |
|
104 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumLocked'), |
|
105 | 105 | array('class' => 'alert alert-warning post-closed') |
106 | 106 | ); |
107 | 107 | } |
108 | 108 | if ($current_thread['locked'] == 1) { |
109 | 109 | $closedPost = Display::tag( |
110 | 110 | 'div', |
111 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ThreadLocked'), |
|
111 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ThreadLocked'), |
|
112 | 112 | array('class' => 'alert alert-warning post-closed') |
113 | 113 | ); |
114 | 114 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | if ($origin != 'learnpath') { |
125 | 125 | if (api_get_course_setting('allow_user_image_forum')) { |
126 | - $html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>'; |
|
126 | + $html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>'; |
|
127 | 127 | } |
128 | 128 | $html .= Display::tag( |
129 | 129 | 'h4', |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | ); |
133 | 133 | } else { |
134 | 134 | if (api_get_course_setting('allow_user_image_forum')) { |
135 | - $html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>'; |
|
135 | + $html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>'; |
|
136 | 136 | } |
137 | - $name = Display::tag('strong', "#" . $postCount--, ['class' => 'text-info']) . " | $name"; |
|
137 | + $name = Display::tag('strong', "#".$postCount--, ['class' => 'text-info'])." | $name"; |
|
138 | 138 | $html .= Display::tag( |
139 | 139 | 'p', |
140 | 140 | $name, |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | ) { |
177 | 177 | if (api_is_allowed_to_session_edit(false, true)) { |
178 | 178 | if ($locked == false) { |
179 | - $iconEdit .= "<a href=\"editpost.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id |
|
180 | - . "&thread=" . $clean_thread_id . "&post=" . $row['post_id'] . "&origin=" |
|
181 | - . $origin . "&edit=edition&id_attach=" . $id_attach . "\">" |
|
182 | - . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . "</a>"; |
|
179 | + $iconEdit .= "<a href=\"editpost.php?".api_get_cidreq()."&forum=".$clean_forum_id |
|
180 | + . "&thread=".$clean_thread_id."&post=".$row['post_id']."&origin=" |
|
181 | + . $origin."&edit=edition&id_attach=".$id_attach."\">" |
|
182 | + . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a>"; |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | ) { |
192 | 192 | |
193 | 193 | if ($locked == false) { |
194 | - $deleteUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
194 | + $deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
195 | 195 | 'forum' => $clean_forum_id, |
196 | 196 | 'thread' => $clean_thread_id, |
197 | 197 | 'action' => 'delete', |
@@ -227,9 +227,9 @@ discard block |
||
227 | 227 | ); |
228 | 228 | $iconEdit .= ""; |
229 | 229 | if ($increment > 0) { |
230 | - $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id |
|
231 | - . "&thread=" . $clean_thread_id . "&action=move&post=" . $row['post_id'] |
|
232 | - . "&origin=" . $origin . "\">" |
|
230 | + $iconEdit .= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".$clean_forum_id |
|
231 | + . "&thread=".$clean_thread_id."&action=move&post=".$row['post_id'] |
|
232 | + . "&origin=".$origin."\">" |
|
233 | 233 | . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) |
234 | 234 | . "</a>"; |
235 | 235 | } |
@@ -256,16 +256,16 @@ discard block |
||
256 | 256 | $userCanEdit = true; |
257 | 257 | } |
258 | 258 | if ($increment > 0 && $locked == false && $userCanEdit) { |
259 | - $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() . "&forum=" . $my_forum_id |
|
260 | - . "&thread=" . $clean_thread_id . "&action=list&post=" . $row['post_id'] |
|
261 | - . "&user=" . $row['poster_id'] . "&user_id=" . $row['poster_id'] |
|
262 | - . "&origin=" . $origin . "&idtextqualify=" . $current_qualify_thread . "\" >" |
|
259 | + $iconEdit .= "<a href=\"forumqualify.php?".api_get_cidreq()."&forum=".$my_forum_id |
|
260 | + . "&thread=".$clean_thread_id."&action=list&post=".$row['post_id'] |
|
261 | + . "&user=".$row['poster_id']."&user_id=".$row['poster_id'] |
|
262 | + . "&origin=".$origin."&idtextqualify=".$current_qualify_thread."\" >" |
|
263 | 263 | . Display::return_icon('quiz.gif', get_lang('Qualify')) |
264 | 264 | . "</a> "; |
265 | 265 | } |
266 | 266 | } |
267 | 267 | if ($iconEdit != '') { |
268 | - $html .= '<div class="tools-icons">' . $iconEdit . $statusIcon.'</div>'; |
|
268 | + $html .= '<div class="tools-icons">'.$iconEdit.$statusIcon.'</div>'; |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -327,27 +327,27 @@ discard block |
||
327 | 327 | $realname = $attachment['path']; |
328 | 328 | $user_filename = $attachment['filename']; |
329 | 329 | $html .= Display::return_icon('attachment.gif', get_lang('Attachment')); |
330 | - $html .= '<a href="download.php?file=' . $realname . '"> ' . $user_filename . ' </a>'; |
|
330 | + $html .= '<a href="download.php?file='.$realname.'"> '.$user_filename.' </a>'; |
|
331 | 331 | |
332 | 332 | if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) || |
333 | 333 | (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) |
334 | 334 | ) { |
335 | - $html .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&origin=' |
|
336 | - . Security::remove_XSS($origin) . '&action=delete_attach&id_attach=' |
|
337 | - . $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id |
|
335 | + $html .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&origin=' |
|
336 | + . Security::remove_XSS($origin).'&action=delete_attach&id_attach=' |
|
337 | + . $attachment['iid'].'&forum='.$clean_forum_id.'&thread='.$clean_thread_id |
|
338 | 338 | . '" onclick="javascript:if(!confirm(\'' |
339 | 339 | . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) |
340 | 340 | . '\')) return false;">' |
341 | 341 | . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) |
342 | 342 | . '</a><br />'; |
343 | 343 | } |
344 | - $html .= '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span>'; |
|
344 | + $html .= '<span class="forum_attach_comment" >'.$attachment['comment'].'</span>'; |
|
345 | 345 | } |
346 | 346 | } |
347 | 347 | |
348 | 348 | $html .= '</div>'; |
349 | 349 | $html .= '<div class="col-md-5 text-right">'; |
350 | - $html .= $buttonReply . ' ' . $buttonQuote; |
|
350 | + $html .= $buttonReply.' '.$buttonQuote; |
|
351 | 351 | $html .= '</div>'; |
352 | 352 | $html .= '</div>'; |
353 | 353 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $iso = api_get_language_isocode(api_get_interface_language()); |
26 | 26 | $languageCondition = ''; |
27 | 27 | |
28 | - if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/$iso.js")) { |
|
28 | + if (file_exists(api_get_path(SYS_PATH)."web/assets/select2/dist/js/i18n/$iso.js")) { |
|
29 | 29 | $html .= api_get_asset("select2/dist/js/i18n/$iso.js"); |
30 | 30 | $languageCondition = "language: '$iso',"; |
31 | 31 | } |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | //Get the minimumInputLength for select2 |
52 | 52 | $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ? |
53 | - $this->getAttribute('minimumInputLength') : |
|
54 | - 3 |
|
53 | + $this->getAttribute('minimumInputLength') : 3 |
|
55 | 54 | ; |
56 | 55 | |
57 | 56 | $plHolder = $this->getAttribute('placeholder'); |
@@ -81,7 +80,7 @@ discard block |
||
81 | 80 | $multiple = $multiple ? 'true' : 'false'; |
82 | 81 | |
83 | 82 | $max = $this->getAttribute('maximumSelectionLength'); |
84 | - $max = !empty($max) ? "maximumSelectionLength: $max, ": ''; |
|
83 | + $max = !empty($max) ? "maximumSelectionLength: $max, " : ''; |
|
85 | 84 | |
86 | 85 | $html .= <<<JS |
87 | 86 | <script> |
@@ -125,7 +124,7 @@ discard block |
||
125 | 124 | $this->removeAttribute('url_function'); |
126 | 125 | $this->setAttribute('style', 'width: 100%;'); |
127 | 126 | |
128 | - return parent::toHtml() . $html; |
|
127 | + return parent::toHtml().$html; |
|
129 | 128 | } |
130 | 129 | |
131 | 130 | /** |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once '../inc/global.inc.php'; |
9 | 9 | require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/fe/exportgradebook.php'; |
10 | 10 | |
11 | -$current_course_tool = TOOL_GRADEBOOK; |
|
11 | +$current_course_tool = TOOL_GRADEBOOK; |
|
12 | 12 | |
13 | 13 | api_protect_course_script(true); |
14 | 14 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | null, |
75 | 75 | 'simple_search_form', |
76 | 76 | null, |
77 | - api_get_self() . '?selectcat=' . $category_id |
|
77 | + api_get_self().'?selectcat='.$category_id |
|
78 | 78 | ); |
79 | 79 | $values = $simple_search_form->exportValues(); |
80 | 80 | |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | -if (isset($_GET['exportpdf'])) { |
|
152 | - $interbreadcrumb[] = array ( |
|
153 | - 'url' => api_get_self().'?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
|
151 | +if (isset($_GET['exportpdf'])) { |
|
152 | + $interbreadcrumb[] = array( |
|
153 | + 'url' => api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
|
154 | 154 | 'name' => get_lang('FlatView') |
155 | 155 | ); |
156 | 156 | |
157 | 157 | $pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : null; |
158 | 158 | $perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : null; |
159 | - $url = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
159 | + $url = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
160 | 160 | 'exportpdf' => '', |
161 | 161 | 'offset' => $offset, |
162 | 162 | 'selectcat' => intval($_GET['selectcat']), |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
198 | -if (isset($_GET['print'])) { |
|
198 | +if (isset($_GET['print'])) { |
|
199 | 199 | $printable_data = GradebookUtils::get_printable_data( |
200 | 200 | $cat[0], |
201 | 201 | $users, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | require_once '../inc/global.inc.php'; |
15 | 15 | $this_section = SECTION_COURSES; |
16 | -$current_course_tool = TOOL_GROUP; |
|
16 | +$current_course_tool = TOOL_GROUP; |
|
17 | 17 | |
18 | 18 | // Notice for unauthorized people. |
19 | 19 | api_protect_course_script(true); |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $current_group = GroupManager :: get_group_properties($group_id); |
23 | 23 | |
24 | 24 | $nameTools = get_lang('EditGroup'); |
25 | -$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
|
26 | -$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); |
|
25 | +$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
|
26 | +$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); |
|
27 | 27 | |
28 | 28 | $is_group_member = GroupManager :: is_tutor_of_group(api_get_user_id(), $group_id); |
29 | 29 |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | $formSent = 0; |
16 | 16 | |
17 | 17 | // Crop picture plugin for session images |
18 | -$htmlHeadXtra[] = '<link href="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
19 | -$htmlHeadXtra[] = '<script src="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
18 | +$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
19 | +$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
20 | 20 | $htmlHeadXtra[] = '<script> |
21 | 21 | $(document).ready(function() { |
22 | 22 | var $image = $("#previewImage"); |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | $tool_name = get_lang('EditSession'); |
104 | 104 | |
105 | 105 | //$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
106 | -$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); |
|
107 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview')); |
|
106 | +$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); |
|
107 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview')); |
|
108 | 108 | |
109 | 109 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
110 | 110 | $formSent = 1; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | WHERE status='1'".$order_clause; |
119 | 119 | |
120 | 120 | if (api_is_multiple_url_enabled()) { |
121 | - $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
121 | + $table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
122 | 122 | $access_url_id = api_get_current_access_url_id(); |
123 | 123 | if ($access_url_id != -1) { |
124 | 124 | $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $thisYear = date('Y'); |
135 | 135 | |
136 | 136 | $coachesOption = array( |
137 | - '' => '----- ' . get_lang('None') . ' -----' |
|
137 | + '' => '----- '.get_lang('None').' -----' |
|
138 | 138 | ); |
139 | 139 | |
140 | 140 | foreach ($coaches as $coach) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | -$formAction = api_get_self() . '?'; |
|
157 | +$formAction = api_get_self().'?'; |
|
158 | 158 | $formAction .= http_build_query(array( |
159 | 159 | 'page' => Security::remove_XSS($_GET['page']), |
160 | 160 | 'id' => $id |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $duration = null; |
221 | 221 | } |
222 | 222 | $description = $params['description']; |
223 | - $showDescription = isset($params['show_description']) ? 1: 0; |
|
223 | + $showDescription = isset($params['show_description']) ? 1 : 0; |
|
224 | 224 | $sendSubscriptionNotification = isset($params['send_subscription_notification']); |
225 | 225 | $isThisImageCropped = isset($params['cropResult']); |
226 | 226 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | ); |
257 | 257 | |
258 | 258 | if ($return == strval(intval($return))) { |
259 | - header('Location: resume_session.php?id_session=' . $return); |
|
259 | + header('Location: resume_session.php?id_session='.$return); |
|
260 | 260 | exit(); |
261 | 261 | } |
262 | 262 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // Including the global initialization file. |
28 | 28 | require_once '../inc/global.inc.php'; |
29 | -$current_course_tool = TOOL_FORUM; |
|
29 | +$current_course_tool = TOOL_FORUM; |
|
30 | 30 | |
31 | 31 | // Notification for unauthorized people. |
32 | 32 | api_protect_course_script(true); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // Course |
79 | 79 | if ( |
80 | - !api_is_allowed_to_edit(false, true) && //is a student |
|
80 | + !api_is_allowed_to_edit(false, true) && //is a student |
|
81 | 81 | (($current_forum_category && $current_forum_category['visibility'] == 0) || |
82 | 82 | $current_forum['visibility'] == 0 || !$user_has_access_in_group) |
83 | 83 | ) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } else { |
87 | 87 | //Course |
88 | 88 | if ( |
89 | - !api_is_allowed_to_edit(false, true) && //is a student |
|
89 | + !api_is_allowed_to_edit(false, true) && //is a student |
|
90 | 90 | ( |
91 | 91 | ($current_forum_category && $current_forum_category['visibility'] == 0) || |
92 | 92 | $current_forum['visibility'] == 0 |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | $my_action = isset($_GET['action']) ? $_GET['action'] : ''; |
103 | 103 | |
104 | 104 | $gradebook = null; |
105 | -if (isset($_SESSION['gradebook'])){ |
|
105 | +if (isset($_SESSION['gradebook'])) { |
|
106 | 106 | $gradebook = $_SESSION['gradebook']; |
107 | 107 | } |
108 | 108 | |
109 | 109 | if (!empty($gradebook) && $gradebook == 'view') { |
110 | - $interbreadcrumb[] = array ( |
|
110 | + $interbreadcrumb[] = array( |
|
111 | 111 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
112 | 112 | 'name' => get_lang('ToolGradebook') |
113 | 113 | ); |
@@ -117,25 +117,25 @@ discard block |
||
117 | 117 | |
118 | 118 | if ($origin == 'group') { |
119 | 119 | $interbreadcrumb[] = array( |
120 | - 'url' => api_get_path(WEB_CODE_PATH) . 'group/group.php?'.api_get_cidreq(), |
|
120 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), |
|
121 | 121 | 'name' => get_lang('Groups') |
122 | 122 | ); |
123 | 123 | $interbreadcrumb[] = array( |
124 | - 'url' => api_get_path(WEB_CODE_PATH) . 'group/group_space.php?' . api_get_cidreq(), |
|
125 | - 'name' => get_lang('GroupSpace') . ' ' . $group_properties['name'] |
|
124 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
125 | + 'name' => get_lang('GroupSpace').' '.$group_properties['name'] |
|
126 | 126 | ); |
127 | 127 | $interbreadcrumb[] = array( |
128 | 128 | 'url' => '#', |
129 | - 'name' => get_lang('Forum') . ' ' . Security::remove_XSS($current_forum['forum_title']) |
|
129 | + 'name' => get_lang('Forum').' '.Security::remove_XSS($current_forum['forum_title']) |
|
130 | 130 | ); |
131 | 131 | } else { |
132 | 132 | $interbreadcrumb[] = array( |
133 | - 'url' => $forumUrl . 'index.php?search=' . Security::remove_XSS($my_search), |
|
133 | + 'url' => $forumUrl.'index.php?search='.Security::remove_XSS($my_search), |
|
134 | 134 | 'name' => get_lang('ForumCategories') |
135 | 135 | ); |
136 | 136 | $interbreadcrumb[] = array( |
137 | - 'url' => $forumUrl . 'viewforumcategory.php?forumcategory=' . $current_forum_category['cat_id'] |
|
138 | - . '&search=' . Security::remove_XSS(urlencode($my_search)), |
|
137 | + 'url' => $forumUrl.'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'] |
|
138 | + . '&search='.Security::remove_XSS(urlencode($my_search)), |
|
139 | 139 | 'name' => prepare4display($current_forum_category['cat_title']) |
140 | 140 | ); |
141 | 141 | $interbreadcrumb[] = array( |
@@ -243,24 +243,24 @@ discard block |
||
243 | 243 | break; |
244 | 244 | } |
245 | 245 | |
246 | - $table_list = Display::page_subheader(get_lang('ThreadUsersList') . ': ' . get_name_thread_by_id($_GET['id'])); |
|
246 | + $table_list = Display::page_subheader(get_lang('ThreadUsersList').': '.get_name_thread_by_id($_GET['id'])); |
|
247 | 247 | |
248 | 248 | if ($nrorow3 > 0 || $nrorow3 == -2) { |
249 | - $url = api_get_cidreq() .'&forum=' . intval($my_forum) . '&action=' |
|
250 | - . Security::remove_XSS($_GET['action']) . '&content=' |
|
251 | - . Security::remove_XSS($_GET['content'], STUDENT) . '&id=' . intval($_GET['id']); |
|
249 | + $url = api_get_cidreq().'&forum='.intval($my_forum).'&action=' |
|
250 | + . Security::remove_XSS($_GET['action']).'&content=' |
|
251 | + . Security::remove_XSS($_GET['content'], STUDENT).'&id='.intval($_GET['id']); |
|
252 | 252 | $tabs = array( |
253 | 253 | array( |
254 | 254 | 'content' => get_lang('AllStudents'), |
255 | - 'url' => $forumUrl . 'viewforum.php?' . $url . '&origin=' . $origin . '&list=all' |
|
255 | + 'url' => $forumUrl.'viewforum.php?'.$url.'&origin='.$origin.'&list=all' |
|
256 | 256 | ), |
257 | 257 | array( |
258 | 258 | 'content' => get_lang('StudentsQualified'), |
259 | - 'url' => $forumUrl . 'viewforum.php?' . $url . '&origin=' . $origin . '&list=qualify' |
|
259 | + 'url' => $forumUrl.'viewforum.php?'.$url.'&origin='.$origin.'&list=qualify' |
|
260 | 260 | ), |
261 | 261 | array( |
262 | 262 | 'content' => get_lang('StudentsNotQualified'), |
263 | - 'url' => $forumUrl . 'viewforum.php?' . $url . '&origin=' . $origin . '&list=notqualify' |
|
263 | + 'url' => $forumUrl.'viewforum.php?'.$url.'&origin='.$origin.'&list=notqualify' |
|
264 | 264 | ), |
265 | 265 | ); |
266 | 266 | $table_list .= Display::tabsOnlyLink($tabs, $active); |
@@ -269,32 +269,32 @@ discard block |
||
269 | 269 | $table_list .= '<center><br /><table class="data_table" style="width:50%">'; |
270 | 270 | // The column headers (TODO: Make this sortable). |
271 | 271 | $table_list .= '<tr >'; |
272 | - $table_list .= '<th height="24">' . get_lang('NamesAndLastNames') . '</th>'; |
|
272 | + $table_list .= '<th height="24">'.get_lang('NamesAndLastNames').'</th>'; |
|
273 | 273 | |
274 | 274 | if ($listType == 'qualify') { |
275 | - $table_list .= '<th>' . get_lang('Qualification') . '</th>'; |
|
275 | + $table_list .= '<th>'.get_lang('Qualification').'</th>'; |
|
276 | 276 | } |
277 | 277 | if (api_is_allowed_to_edit(null, true)) { |
278 | - $table_list .= '<th>' . get_lang('Qualify') . '</th>'; |
|
278 | + $table_list .= '<th>'.get_lang('Qualify').'</th>'; |
|
279 | 279 | } |
280 | 280 | $table_list .= '</tr>'; |
281 | 281 | $max_qualify = showQualify('2', $userId, $_GET['id']); |
282 | 282 | $counter_stdlist = 0; |
283 | 283 | |
284 | 284 | if (Database::num_rows($student_list) > 0) { |
285 | - while ($row_student_list=Database::fetch_array($student_list)) { |
|
285 | + while ($row_student_list = Database::fetch_array($student_list)) { |
|
286 | 286 | $userInfo = api_get_user_info($row_student_list['id']); |
287 | 287 | if ($counter_stdlist % 2 == 0) { |
288 | 288 | $class_stdlist = 'row_odd'; |
289 | 289 | } else { |
290 | 290 | $class_stdlist = 'row_even'; |
291 | 291 | } |
292 | - $table_list .= '<tr class="' . $class_stdlist . '"><td>'; |
|
292 | + $table_list .= '<tr class="'.$class_stdlist.'"><td>'; |
|
293 | 293 | $table_list .= UserManager::getUserProfileLink($userInfo); |
294 | 294 | |
295 | 295 | $table_list .= '</td>'; |
296 | 296 | if ($listType == 'qualify') { |
297 | - $table_list .= '<td>' . $row_student_list['qualify'] . '/' . $max_qualify . '</td>'; |
|
297 | + $table_list .= '<td>'.$row_student_list['qualify'].'/'.$max_qualify.'</td>'; |
|
298 | 298 | } |
299 | 299 | if (api_is_allowed_to_edit(null, true)) { |
300 | 300 | $current_qualify_thread = showQualify( |
@@ -303,20 +303,20 @@ discard block |
||
303 | 303 | $_GET['id'] |
304 | 304 | ); |
305 | 305 | $table_list .= '<td> |
306 | - <a href="' . $forumUrl . 'forumqualify.php?' . api_get_cidreq() |
|
307 | - . '&forum=' . Security::remove_XSS($my_forum) . '&thread=' |
|
308 | - . Security::remove_XSS($_GET['id']) . '&user=' . $row_student_list['id'] |
|
309 | - . '&user_id=' . $row_student_list['id'] . '&idtextqualify=' |
|
310 | - . $current_qualify_thread . '&origin=' . $origin . '">' |
|
311 | - . Display::return_icon($icon_qualify, get_lang('Qualify')) . '</a></td></tr>'; |
|
306 | + <a href="' . $forumUrl.'forumqualify.php?'.api_get_cidreq() |
|
307 | + . '&forum='.Security::remove_XSS($my_forum).'&thread=' |
|
308 | + . Security::remove_XSS($_GET['id']).'&user='.$row_student_list['id'] |
|
309 | + . '&user_id='.$row_student_list['id'].'&idtextqualify=' |
|
310 | + . $current_qualify_thread.'&origin='.$origin.'">' |
|
311 | + . Display::return_icon($icon_qualify, get_lang('Qualify')).'</a></td></tr>'; |
|
312 | 312 | } |
313 | 313 | $counter_stdlist++; |
314 | 314 | } |
315 | 315 | } else { |
316 | 316 | if ($listType == 'qualify') { |
317 | - $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotQualifiedLearners') . '</td></tr>'; |
|
317 | + $table_list .= '<tr><td colspan="2">'.get_lang('ThereIsNotQualifiedLearners').'</td></tr>'; |
|
318 | 318 | } else { |
319 | - $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotUnqualifiedLearners') . '</td></tr>'; |
|
319 | + $table_list .= '<tr><td colspan="2">'.get_lang('ThereIsNotUnqualifiedLearners').'</td></tr>'; |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
@@ -342,14 +342,14 @@ discard block |
||
342 | 342 | echo '<div class="actions">'; |
343 | 343 | |
344 | 344 | if ($origin != 'learnpath') { |
345 | - if ($origin=='group') { |
|
346 | - echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'group/group_space.php?' |
|
347 | - . api_get_cidreq() . '&gradebook=' . $gradebook . '">' |
|
345 | + if ($origin == 'group') { |
|
346 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'group/group_space.php?' |
|
347 | + . api_get_cidreq().'&gradebook='.$gradebook.'">' |
|
348 | 348 | . Display::return_icon('back.png', get_lang('BackTo') |
349 | - . ' ' . get_lang('Groups'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
349 | + . ' '.get_lang('Groups'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
350 | 350 | } else { |
351 | 351 | echo '<span style="float:right;">'.search_link().'</span>'; |
352 | - echo '<a href="' . $forumUrl . 'index.php?' . api_get_cidreq() . '">' |
|
352 | + echo '<a href="'.$forumUrl.'index.php?'.api_get_cidreq().'">' |
|
353 | 353 | . Display::return_icon('back.png', get_lang('BackToForumOverview'), '', ICON_SIZE_MEDIUM) |
354 | 354 | . '</a>'; |
355 | 355 | } |
@@ -367,14 +367,14 @@ discard block |
||
367 | 367 | if ($current_forum['locked'] <> 1 AND $current_forum['locked'] <> 1) { |
368 | 368 | if (!api_is_anonymous() && !api_is_invitee()) { |
369 | 369 | if ($my_forum == strval(intval($my_forum))) { |
370 | - echo '<a href="' . $forumUrl . 'newthread.php?' . api_get_cidreq() . '&forum=' |
|
371 | - . Security::remove_XSS($my_forum) . $origin_string . '">' |
|
370 | + echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq().'&forum=' |
|
371 | + . Security::remove_XSS($my_forum).$origin_string.'">' |
|
372 | 372 | . Display::return_icon('new_thread.png', get_lang('NewTopic'), '', ICON_SIZE_MEDIUM) |
373 | 373 | . '</a>'; |
374 | 374 | } else { |
375 | 375 | $my_forum = strval(intval($my_forum)); |
376 | - echo '<a href="' . $forumUrl . 'newthread.php?' . api_get_cidreq() |
|
377 | - . '&forum=' . $my_forum . $origin_string . '">' |
|
376 | + echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq() |
|
377 | + . '&forum='.$my_forum.$origin_string.'">' |
|
378 | 378 | . Display::return_icon('new_thread.png', get_lang('NewTopic'), '', ICON_SIZE_MEDIUM) |
379 | 379 | . '</a>'; |
380 | 380 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | if ($origin != 'learnpath') { |
402 | 402 | $html .= Display::tag( |
403 | 403 | 'h3', |
404 | - $iconForum .' '. $titleForum, |
|
404 | + $iconForum.' '.$titleForum, |
|
405 | 405 | array( |
406 | 406 | 'class' => 'title-forum') |
407 | 407 | ); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | } |
444 | 444 | |
445 | 445 | if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) { |
446 | - $newPost = ' ' . Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
446 | + $newPost = ' '.Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
447 | 447 | } else { |
448 | 448 | $newPost = ''; |
449 | 449 | } |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | } |
454 | 454 | |
455 | 455 | $name = api_get_person_name($row['firstname'], $row['lastname']); |
456 | - $linkPostForum = '<a href="viewthread.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) |
|
456 | + $linkPostForum = '<a href="viewthread.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($my_forum) |
|
457 | 457 | . "&origin=$origin&thread={$row['thread_id']}$origin_string&search=" |
458 | - . Security::remove_XSS(urlencode($my_search)) . '">' |
|
459 | - . $row['thread_title'] . '</a>'; |
|
458 | + . Security::remove_XSS(urlencode($my_search)).'">' |
|
459 | + . $row['thread_title'].'</a>'; |
|
460 | 460 | $html = ''; |
461 | - $html .= '<div class="panel panel-default forum '.($row['thread_sticky']?'sticky':'').'">'; |
|
461 | + $html .= '<div class="panel panel-default forum '.($row['thread_sticky'] ? 'sticky' : '').'">'; |
|
462 | 462 | $html .= '<div class="panel-body">'; |
463 | 463 | $html .= '<div class="row">'; |
464 | 464 | $html .= '<div class="col-md-6">'; |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | ); |
491 | 491 | } |
492 | 492 | |
493 | - $html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>'; |
|
493 | + $html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>'; |
|
494 | 494 | $html .= '</div>'; |
495 | 495 | $html .= '<div class="col-md-10">'; |
496 | 496 | $html .= Display::tag( |
@@ -500,8 +500,8 @@ discard block |
||
500 | 500 | 'class' => 'title' |
501 | 501 | ) |
502 | 502 | ); |
503 | - $html .= '<p>'. get_lang('By') .' ' .$authorName.'</p>'; |
|
504 | - $html .= '<p>' . api_convert_and_format_date($row['insert_date']) . '</p>'; |
|
503 | + $html .= '<p>'.get_lang('By').' '.$authorName.'</p>'; |
|
504 | + $html .= '<p>'.api_convert_and_format_date($row['insert_date']).'</p>'; |
|
505 | 505 | $html .= '</div>'; |
506 | 506 | $html .= '</div>'; |
507 | 507 | |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | $html .= '<div class="row">'; |
511 | 511 | $html .= '<div class="col-md-4">' |
512 | 512 | . Display::return_icon('post-forum.png', null, null, ICON_SIZE_SMALL) |
513 | - . " {$row['thread_replies']} " . get_lang('Replies') . '<br>'; |
|
514 | - $html .= Display::return_icon( |
|
513 | + . " {$row['thread_replies']} ".get_lang('Replies').'<br>'; |
|
514 | + $html .= Display::return_icon( |
|
515 | 515 | 'post-forum.png', |
516 | 516 | null, |
517 | 517 | null, |
518 | 518 | ICON_SIZE_SMALL |
519 | - ) . ' ' . $row['thread_views'] . ' ' . get_lang('Views') . '<br>' . $newPost; |
|
519 | + ).' '.$row['thread_views'].' '.get_lang('Views').'<br>'.$newPost; |
|
520 | 520 | $html .= '</div>'; |
521 | 521 | |
522 | 522 | $last_post_info = get_last_post_by_thread( |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | if ($last_post_info) { |
531 | 531 | $poster_info = api_get_user_info($last_post_info['poster_id']); |
532 | 532 | $post_date = api_convert_and_format_date($last_post_info['post_date']); |
533 | - $last_post = $post_date . '<br>' . get_lang('By') . ' ' . display_user_link( |
|
533 | + $last_post = $post_date.'<br>'.get_lang('By').' '.display_user_link( |
|
534 | 534 | $last_post_info['poster_id'], |
535 | 535 | $poster_info['complete_name'], |
536 | 536 | '', |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | |
541 | 541 | $html .= '<div class="col-md-5">' |
542 | 542 | . Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) |
543 | - . ' ' . $last_post; |
|
543 | + . ' '.$last_post; |
|
544 | 544 | $html .= '</div>'; |
545 | 545 | $html .= '<div class="col-md-3">'; |
546 | 546 | $cidreq = api_get_cidreq(); |
@@ -555,11 +555,11 @@ discard block |
||
555 | 555 | if (api_is_allowed_to_edit(false, true) && |
556 | 556 | !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) |
557 | 557 | ) { |
558 | - $iconsEdit .= '<a href="' . $forumUrl . 'editthread.php?' . $cidreq |
|
559 | - . '&forum=' . intval($my_forum) . '&thread=' |
|
558 | + $iconsEdit .= '<a href="'.$forumUrl.'editthread.php?'.$cidreq |
|
559 | + . '&forum='.intval($my_forum).'&thread=' |
|
560 | 560 | . intval($row['thread_id']) |
561 | - . '&id_attach=' . $id_attach . '">' |
|
562 | - . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
561 | + . '&id_attach='.$id_attach.'">' |
|
562 | + . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
563 | 563 | if (api_resource_is_locked_by_gradebook($row['thread_id'], LINK_FORUM_THREAD)) { |
564 | 564 | $iconsEdit .= Display::return_icon( |
565 | 565 | 'delete_na.png', |
@@ -568,13 +568,13 @@ discard block |
||
568 | 568 | ICON_SIZE_SMALL |
569 | 569 | ); |
570 | 570 | } else { |
571 | - $iconsEdit.= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' |
|
572 | - . intval($my_forum) . '&action=delete&content=thread&id=' |
|
573 | - . $row['thread_id'] . $origin_string |
|
571 | + $iconsEdit .= '<a href="'.api_get_self().'?'.$cidreq.'&forum=' |
|
572 | + . intval($my_forum).'&action=delete&content=thread&id=' |
|
573 | + . $row['thread_id'].$origin_string |
|
574 | 574 | . "\" onclick=\"javascript:if(!confirm('" |
575 | 575 | . addslashes(api_htmlentities(get_lang('DeleteCompleteThread'), ENT_QUOTES)) |
576 | 576 | . "')) return false;\">" |
577 | - . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
577 | + . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | $iconsEdit .= return_visible_invisible_icon( |
@@ -597,9 +597,9 @@ discard block |
||
597 | 597 | 'gidReq' => api_get_group_id() |
598 | 598 | ) |
599 | 599 | ); |
600 | - $iconsEdit .= '<a href="viewforum.php?' . $cidreq . '&forum=' |
|
600 | + $iconsEdit .= '<a href="viewforum.php?'.$cidreq.'&forum=' |
|
601 | 601 | . intval($my_forum) |
602 | - . '&action=move&thread=' . $row['thread_id'] . $origin_string . '">' |
|
602 | + . '&action=move&thread='.$row['thread_id'].$origin_string.'">' |
|
603 | 603 | . Display::return_icon('move.png', get_lang('MoveThread'), array(), ICON_SIZE_SMALL) |
604 | 604 | . '</a>'; |
605 | 605 | } |
@@ -616,17 +616,17 @@ discard block |
||
616 | 616 | } |
617 | 617 | $icon_liststd = 'user.png'; |
618 | 618 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
619 | - $iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' |
|
619 | + $iconsEdit .= '<a href="'.api_get_self().'?'.$cidreq.'&forum=' |
|
620 | 620 | . Security::remove_XSS($my_forum) |
621 | 621 | . "&origin=$origin&action=notify&content=thread&id={$row['thread_id']}" |
622 | - . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>'; |
|
622 | + . '">'.Display::return_icon($iconnotify, get_lang('NotifyMe')).'</a>'; |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') { |
626 | - $iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' |
|
626 | + $iconsEdit .= '<a href="'.api_get_self().'?'.$cidreq.'&forum=' |
|
627 | 627 | . Security::remove_XSS($my_forum) |
628 | 628 | . "&origin=$origin&action=liststd&content=thread&id={$row['thread_id']}" |
629 | - . '">' . Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL) |
|
629 | + . '">'.Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL) |
|
630 | 630 | . '</a>'; |
631 | 631 | } |
632 | 632 | $html .= $iconsEdit; |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | $nParent = 0; // the number of /.. into the url |
41 | 41 | while (substr($cwd, -3, 3) == '/..') { |
42 | 42 | // go to parent directory |
43 | - $cwd= substr($cwd, 0, -3); |
|
44 | - if (strlen($cwd) == 0) { $cwd='/'; } |
|
43 | + $cwd = substr($cwd, 0, -3); |
|
44 | + if (strlen($cwd) == 0) { $cwd = '/'; } |
|
45 | 45 | $nParent++; |
46 | 46 | } |
47 | 47 | for (; $nParent > 0; $nParent--) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | if ($action == 'list') { |
57 | 57 | /*==== List files ====*/ |
58 | - if ($debug>0) { error_log("sending file list",0); } |
|
58 | + if ($debug > 0) { error_log("sending file list", 0); } |
|
59 | 59 | |
60 | 60 | // get files list |
61 | 61 | $files = DocumentManager::get_all_document_data($_course, $cwd, 0, NULL, false); |