@@ -33,7 +33,7 @@ |
||
33 | 33 | $result = Database::query($sql); |
34 | 34 | |
35 | 35 | if (Database::num_rows($result)) { |
36 | - $files = Database::store_result($result); |
|
36 | + $files = Database::store_result($result); |
|
37 | 37 | $rows = array(); |
38 | 38 | foreach ($files as $file) { |
39 | 39 | //Check if I have this file: |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $is_courseTutor = api_is_course_tutor(); |
127 | 127 | $is_courseAdmin = api_is_course_admin(); |
128 | 128 | |
129 | -$current_course_tool = TOOL_DROPBOX; |
|
129 | +$current_course_tool = TOOL_DROPBOX; |
|
130 | 130 | |
131 | 131 | // the dropbox configuration parameters |
132 | 132 | $dropbox_cnf = require_once 'dropbox_config.inc.php'; |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | $javascript .= " |
279 | 279 | </script>"; |
280 | 280 | $htmlHeadXtra[] = $javascript; |
281 | -$htmlHeadXtra[] ="<script> |
|
281 | +$htmlHeadXtra[] = "<script> |
|
282 | 282 | function confirmation (name) |
283 | 283 | { |
284 | - if (confirm(\" ". get_lang("AreYouSureToDeleteJS") ." \"+ name + \" ?\")) |
|
284 | + if (confirm(\" ". get_lang("AreYouSureToDeleteJS")." \"+ name + \" ?\")) |
|
285 | 285 | {return true;} |
286 | 286 | else |
287 | 287 | {return false;} |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | |
322 | 322 | if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(null, true)) { |
323 | 323 | if ($origin != 'learnpath') { |
324 | - api_not_allowed(true);//print headers/footers |
|
324 | + api_not_allowed(true); //print headers/footers |
|
325 | 325 | } else { |
326 | 326 | api_not_allowed(); |
327 | 327 | } |
@@ -220,23 +220,23 @@ discard block |
||
220 | 220 | |
221 | 221 | if (api_get_session_id() == 0) { |
222 | 222 | echo '<div class="actions">'; |
223 | - if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
224 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
223 | + if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
224 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
225 | 225 | echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
226 | 226 | $movelist[0] = 'Root'; // move_received selectbox content |
227 | 227 | } else { |
228 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
228 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
229 | 229 | } |
230 | 230 | echo '</div>'; |
231 | 231 | } else { |
232 | 232 | if (api_is_allowed_to_session_edit(false, true)) { |
233 | 233 | echo '<div class="actions">'; |
234 | 234 | if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
235 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
235 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
236 | 236 | echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
237 | 237 | $movelist[0] = 'Root'; // move_received selectbox content |
238 | 238 | } else { |
239 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
239 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
240 | 240 | } |
241 | 241 | echo '</div>'; |
242 | 242 | } |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | if (api_get_session_id() == 0) { |
257 | 257 | echo '<div class="actions">'; |
258 | 258 | if ($view_dropbox_category_sent != 0) { |
259 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
259 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
260 | 260 | echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
261 | 261 | } else { |
262 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n"; |
|
262 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM)."</a>\n"; |
|
263 | 263 | } |
264 | 264 | if (empty($viewSentCategory)) { |
265 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
265 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
266 | 266 | } |
267 | 267 | echo '</div>'; |
268 | 268 | } else { |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | echo '<div class="actions">'; |
271 | 271 | if ($view_dropbox_category_sent != 0) { |
272 | 272 | echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
273 | - echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
273 | + echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
274 | 274 | } else { |
275 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n"; |
|
275 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM)."</a>\n"; |
|
276 | 276 | } |
277 | 277 | if (empty($viewSentCategory)) { |
278 | - echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
278 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
279 | 279 | } |
280 | 280 | echo '</div>'; |
281 | 281 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | |
329 | 329 | if (api_get_session_id() == 0) { |
330 | 330 | $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
331 | - } elseif (api_is_allowed_to_session_edit(false,true)) { |
|
331 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
332 | 332 | $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
333 | 333 | } |
334 | 334 | |
@@ -373,13 +373,13 @@ discard block |
||
373 | 373 | if ($dropbox_file->last_upload_date > $last_access && |
374 | 374 | !in_array($dropbox_file->id, $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX]) |
375 | 375 | ) { |
376 | - $new_icon = ' '.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL); |
|
376 | + $new_icon = ' '.Display::return_icon('new_dropbox_message.png', get_lang('New'), '', ICON_SIZE_SMALL); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
380 | 380 | $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
381 | 381 | $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
382 | - Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description; |
|
382 | + Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description; |
|
383 | 383 | $file_size = $dropbox_file->filesize; |
384 | 384 | $dropbox_file_data[] = format_file_size($file_size); |
385 | 385 | $dropbox_file_data[] = $dropbox_file->author; |
@@ -389,10 +389,10 @@ discard block |
||
389 | 389 | api_format_date($last_upload_date).'</span>'; |
390 | 390 | |
391 | 391 | $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
392 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a> |
|
393 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a> |
|
392 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).'</a> |
|
393 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'</a> |
|
394 | 394 | <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'. |
395 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
395 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
396 | 396 | |
397 | 397 | // This is a hack to have an additional row in a sortable table |
398 | 398 | |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | // The icon of the category |
427 | 427 | $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">'; |
428 | 428 | $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>'; |
429 | - $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>'; |
|
429 | + $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>'; |
|
430 | 430 | $dropbox_category_data[] = ''; |
431 | 431 | $dropbox_category_data[] = ''; |
432 | 432 | $dropbox_category_data[] = ''; |
433 | - $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> |
|
434 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
433 | + $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> |
|
434 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
435 | 435 | } |
436 | 436 | if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
437 | 437 | $dropbox_data_recieved[] = $dropbox_category_data; |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | ); |
452 | 452 | |
453 | 453 | if (is_array($movelist)) { |
454 | - foreach ($movelist as $catid => $catname){ |
|
455 | - $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
454 | + foreach ($movelist as $catid => $catname) { |
|
455 | + $selectlist['move_received_'.$catid] = get_lang('Move').'->'.Security::remove_XSS($catname); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
547 | 547 | $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
548 | 548 | $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
549 | - Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description; |
|
549 | + Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description; |
|
550 | 550 | $file_size = $dropbox_file->filesize; |
551 | 551 | $dropbox_file_data[] = format_file_size($file_size); |
552 | 552 | $receivers_celldata = null; |
@@ -563,9 +563,9 @@ discard block |
||
563 | 563 | $receivers_celldata = ''; |
564 | 564 | |
565 | 565 | $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
566 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a> |
|
567 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a> |
|
568 | - <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
566 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).'</a> |
|
567 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'</a> |
|
568 | + <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
569 | 569 | // This is a hack to have an additional row in a sortable table |
570 | 570 | if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) { |
571 | 571 | $action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table |
@@ -594,16 +594,16 @@ discard block |
||
594 | 594 | // This is where the checkbox icon for the files appear. |
595 | 595 | $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">'; |
596 | 596 | $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>'; |
597 | - $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>'; |
|
597 | + $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>'; |
|
598 | 598 | //$dropbox_category_data[] = ''; |
599 | 599 | $dropbox_category_data[] = ''; |
600 | 600 | //$dropbox_category_data[] = ''; |
601 | 601 | $dropbox_category_data[] = ''; |
602 | 602 | $dropbox_category_data[] = ''; |
603 | 603 | $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'. |
604 | - Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> |
|
604 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> |
|
605 | 605 | <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'. |
606 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
606 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
607 | 607 | } |
608 | 608 | if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
609 | 609 | $dropbox_data_sent[] = $dropbox_category_data; |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | |
626 | 626 | if (!empty($moveList)) { |
627 | 627 | foreach ($moveList as $catid => $catname) { |
628 | - $selectlist['move_sent_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
628 | + $selectlist['move_sent_'.$catid] = get_lang('Move').'->'.Security::remove_XSS($catname); |
|
629 | 629 | } |
630 | 630 | } |
631 | 631 |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | // the author or description field is empty |
26 | - if (!isset($_POST['authors']) || !isset( $_POST['description'])) { |
|
26 | + if (!isset($_POST['authors']) || !isset($_POST['description'])) { |
|
27 | 27 | $error = true; |
28 | 28 | $errormsg = get_lang('BadFormData'); |
29 | - } elseif (!isset( $_POST['recipients']) || count( $_POST['recipients']) <= 0) { |
|
29 | + } elseif (!isset($_POST['recipients']) || count($_POST['recipients']) <= 0) { |
|
30 | 30 | $error = true; |
31 | 31 | $errormsg = get_lang('NoUserSelected'); |
32 | 32 | } else { |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | // we are doing a mailing but an additional recipient is selected |
51 | - if ($thisIsAMailing && ( count($_POST['recipients']) != 1)) { |
|
51 | + if ($thisIsAMailing && (count($_POST['recipients']) != 1)) { |
|
52 | 52 | $error = true; |
53 | 53 | $errormsg = get_lang('MailingSelectNoOther'); |
54 | 54 | } |
55 | 55 | // we are doing a just upload but an additional recipient is selected. |
56 | - elseif ( $thisIsJustUpload && ( count($_POST['recipients']) != 1)) { |
|
56 | + elseif ($thisIsJustUpload && (count($_POST['recipients']) != 1)) { |
|
57 | 57 | $error = true; |
58 | 58 | $errormsg = get_lang('MailingJustUploadSelectNoOther'); |
59 | 59 | } elseif (empty($_FILES['file']['name'])) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | } else { |
127 | 127 | // rename file to login_filename_uniqueId format |
128 | - $dropbox_filename = getLoginFromId( $_user['user_id']) . '_' . $dropbox_filename . '_'.uniqid(''); |
|
128 | + $dropbox_filename = getLoginFromId($_user['user_id']).'_'.$dropbox_filename.'_'.uniqid(''); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | if (!is_dir(dropbox_cnf('sysPath'))) { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $newWorkRecipients = dropbox_cnf('mailingIdBase'); |
148 | 148 | } else { |
149 | 149 | $error = true; |
150 | - $errormsg = $dropbox_title . ': ' . get_lang('MailingWrongZipfile'); |
|
150 | + $errormsg = $dropbox_title.': '.get_lang('MailingWrongZipfile'); |
|
151 | 151 | } |
152 | 152 | } elseif ($thisIsJustUpload) { |
153 | 153 | $newWorkRecipients = array(); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | // After uploading the file, create the db entries |
172 | 172 | |
173 | 173 | if (!$error) { |
174 | - @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename) |
|
174 | + @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath').'/'.$dropbox_filename) |
|
175 | 175 | or die(get_lang('UploadError').' (code 407)'); |
176 | 176 | new Dropbox_SentWork($_user['user_id'], $dropbox_title, $_POST['description'], strip_tags($_POST['authors']), $dropbox_filename, $dropbox_filesize, $newWorkRecipients); |
177 | 177 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * - EDIT FEEDBACK |
199 | 199 | */ |
200 | 200 | if (isset($_GET['deleteReceived']) || isset($_GET['deleteSent']) |
201 | - || isset( $_GET['showFeedback']) || isset( $_GET['editFeedback'])) { |
|
201 | + || isset($_GET['showFeedback']) || isset($_GET['editFeedback'])) { |
|
202 | 202 | if ($_GET['mailing']) { |
203 | 203 | getUserOwningThisMailing($_GET['mailing'], $_user['user_id'], '408'); |
204 | 204 | $dropbox_person = new Dropbox_Person($_GET['mailing'], $is_courseAdmin, $is_courseTutor); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | if ($_GET['deleteReceived'] == 'all') { |
224 | 224 | $dropbox_person->deleteAllReceivedWork(); |
225 | 225 | } elseif (is_numeric($_GET['deleteReceived'])) { |
226 | - $dropbox_person->deleteReceivedWork( $_GET['deleteReceived']); |
|
226 | + $dropbox_person->deleteReceivedWork($_GET['deleteReceived']); |
|
227 | 227 | } else { |
228 | 228 | die(get_lang('GeneralError').' (code 409)'); |
229 | 229 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | 'hasAttachments' => $hasAttachments, |
119 | 119 | 'platform' => array( |
120 | 120 | 'website' => api_get_path(WEB_PATH), |
121 | - 'messagingTool' => api_get_path(WEB_PATH) . 'main/messages/inbox.php' |
|
121 | + 'messagingTool' => api_get_path(WEB_PATH).'main/messages/inbox.php' |
|
122 | 122 | ) |
123 | 123 | ); |
124 | 124 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | $headers = [ |
204 | - 'Authorization: key=' . $gdcApiKey, |
|
204 | + 'Authorization: key='.$gdcApiKey, |
|
205 | 205 | 'Content-Type: application/json' |
206 | 206 | ]; |
207 | 207 |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | * @returns an array such as: for all i in [0..max[x][ : for all j in [0..max[y][ : array[i][j] = FALSE |
14 | 14 | */ |
15 | 15 | function poly_init($max) { |
16 | - return array_fill(0, $max["x"]-1, |
|
17 | - array_fill(0, $max["y"]-1, FALSE)); |
|
16 | + return array_fill(0, $max["x"] - 1, |
|
17 | + array_fill(0, $max["y"] - 1, FALSE)); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | array_push($bords[$poly[0]['y']], $poly[0]['x']); |
70 | 70 | |
71 | 71 | $i = 1; // we re-use $i and $old_pente bellow the loop |
72 | - $old_pente=0; |
|
73 | - for ( ; // for each points of the polygon but the first |
|
74 | - $i<sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) { |
|
72 | + $old_pente = 0; |
|
73 | + for (; // for each points of the polygon but the first |
|
74 | + $i < sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) { |
|
75 | 75 | |
76 | 76 | /* special cases */ |
77 | - if ($poly[$i-1]['y'] == $poly[$i]['y']) { |
|
78 | - if ($poly[$i-1]['x'] == $poly[$i]['x']) |
|
77 | + if ($poly[$i - 1]['y'] == $poly[$i]['y']) { |
|
78 | + if ($poly[$i - 1]['x'] == $poly[$i]['x']) |
|
79 | 79 | continue; // twice the same point |
80 | 80 | else { // infinite elevation of the edge |
81 | 81 | if (is_array($bords[$poly[$i]['y']])) |
82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
83 | - $old_pente=0; |
|
82 | + array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
|
83 | + $old_pente = 0; |
|
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | } |
@@ -93,17 +93,17 @@ discard block |
||
93 | 93 | |
94 | 94 | /* computing the elevation of the edge going */ |
95 | 95 | // from $poly[$i-1] to $poly[$i] |
96 | - $pente = ($poly[$i-1]['x']-$poly[$i]['x'])/ |
|
97 | - ($poly[$i-1]['y']-$poly[$i]['y']); |
|
96 | + $pente = ($poly[$i - 1]['x'] - $poly[$i]['x']) / |
|
97 | + ($poly[$i - 1]['y'] - $poly[$i]['y']); |
|
98 | 98 | |
99 | 99 | // if the sign of the elevation change from the one of the |
100 | 100 | // previous edge, the point must be added a second time inside |
101 | 101 | // $bords |
102 | - if ($i>1) |
|
103 | - if (($old_pente<0 && $pente>0) |
|
104 | - || ($old_pente>0 && $pente<0)) { |
|
102 | + if ($i > 1) |
|
103 | + if (($old_pente < 0 && $pente > 0) |
|
104 | + || ($old_pente > 0 && $pente < 0)) { |
|
105 | 105 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
106 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
106 | + array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
|
107 | 107 | |
108 | 108 | if (DEBUG) |
109 | 109 | echo '*('.$poly[$i]['x']. |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | /* detect the direction of the elevation in Y */ |
114 | - $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1; |
|
115 | - $x = $poly[$i-1]['x']; |
|
114 | + $dy_inc = ($poly[$i]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1; |
|
115 | + $x = $poly[$i - 1]['x']; |
|
116 | 116 | // if (DEBUG) echo "init: ".$poly[$i-1]['y']." dy_inc: ".$dy_inc. |
117 | 117 | // " end: ".$poly[$i]['y']." pente:".$pente; |
118 | 118 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | |
122 | 122 | // we iterate w/ $dy in ]$poly[$i-1]['y'],$poly[$i-1]['y'][ |
123 | 123 | // w/ $dy_inc as increment |
124 | - for ($dy = $poly[$i-1]['y']+$dy_inc; |
|
124 | + for ($dy = $poly[$i - 1]['y'] + $dy_inc; |
|
125 | 125 | $dy != $poly[$i]['y']; |
126 | 126 | $dy += $dy_inc) { |
127 | - $x += $pente*$dy_inc; |
|
127 | + $x += $pente * $dy_inc; |
|
128 | 128 | array_push($bords[$dy], $x); |
129 | 129 | // if (DEBUG) echo '/('.$x.';'.$dy.') '; |
130 | 130 | } |
@@ -132,47 +132,47 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | // closing the polygone (the edge between $poly[$i-1] and $poly[0]) |
135 | - if ($poly[$i-1]['y']!=$poly[0]['y']) {// droite--> rien à faire |
|
135 | + if ($poly[$i - 1]['y'] != $poly[0]['y']) {// droite--> rien à faire |
|
136 | 136 | |
137 | 137 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
138 | - $rest = $poly[0]['y']-$poly[1]['y']; |
|
139 | - if ($rest!=0) |
|
140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
138 | + $rest = $poly[0]['y'] - $poly[1]['y']; |
|
139 | + if ($rest != 0) |
|
140 | + $pente1 = ($poly[0]['x'] - $poly[1]['x']) / ($rest); |
|
141 | 141 | else |
142 | 142 | $pente1 = 0; |
143 | 143 | |
144 | 144 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
145 | - $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
|
146 | - ($poly[$i-1]['y']-$poly[0]['y']); |
|
145 | + $pente = ($poly[$i - 1]['x'] - $poly[0]['x']) / |
|
146 | + ($poly[$i - 1]['y'] - $poly[0]['y']); |
|
147 | 147 | |
148 | 148 | // if (DEBUG) echo 'start('.$poly[$i-1]['x'].','.$poly[$i-1]['y']. |
149 | 149 | // ')-end('.$poly[0]['x'].','.$poly[0]['y']. |
150 | 150 | // ')-pente'.$pente; |
151 | 151 | |
152 | 152 | // doubling the first point if needed (see above) |
153 | - if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
|
153 | + if (($pente1 < 0 && $pente > 0) || ($pente1 > 0 && $pente < 0)) { |
|
154 | 154 | if (is_array($bords[$poly[$i - 1]['y']])) |
155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
155 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
156 | 156 | //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
157 | 157 | } |
158 | 158 | // doubling the last point if neededd |
159 | - if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) { |
|
160 | - if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
161 | - array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
|
159 | + if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) { |
|
160 | + if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning |
|
161 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
162 | 162 | //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
163 | 163 | } |
164 | 164 | |
165 | 165 | |
166 | - $dy_inc = ($poly[0]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1; |
|
167 | - $x = $poly[$i-1]['x']; |
|
166 | + $dy_inc = ($poly[0]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1; |
|
167 | + $x = $poly[$i - 1]['x']; |
|
168 | 168 | // if (DEBUG) echo "init: ".$poly[$i-1]['y']." dy_inc: ".$dy_inc. |
169 | 169 | // " end: ".$poly[0]['y']; |
170 | 170 | |
171 | - for ($dy = $poly[$i-1]['y']+$dy_inc; |
|
171 | + for ($dy = $poly[$i - 1]['y'] + $dy_inc; |
|
172 | 172 | $dy != $poly[0]['y']; |
173 | 173 | $dy += $dy_inc) |
174 | 174 | { |
175 | - $x += $pente*$dy_inc; |
|
175 | + $x += $pente * $dy_inc; |
|
176 | 176 | array_push($bords[$dy], round($x)); |
177 | 177 | // if (DEBUG) echo '/('.$x.';'.$dy.') '; |
178 | 178 | } |
@@ -182,20 +182,20 @@ discard block |
||
182 | 182 | /* basic idea: we sort a column of edges. |
183 | 183 | For each pair of point, we color the points in between */ |
184 | 184 | $n = count($bords); |
185 | - for ($i = 0; $i<$n; $i++) { // Y |
|
185 | + for ($i = 0; $i < $n; $i++) { // Y |
|
186 | 186 | //error_log(__FILE__.' - Border Num '.$i,0); |
187 | 187 | if (is_array($bords[$i])) { |
188 | 188 | sort($bords[$i]); |
189 | 189 | } |
190 | 190 | |
191 | - for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords |
|
191 | + for ($j = 0; $j < sizeof($bords[$i]); $j += 2) { // bords |
|
192 | 192 | if (!isset($bords[$i][$j + 1])) { |
193 | 193 | break; |
194 | 194 | } |
195 | 195 | |
196 | - for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) { |
|
196 | + for ($k = round($bords[$i][$j]); $k <= $bords[$i][$j + 1]; $k++) { |
|
197 | 197 | $res[$k][$i] = true; //filling the array with trues |
198 | - if ($test == 1) { |
|
198 | + if ($test == 1) { |
|
199 | 199 | /*how to draw the polygon in a human way: |
200 | 200 | In ubuntu : sudo apt-get install gnuplot |
201 | 201 | Create an empty file with all points with the result of this echos (No commas, no point, no headers) |
@@ -222,19 +222,19 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @return string html code of the representation of the polygone image |
224 | 224 | */ |
225 | -function poly_dump(&$poly, $max, $format='raw') { |
|
225 | +function poly_dump(&$poly, $max, $format = 'raw') { |
|
226 | 226 | if ($format == 'html') { |
227 | 227 | $s = "<div style='font-size: 8px; line-height:3px'><pre>\n"; |
228 | 228 | } |
229 | - for ($i=0; $i<$max['y']; $i++) { |
|
230 | - for($j=0; $j<$max['x']; $j++) |
|
231 | - if($poly[$j][$i] == TRUE) |
|
232 | - $s .= ($format=='html'?"<b>1</b>":'1'); |
|
229 | + for ($i = 0; $i < $max['y']; $i++) { |
|
230 | + for ($j = 0; $j < $max['x']; $j++) |
|
231 | + if ($poly[$j][$i] == TRUE) |
|
232 | + $s .= ($format == 'html' ? "<b>1</b>" : '1'); |
|
233 | 233 | else |
234 | 234 | $s .= "0"; |
235 | - $s .= ($format=='html'?"<br />\n":"\n"); |
|
235 | + $s .= ($format == 'html' ? "<br />\n" : "\n"); |
|
236 | 236 | } |
237 | - $s .= ($format=='html'?"</pre></div>\n":"\n"); |
|
237 | + $s .= ($format == 'html' ? "</pre></div>\n" : "\n"); |
|
238 | 238 | return $s; |
239 | 239 | } |
240 | 240 | |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | $surfaceOf1 = 0; |
253 | 253 | $surfaceOf2 = 0; |
254 | 254 | |
255 | - for ($i=0; $i<$max['x']; $i++) |
|
256 | - for($j=0; $j<$max['y']; $j++) { |
|
255 | + for ($i = 0; $i < $max['x']; $i++) |
|
256 | + for ($j = 0; $j < $max['y']; $j++) { |
|
257 | 257 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) { |
258 | 258 | $surfaceOf1++; |
259 | 259 | if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $surfaceOf2++; |
264 | 264 | } |
265 | 265 | |
266 | - return array ( |
|
266 | + return array( |
|
267 | 267 | "s1" => $surfaceOf1, |
268 | 268 | "s2" => $surfaceOf2, |
269 | 269 | "both" => $surfaceOf1 - $onlyIn1, |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | */ |
283 | 283 | function poly_touch(&$poly1, &$poly2, $max) { |
284 | 284 | |
285 | - for ($i=0; $i<$max['x']; $i++) { |
|
286 | - for($j=0; $j<$max['y']; $j++) { |
|
285 | + for ($i = 0; $i < $max['x']; $i++) { |
|
286 | + for ($j = 0; $j < $max['y']; $j++) { |
|
287 | 287 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == true) |
288 | 288 | && isset($poly2[$i][$j]) && ($poly2[$i][$j] == true)) { |
289 | 289 | return true; |
@@ -301,12 +301,12 @@ discard block |
||
301 | 301 | * @return array An array of points in the right format to use with the |
302 | 302 | * local functions |
303 | 303 | */ |
304 | -function convert_coordinates($coords,$sep='|') { |
|
304 | +function convert_coordinates($coords, $sep = '|') { |
|
305 | 305 | $points = array(); |
306 | - $pairs = explode($sep,$coords); |
|
306 | + $pairs = explode($sep, $coords); |
|
307 | 307 | foreach ($pairs as $idx => $pcoord) { |
308 | - list($x,$y) = explode(';',$pcoord); |
|
309 | - $points[] = array('x'=>$x,'y'=>$y); |
|
308 | + list($x, $y) = explode(';', $pcoord); |
|
309 | + $points[] = array('x'=>$x, 'y'=>$y); |
|
310 | 310 | } |
311 | 311 | return $points; |
312 | 312 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $my = $coord['y']; |
337 | 337 | } |
338 | 338 | } |
339 | - return array('x'=>$mx,'y'=>$my); |
|
339 | + return array('x'=>$mx, 'y'=>$my); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @package chamilo.forum |
22 | 22 | */ |
23 | 23 | |
24 | -$forumUrl = api_get_path(WEB_CODE_PATH) . 'forum/'; |
|
24 | +$forumUrl = api_get_path(WEB_CODE_PATH).'forum/'; |
|
25 | 25 | $_user = api_get_user_info(); |
26 | 26 | $sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : 'ASC'; |
27 | 27 | $rows = getPosts($current_forum, $_GET['thread'], $sortDirection, true); |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | // Are we in a lp ? |
43 | 43 | $origin = ''; |
44 | 44 | if (isset($_GET['origin'])) { |
45 | - $origin = Security::remove_XSS($_GET['origin']); |
|
45 | + $origin = Security::remove_XSS($_GET['origin']); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Delete attachment file. |
49 | 49 | if ( |
50 | 50 | isset($_GET['action']) && |
51 | - $_GET['action']=='delete_attach' && |
|
51 | + $_GET['action'] == 'delete_attach' && |
|
52 | 52 | isset($_GET['id_attach']) |
53 | 53 | ) { |
54 | 54 | delete_attachment(0, $_GET['id_attach']); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | // Displaying the thread (structure) |
61 | 61 | |
62 | -$thread_structure = "<div class=\"structure\">" .get_lang('Structure')."</div>"; |
|
62 | +$thread_structure = "<div class=\"structure\">".get_lang('Structure')."</div>"; |
|
63 | 63 | $counter = 0; |
64 | 64 | $count = 0; |
65 | 65 | $prev_next_array = array(); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | foreach ($rows as $post) { |
72 | 72 | $counter++; |
73 | 73 | $indent = $post['indent_cnt'] * '20'; |
74 | - $thread_structure .= "<div style=\"margin-left: " . $indent . "px;\">"; |
|
74 | + $thread_structure .= "<div style=\"margin-left: ".$indent."px;\">"; |
|
75 | 75 | |
76 | 76 | if ( |
77 | 77 | !empty($whatsnew_post_info[$forumId][$post['thread_id']]) && |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $counter == 1 AND !isset($_GET['post']) |
90 | 90 | ) |
91 | 91 | ) { |
92 | - $thread_structure .= '<strong>' .prepare4display($post['post_title']) . '</strong></div>'; |
|
92 | + $thread_structure .= '<strong>'.prepare4display($post['post_title']).'</strong></div>'; |
|
93 | 93 | $prev_next_array[] = $post['post_id']; |
94 | 94 | } else { |
95 | 95 | if ($post['visible'] == '0') { |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $class = ''; |
99 | 99 | } |
100 | 100 | $count_loop = ($count == 0) ? '&id=1' : ''; |
101 | - $thread_structure .= "<a href=\"viewthread.php?" . api_get_cidreq() . |
|
102 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
103 | - "&post=" . $post['post_id'] . "&origin=$origin$count_loop\"" . |
|
104 | - "$class>" . prepare4display($post['post_title']) . "</a></div>"; |
|
101 | + $thread_structure .= "<a href=\"viewthread.php?".api_get_cidreq(). |
|
102 | + "&forum=".$forumId."&thread=".$threadId. |
|
103 | + "&post=".$post['post_id']."&origin=$origin$count_loop\"". |
|
104 | + "$class>".prepare4display($post['post_title'])."</a></div>"; |
|
105 | 105 | $prev_next_array[] = $post['post_id']; |
106 | 106 | } |
107 | 107 | $count++; |
@@ -148,43 +148,43 @@ discard block |
||
148 | 148 | $class_next = ''; |
149 | 149 | |
150 | 150 | // Links |
151 | -$first_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
152 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
153 | - '&gradebook=' . $gradebook . '&id=1&post=' . $prev_next_array[0]; |
|
154 | -$last_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
155 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
156 | - '&gradebook=' . $gradebook . '&post=' . $prev_next_array[$max-1]; |
|
157 | -$prev_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
158 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
159 | - '&gradebook=' . $gradebook . '&post=' . $prev_next_array[$prev_id]; |
|
160 | -$next_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
161 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
162 | - '&post=' . $prev_next_array[$next_id]; |
|
151 | +$first_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
152 | + '&forum='.$forumId.'&thread='.$threadId. |
|
153 | + '&gradebook='.$gradebook.'&id=1&post='.$prev_next_array[0]; |
|
154 | +$last_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
155 | + '&forum='.$forumId.'&thread='.$threadId. |
|
156 | + '&gradebook='.$gradebook.'&post='.$prev_next_array[$max - 1]; |
|
157 | +$prev_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
158 | + '&forum='.$forumId.'&thread='.$threadId. |
|
159 | + '&gradebook='.$gradebook.'&post='.$prev_next_array[$prev_id]; |
|
160 | +$next_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
161 | + '&forum='.$forumId.'&thread='.$threadId. |
|
162 | + '&post='.$prev_next_array[$next_id]; |
|
163 | 163 | |
164 | 164 | echo '<center style="margin-top: 10px; margin-bottom: 10px;">'; |
165 | 165 | // Go to: first and previous |
166 | 166 | if (((int) $current_id) > 0) { |
167 | - echo '<a href="' . $first_href . '" ' . $class . ' title=' . |
|
168 | - $first_message . '>' . $first_img . ' ' . $first_message .'</a>'; |
|
169 | - echo '<a href="' . $prev_href . '" ' . $class_prev . ' title=' . |
|
170 | - $prev_message . '>' . $prev_img . ' ' . $prev_message . '</a>'; |
|
167 | + echo '<a href="'.$first_href.'" '.$class.' title='. |
|
168 | + $first_message.'>'.$first_img.' '.$first_message.'</a>'; |
|
169 | + echo '<a href="'.$prev_href.'" '.$class_prev.' title='. |
|
170 | + $prev_message.'>'.$prev_img.' '.$prev_message.'</a>'; |
|
171 | 171 | } else { |
172 | - echo '<b><span class="invisible">' . |
|
173 | - $first_img . ' ' . $first_message . '</b></span>'; |
|
174 | - echo '<b><span class="invisible">' . |
|
175 | - $prev_img . ' ' . $prev_message . '</b></span>'; |
|
172 | + echo '<b><span class="invisible">'. |
|
173 | + $first_img.' '.$first_message.'</b></span>'; |
|
174 | + echo '<b><span class="invisible">'. |
|
175 | + $prev_img.' '.$prev_message.'</b></span>'; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | // Current counter |
179 | -echo ' [ ' . ($current_id + 1) . ' / ' . $max . ' ] '; |
|
179 | +echo ' [ '.($current_id + 1).' / '.$max.' ] '; |
|
180 | 180 | |
181 | 181 | // Go to: next and last |
182 | 182 | if (($current_id + 1) < $max) { |
183 | - echo '<a href="' . $next_href . '" ' . $class_next . ' title=' . $next_message . '>' . $next_message . ' ' . $next_img . '</a>'; |
|
184 | - echo '<a href="' . $last_href . '" ' . $class . ' title=' . $last_message . '>' . $last_message . ' ' . $last_img . '</a>'; |
|
183 | + echo '<a href="'.$next_href.'" '.$class_next.' title='.$next_message.'>'.$next_message.' '.$next_img.'</a>'; |
|
184 | + echo '<a href="'.$last_href.'" '.$class.' title='.$last_message.'>'.$last_message.' '.$last_img.'</a>'; |
|
185 | 185 | } else { |
186 | - echo '<b><span class="invisible">' . $next_message . ' ' . $next_img . '</b></span>'; |
|
187 | - echo '<b><span class="invisible">' . $last_message . ' ' . $last_img . '</b></span>'; |
|
186 | + echo '<b><span class="invisible">'.$next_message.' '.$next_img.'</b></span>'; |
|
187 | + echo '<b><span class="invisible">'.$last_message.' '.$last_img.'</b></span>'; |
|
188 | 188 | } |
189 | 189 | echo '</center>'; |
190 | 190 | |
@@ -218,18 +218,18 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | if (api_get_course_setting('allow_user_image_forum')) { |
221 | - echo '<br />' . display_user_image($rows[$display_post_id]['user_id'], $name, $origin) . '<br />'; |
|
221 | + echo '<br />'.display_user_image($rows[$display_post_id]['user_id'], $name, $origin).'<br />'; |
|
222 | 222 | } |
223 | 223 | echo display_user_link( |
224 | 224 | $rows[$display_post_id]['user_id'], |
225 | 225 | $name, |
226 | 226 | $origin, |
227 | 227 | $username |
228 | -) . "<br />"; |
|
228 | +)."<br />"; |
|
229 | 229 | |
230 | 230 | echo api_convert_and_format_date( |
231 | 231 | $rows[$display_post_id]['post_date'] |
232 | -) . '<br /><br />'; |
|
232 | +).'<br /><br />'; |
|
233 | 233 | // Get attach id |
234 | 234 | $attachment_list = get_attachment($display_post_id); |
235 | 235 | $id_attach = !empty($attachment_list) ? $attachment_list['id'] : ''; |
@@ -248,16 +248,16 @@ discard block |
||
248 | 248 | ) |
249 | 249 | ) { |
250 | 250 | if ($locked == false) { |
251 | - echo "<a href=\"editpost.php?" . api_get_cidreq() . |
|
252 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
253 | - "&post=" . $rows[$display_post_id]['post_id'] . |
|
254 | - "&id_attach=" . $id_attach . "\">" . |
|
251 | + echo "<a href=\"editpost.php?".api_get_cidreq(). |
|
252 | + "&forum=".$forumId."&thread=".$threadId. |
|
253 | + "&post=".$rows[$display_post_id]['post_id']. |
|
254 | + "&id_attach=".$id_attach."\">". |
|
255 | 255 | Display::return_icon( |
256 | 256 | 'edit.png', |
257 | 257 | get_lang('Edit'), |
258 | 258 | array(), |
259 | 259 | ICON_SIZE_SMALL |
260 | - ) . '</a>'; |
|
260 | + ).'</a>'; |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | sort($id_posts, SORT_NUMERIC); |
274 | 274 | reset($id_posts); |
275 | 275 | // The post minor |
276 | - $post_minor = (int)$id_posts[0]; |
|
276 | + $post_minor = (int) $id_posts[0]; |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | if ( |
@@ -282,13 +282,13 @@ discard block |
||
282 | 282 | !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) |
283 | 283 | ) { |
284 | 284 | if ($locked == false) { |
285 | - echo "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . |
|
286 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
287 | - "&action=delete&content=post&id=" . |
|
288 | - $rows[$display_post_id]['post_id'] . |
|
289 | - "\" onclick=\"javascript:if(!confirm('" . |
|
290 | - addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)) . |
|
291 | - "')) return false;\">" . Display::return_icon( |
|
285 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq(). |
|
286 | + "&forum=".$forumId."&thread=".$threadId. |
|
287 | + "&action=delete&content=post&id=". |
|
288 | + $rows[$display_post_id]['post_id']. |
|
289 | + "\" onclick=\"javascript:if(!confirm('". |
|
290 | + addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)). |
|
291 | + "')) return false;\">".Display::return_icon( |
|
292 | 292 | 'delete.png', |
293 | 293 | get_lang('Delete'), |
294 | 294 | array(), |
@@ -307,16 +307,16 @@ discard block |
||
307 | 307 | ); |
308 | 308 | |
309 | 309 | if (!isset($_GET['id']) && $post_id > $post_minor) { |
310 | - echo "<a href=\"viewthread.php?" . api_get_cidreq() . |
|
311 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
312 | - "&origin=" . $origin . "&action=move&post=" . |
|
313 | - $rows[$display_post_id]['post_id'] . "\">" . |
|
310 | + echo "<a href=\"viewthread.php?".api_get_cidreq(). |
|
311 | + "&forum=".$forumId."&thread=".$threadId. |
|
312 | + "&origin=".$origin."&action=move&post=". |
|
313 | + $rows[$display_post_id]['post_id']."\">". |
|
314 | 314 | Display::return_icon( |
315 | 315 | 'move.png', |
316 | 316 | get_lang('MovePost'), |
317 | 317 | array(), |
318 | 318 | ICON_SIZE_SMALL |
319 | - ) . "</a>"; |
|
319 | + )."</a>"; |
|
320 | 320 | |
321 | 321 | } |
322 | 322 | } |
@@ -339,16 +339,16 @@ discard block |
||
339 | 339 | ); |
340 | 340 | |
341 | 341 | if ($locked == false) { |
342 | - echo "<a href=\"forumqualify.php?" . api_get_cidreq() . |
|
343 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
344 | - "&action=list&post=" . $rows[$display_post_id]['post_id'] . |
|
345 | - "&user=" . $rows[$display_post_id]['user_id'] . "&user_id=" . |
|
346 | - $rows[$display_post_id]['user_id'] . "&origin=" . $origin . |
|
347 | - "&idtextqualify=" . $current_qualify_thread . |
|
348 | - "\" >" . Display::return_icon( |
|
342 | + echo "<a href=\"forumqualify.php?".api_get_cidreq(). |
|
343 | + "&forum=".$forumId."&thread=".$threadId. |
|
344 | + "&action=list&post=".$rows[$display_post_id]['post_id']. |
|
345 | + "&user=".$rows[$display_post_id]['user_id']."&user_id=". |
|
346 | + $rows[$display_post_id]['user_id']."&origin=".$origin. |
|
347 | + "&idtextqualify=".$current_qualify_thread. |
|
348 | + "\" >".Display::return_icon( |
|
349 | 349 | 'quiz.gif', |
350 | 350 | get_lang('Qualify') |
351 | - ) . "</a>"; |
|
351 | + )."</a>"; |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | } |
@@ -360,33 +360,33 @@ discard block |
||
360 | 360 | ($current_forum['allow_anonymous'] == 1 && !$_user['user_id']) |
361 | 361 | ) { |
362 | 362 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
363 | - echo '<a href="reply.php?' . api_get_cidreq() . |
|
364 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
365 | - '&post=' . $rows[$display_post_id]['post_id'] . |
|
366 | - '&action=replymessage&origin=' . $origin . '">' . |
|
363 | + echo '<a href="reply.php?'.api_get_cidreq(). |
|
364 | + '&forum='.$forumId.'&thread='.$threadId. |
|
365 | + '&post='.$rows[$display_post_id]['post_id']. |
|
366 | + '&action=replymessage&origin='.$origin.'">'. |
|
367 | 367 | Display::return_icon( |
368 | 368 | 'message_reply_forum.png', |
369 | 369 | get_lang('ReplyToMessage') |
370 | - ) . "</a>"; |
|
371 | - echo '<a href="reply.php?' . api_get_cidreq() . |
|
372 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
373 | - '&post=' . $rows[$display_post_id]['post_id'] . |
|
374 | - '&action=quote&origin=' . $origin . '">' . |
|
370 | + )."</a>"; |
|
371 | + echo '<a href="reply.php?'.api_get_cidreq(). |
|
372 | + '&forum='.$forumId.'&thread='.$threadId. |
|
373 | + '&post='.$rows[$display_post_id]['post_id']. |
|
374 | + '&action=quote&origin='.$origin.'">'. |
|
375 | 375 | Display::return_icon( |
376 | 376 | 'quote.gif', |
377 | 377 | get_lang('QuoteMessage') |
378 | - ) . "</a>"; |
|
378 | + )."</a>"; |
|
379 | 379 | } |
380 | 380 | } |
381 | 381 | } else { |
382 | 382 | if ($current_forum_category && $current_forum_category['locked'] == 1) { |
383 | - echo get_lang('ForumcategoryLocked') . '<br />'; |
|
383 | + echo get_lang('ForumcategoryLocked').'<br />'; |
|
384 | 384 | } |
385 | 385 | if ($current_forum['locked'] == 1) { |
386 | - echo get_lang('ForumLocked') . '<br />'; |
|
386 | + echo get_lang('ForumLocked').'<br />'; |
|
387 | 387 | } |
388 | 388 | if ($current_thread['locked'] == 1) { |
389 | - echo get_lang('ThreadLocked') . '<br />'; |
|
389 | + echo get_lang('ThreadLocked').'<br />'; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | |
@@ -405,17 +405,17 @@ discard block |
||
405 | 405 | $rows[$display_post_id]['post_notification'] == '1' AND |
406 | 406 | $rows[$display_post_id]['poster_id'] == $_user['user_id'] |
407 | 407 | ) { |
408 | - $post_image .= Display::return_icon('forumnotification.gif',get_lang('YouWillBeNotified')); |
|
408 | + $post_image .= Display::return_icon('forumnotification.gif', get_lang('YouWillBeNotified')); |
|
409 | 409 | } |
410 | 410 | // The post title |
411 | -echo "<td class=\"$titleclass\">" . |
|
412 | - prepare4display($rows[$display_post_id]['post_title']) . "</td>"; |
|
411 | +echo "<td class=\"$titleclass\">". |
|
412 | + prepare4display($rows[$display_post_id]['post_title'])."</td>"; |
|
413 | 413 | echo "</tr>"; |
414 | 414 | |
415 | 415 | // The post message |
416 | 416 | echo "<tr>"; |
417 | -echo "<td class=\"$messageclass\">" . |
|
418 | - prepare4display($rows[$display_post_id]['post_text']) . "</td>"; |
|
417 | +echo "<td class=\"$messageclass\">". |
|
418 | + prepare4display($rows[$display_post_id]['post_text'])."</td>"; |
|
419 | 419 | echo "</tr>"; |
420 | 420 | |
421 | 421 | // The check if there is an attachment |
@@ -428,24 +428,24 @@ discard block |
||
428 | 428 | echo Display::return_icon('attachment.gif', get_lang('Attachment')); |
429 | 429 | echo '<a href="download.php?file='; |
430 | 430 | echo $realname; |
431 | - echo ' "> ' . $user_filename . ' </a>'; |
|
432 | - echo '<span class="forum_attach_comment">' . |
|
433 | - Security::remove_XSS($attachment['comment'], STUDENT) . '</span>'; |
|
431 | + echo ' "> '.$user_filename.' </a>'; |
|
432 | + echo '<span class="forum_attach_comment">'. |
|
433 | + Security::remove_XSS($attachment['comment'], STUDENT).'</span>'; |
|
434 | 434 | |
435 | 435 | if ( |
436 | - ($current_forum['allow_edit'] == 1 &&$rows[$display_post_id]['user_id'] == $_user['user_id']) || |
|
436 | + ($current_forum['allow_edit'] == 1 && $rows[$display_post_id]['user_id'] == $_user['user_id']) || |
|
437 | 437 | (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) |
438 | 438 | ) { |
439 | - echo ' <a href="' . api_get_self() . '?' . |
|
440 | - api_get_cidreq() . '&origin=' . |
|
441 | - Security::remove_XSS($_GET['origin']) . |
|
442 | - '&action=delete_attach&id_attach=' . |
|
443 | - $attachment['id'] . '&forum=' . $forumId . |
|
444 | - '&thread=' . $threadId . |
|
445 | - '" onclick="javascript:if(!confirm(\'' . |
|
439 | + echo ' <a href="'.api_get_self().'?'. |
|
440 | + api_get_cidreq().'&origin='. |
|
441 | + Security::remove_XSS($_GET['origin']). |
|
442 | + '&action=delete_attach&id_attach='. |
|
443 | + $attachment['id'].'&forum='.$forumId. |
|
444 | + '&thread='.$threadId. |
|
445 | + '" onclick="javascript:if(!confirm(\''. |
|
446 | 446 | addslashes(api_htmlentities( |
447 | 447 | get_lang('ConfirmYourChoice'), ENT_QUOTES) |
448 | - ) . '\')) return false;">' . Display::return_icon( |
|
448 | + ).'\')) return false;">'.Display::return_icon( |
|
449 | 449 | 'delete.gif', |
450 | 450 | get_lang('Delete') |
451 | 451 | ).'</a><br />'; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | require_once '../inc/global.inc.php'; |
10 | -$current_course_tool = TOOL_FORUM; |
|
10 | +$current_course_tool = TOOL_FORUM; |
|
11 | 11 | |
12 | 12 | $this_section = SECTION_COURSES; |
13 | 13 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // Are we in a lp ? |
24 | 24 | $origin = ''; |
25 | 25 | if (isset($_GET['origin'])) { |
26 | - $origin = Security::remove_XSS($_GET['origin']); |
|
26 | + $origin = Security::remove_XSS($_GET['origin']); |
|
27 | 27 | } |
28 | 28 | $my_search = null; |
29 | 29 | $gradebook = null; |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | // Note pcool: I tried to use only one sql statement (and function) for this, |
37 | 37 | // but the problem is that the visibility of the forum AND forum category are stored in the item_property table. |
38 | 38 | // Note: This has to be validated that it is an existing thread |
39 | -$current_thread = get_thread_information($_GET['thread']); |
|
39 | +$current_thread = get_thread_information($_GET['thread']); |
|
40 | 40 | // Note: This has to be validated that it is an existing forum. |
41 | -$current_forum = get_forum_information($current_thread['forum_id']); |
|
42 | -$current_forum_category = get_forumcategory_information($current_forum['forum_category']); |
|
41 | +$current_forum = get_forum_information($current_thread['forum_id']); |
|
42 | +$current_forum_category = get_forumcategory_information($current_forum['forum_category']); |
|
43 | 43 | $whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null; |
44 | 44 | /* Header and Breadcrumbs */ |
45 | 45 | |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if (!empty($gradebook) && $gradebook == 'view') { |
52 | - $interbreadcrumb[] = array ( |
|
53 | - 'url' => '../gradebook/' . $_SESSION['gradebook_dest'], |
|
52 | + $interbreadcrumb[] = array( |
|
53 | + 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
|
54 | 54 | 'name' => get_lang('ToolGradebook') |
55 | 55 | ); |
56 | 56 | } |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | 'name' => get_lang('Groups') |
66 | 66 | ); |
67 | 67 | $interbreadcrumb[] = array( |
68 | - 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?' . api_get_cidreq(), |
|
69 | - 'name' => get_lang('GroupSpace') . ' ' . $group_properties['name'] |
|
68 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
69 | + 'name' => get_lang('GroupSpace').' '.$group_properties['name'] |
|
70 | 70 | ); |
71 | 71 | $interbreadcrumb[] = array( |
72 | - 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). "&search=" . Security::remove_XSS(urlencode($my_search)), |
|
72 | + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq()."&search=".Security::remove_XSS(urlencode($my_search)), |
|
73 | 73 | 'name' => Security::remove_XSS($current_forum['forum_title']) |
74 | 74 | ); |
75 | 75 | $interbreadcrumb[] = array( |
76 | - 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). '&thread=' . intval($_GET['thread']), |
|
76 | + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq().'&thread='.intval($_GET['thread']), |
|
77 | 77 | 'name' => Security::remove_XSS($current_thread['thread_title']) |
78 | 78 | ); |
79 | 79 | |
@@ -84,15 +84,15 @@ discard block |
||
84 | 84 | Display::display_reduced_header(); |
85 | 85 | } else { |
86 | 86 | $interbreadcrumb[] = array( |
87 | - 'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&search=' . Security::remove_XSS(urlencode($my_search)), |
|
87 | + 'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&search='.Security::remove_XSS(urlencode($my_search)), |
|
88 | 88 | 'name' => $nameTools |
89 | 89 | ); |
90 | 90 | $interbreadcrumb[] = array( |
91 | - 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='. $current_forum_category['cat_id']. "&search=". Security::remove_XSS(urlencode($my_search)), |
|
91 | + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id']."&search=".Security::remove_XSS(urlencode($my_search)), |
|
92 | 92 | 'name' => Security::remove_XSS($current_forum_category['cat_title']) |
93 | 93 | ); |
94 | 94 | $interbreadcrumb[] = array( |
95 | - 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum=' . intval($_GET['forum']). "&search=". Security::remove_XSS(urlencode($my_search)), |
|
95 | + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum'])."&search=".Security::remove_XSS(urlencode($my_search)), |
|
96 | 96 | 'name' => Security::remove_XSS($current_forum['forum_title']) |
97 | 97 | ); |
98 | 98 | $interbreadcrumb[] = array( |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | echo '<div class="actions">'; |
162 | 162 | echo '<span style="float:right;">'.search_link().'</span>'; |
163 | 163 | if ($origin != 'learnpath') { |
164 | - echo '<a href="' . $forumUrl . 'viewforum.php?forum=' |
|
165 | - . intval($_GET['forum']) . '&' . api_get_cidreq() . '">' |
|
166 | - . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
164 | + echo '<a href="'.$forumUrl.'viewforum.php?forum=' |
|
165 | + . intval($_GET['forum']).'&'.api_get_cidreq().'">' |
|
166 | + . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
167 | 167 | } |
168 | 168 | // The reply to thread link should only appear when the forum_category is |
169 | 169 | // not locked AND the forum is not locked AND the thread is not locked. |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | if ($_user['user_id'] || ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])) { |
180 | 180 | // reply link |
181 | 181 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
182 | - echo '<a href="' . $forumUrl . 'reply.php?' . api_get_cidreq() . '&forum=' |
|
183 | - . intval($_GET['forum']) . '&thread=' |
|
184 | - . intval($_GET['thread']) . '&action=replythread">' |
|
182 | + echo '<a href="'.$forumUrl.'reply.php?'.api_get_cidreq().'&forum=' |
|
183 | + . intval($_GET['forum']).'&thread=' |
|
184 | + . intval($_GET['thread']).'&action=replythread">' |
|
185 | 185 | . Display::return_icon('reply_thread.png', get_lang('ReplyToThread'), '', ICON_SIZE_MEDIUM) |
186 | 186 | . '</a>'; |
187 | 187 | } |
@@ -205,13 +205,13 @@ discard block |
||
205 | 205 | |
206 | 206 | // The different views of the thread. |
207 | 207 | if ($origin != 'learnpath') { |
208 | - $my_url = '<a href="' . $forumUrl . 'viewthread.php?' . api_get_cidreq() . '&' . api_get_cidreq() |
|
209 | - . '&forum=' . intval($_GET['forum']) . '&thread=' . intval($_GET['thread']) |
|
210 | - . '&search=' . Security::remove_XSS(urlencode($my_search)); |
|
211 | - echo $my_url . '&view=flat">' |
|
208 | + $my_url = '<a href="'.$forumUrl.'viewthread.php?'.api_get_cidreq().'&'.api_get_cidreq() |
|
209 | + . '&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']) |
|
210 | + . '&search='.Security::remove_XSS(urlencode($my_search)); |
|
211 | + echo $my_url.'&view=flat">' |
|
212 | 212 | . Display::return_icon('forum_listview.png', get_lang('FlatView'), null, ICON_SIZE_MEDIUM) |
213 | 213 | . '</a>'; |
214 | - echo $my_url . '&view=nested">' |
|
214 | + echo $my_url.'&view=nested">' |
|
215 | 215 | . Display::return_icon('forum_nestedview.png', get_lang('NestedView'), null, ICON_SIZE_MEDIUM) |
216 | 216 | . '</a>'; |
217 | 217 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | exit; |
20 | 20 | } |
21 | 21 | |
22 | -$interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | 23 | $tool_name = get_lang('MultipleAccessURLs'); |
24 | 24 | Display :: display_header($tool_name); |
25 | 25 | |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | case 'register': |
56 | 56 | // we are going to register the admin |
57 | 57 | if (api_is_platform_admin()) { |
58 | - if ($current_access_url_id!=-1) { |
|
58 | + if ($current_access_url_id != -1) { |
|
59 | 59 | $url_str = ''; |
60 | 60 | foreach ($url_list as $my_url) { |
61 | 61 | if (!in_array($my_url['id'], $my_user_url_list)) { |
62 | 62 | UrlManager::add_user_to_url(api_get_user_id(), $my_url['id']); |
63 | - $url_str.=$my_url['url'].' <br />'; |
|
63 | + $url_str .= $my_url['url'].' <br />'; |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | Display:: display_normal_message( |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | $url_string .= $my_url['url'].' <br />'; |
85 | 85 | } |
86 | 86 | } |
87 | -if(!empty($url_string)) { |
|
88 | - Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
87 | +if (!empty($url_string)) { |
|
88 | + Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string, false); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // checking the current installation |
92 | -if ($current_access_url_id==-1) { |
|
92 | +if ($current_access_url_id == -1) { |
|
93 | 93 | Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
94 | -} elseif(api_is_platform_admin()) { |
|
95 | - $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id); |
|
96 | - if ($quant==0) { |
|
94 | +} elseif (api_is_platform_admin()) { |
|
95 | + $quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id); |
|
96 | + if ($quant == 0) { |
|
97 | 97 | Display:: display_warning_message( |
98 | 98 | '<a href="'.api_get_self().'?action=register&sec_token='.$parameters['sec_token'].'">'.get_lang('ClickToRegisterAdmin').'</a>', |
99 | 99 | false |
@@ -142,16 +142,16 @@ discard block |
||
142 | 142 | |
143 | 143 | //Status |
144 | 144 | $active = $row['active']; |
145 | - if ($active=='1') { |
|
146 | - $action='lock'; |
|
147 | - $image='right'; |
|
145 | + if ($active == '1') { |
|
146 | + $action = 'lock'; |
|
147 | + $image = 'right'; |
|
148 | 148 | } |
149 | - if ($active=='0') { |
|
150 | - $action='unlock'; |
|
151 | - $image='wrong'; |
|
149 | + if ($active == '0') { |
|
150 | + $action = 'unlock'; |
|
151 | + $image = 'wrong'; |
|
152 | 152 | } |
153 | 153 | // you cannot lock the default |
154 | - if ($row['id']=='1') { |
|
154 | + if ($row['id'] == '1') { |
|
155 | 155 | $status = Display::return_icon($image.'.gif', get_lang(ucfirst($action))); |
156 | 156 | } else { |
157 | 157 | $status = '<a href="access_urls.php?action='.$action.'&url_id='.$row['id'].'">'. |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $url_id = $row['id']; |
162 | 162 | $actions = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), "access_url_edit.php?url_id=$url_id"); |
163 | 163 | if ($url_id != '1') { |
164 | - $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'. |
|
164 | + $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'. |
|
165 | 165 | Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
166 | 166 | } |
167 | 167 | $urls[] = array($url, $description, $status, $actions); |