@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | |
4 | 4 | require_once '../inc/global.inc.php'; |
5 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
5 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
6 | 6 | |
7 | 7 | /* Configuration settings */ |
8 | 8 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $token = Security::get_token(); |
57 | 57 | |
58 | 58 | if (!empty($group_id)) { |
59 | - $group_properties = GroupManager::get_group_properties($group_id); |
|
59 | + $group_properties = GroupManager::get_group_properties($group_id); |
|
60 | 60 | $show_work = false; |
61 | 61 | |
62 | 62 | if (api_is_allowed_to_edit(false, true)) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if (!empty($workId)) { |
109 | 109 | if (empty($_GET['list']) or Security::remove_XSS($_GET['list']) == 'with') { |
110 | 110 | $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without">'. |
111 | - Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
111 | + Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
112 | 112 | } else { |
113 | 113 | if (!isset($_GET['action']) || (isset($_GET['action']) && $_GET['action'] != 'send_mail')) { |
114 | 114 | $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without&action=send_mail&sec_token='.$token.'">'. |
@@ -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: |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | //sentArray keeps list of all files still available in the sent files list |
222 | 222 | //of the user. |
223 | 223 | //This is used to show or hide the overwrite file-radio button of the upload form |
224 | - $javascript .= " |
|
224 | + $javascript .= " |
|
225 | 225 | var sentArray = new Array("; |
226 | 226 | if (isset($dropbox_person)) { |
227 | 227 | for ($i = 0; $i < count($dropbox_person->sentWork); $i++) { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $javascript .= "'".$dropbox_person->sentWork[$i]->title."'"; |
232 | 232 | } |
233 | 233 | } |
234 | - $javascript .= "); |
|
234 | + $javascript .= "); |
|
235 | 235 | |
236 | 236 | function checkfile(str) |
237 | 237 | { |
@@ -296,12 +296,12 @@ discard block |
||
296 | 296 | |
297 | 297 | $checked_files = false; |
298 | 298 | if (!$view || $view == 'received') { |
299 | - $part = 'received'; |
|
299 | + $part = 'received'; |
|
300 | 300 | } elseif ($view = 'sent') { |
301 | - $part = 'sent'; |
|
301 | + $part = 'sent'; |
|
302 | 302 | } else { |
303 | - header('location: index.php?view='.$view.'&error=Error'); |
|
304 | - exit; |
|
303 | + header('location: index.php?view='.$view.'&error=Error'); |
|
304 | + exit; |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | if (($postAction == 'download_received' || $postAction == 'download_sent') and !$_POST['store_feedback']) { |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | } else { |
326 | 326 | api_not_allowed(); |
327 | 327 | } |
328 | - exit(); |
|
328 | + exit(); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /* BREADCRUMBS */ |
@@ -335,45 +335,45 @@ discard block |
||
335 | 335 | 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(), |
336 | 336 | 'name' => get_lang('Dropbox', ''), |
337 | 337 | ); |
338 | - $nameTools = get_lang('ReceivedFiles'); |
|
338 | + $nameTools = get_lang('ReceivedFiles'); |
|
339 | 339 | |
340 | - if ($action == 'addreceivedcategory') { |
|
340 | + if ($action == 'addreceivedcategory') { |
|
341 | 341 | $interbreadcrumb[] = array( |
342 | 342 | 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=received&'.api_get_cidreq(), |
343 | 343 | 'name' => get_lang('ReceivedFiles'), |
344 | 344 | ); |
345 | - $nameTools = get_lang('AddNewCategory'); |
|
346 | - } |
|
345 | + $nameTools = get_lang('AddNewCategory'); |
|
346 | + } |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | if ($view == 'sent' || empty($view)) { |
350 | 350 | $interbreadcrumb[] = array( |
351 | 351 | 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(), |
352 | - 'name' => get_lang('Dropbox') |
|
352 | + 'name' => get_lang('Dropbox') |
|
353 | 353 | ); |
354 | - $nameTools = get_lang('SentFiles'); |
|
355 | - |
|
356 | - if ($action == 'addsentcategory') { |
|
357 | - $interbreadcrumb[] = array( |
|
358 | - 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(), |
|
359 | - 'name' => get_lang('SentFiles'), |
|
360 | - ); |
|
361 | - $nameTools = get_lang('AddNewCategory'); |
|
362 | - } |
|
363 | - if ($action == 'add') { |
|
364 | - $interbreadcrumb[] = array( |
|
365 | - 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(), |
|
366 | - 'name' => get_lang('SentFiles'), |
|
367 | - ); |
|
368 | - $nameTools = get_lang('UploadNewFile'); |
|
369 | - } |
|
354 | + $nameTools = get_lang('SentFiles'); |
|
355 | + |
|
356 | + if ($action == 'addsentcategory') { |
|
357 | + $interbreadcrumb[] = array( |
|
358 | + 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(), |
|
359 | + 'name' => get_lang('SentFiles'), |
|
360 | + ); |
|
361 | + $nameTools = get_lang('AddNewCategory'); |
|
362 | + } |
|
363 | + if ($action == 'add') { |
|
364 | + $interbreadcrumb[] = array( |
|
365 | + 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(), |
|
366 | + 'name' => get_lang('SentFiles'), |
|
367 | + ); |
|
368 | + $nameTools = get_lang('UploadNewFile'); |
|
369 | + } |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /* HEADER & TITLE */ |
373 | 373 | |
374 | 374 | if (isset($origin) && $origin == 'learnpath') { |
375 | 375 | $htmlHeadXtra[] = $javascript; |
376 | - Display::display_reduced_header($nameTools, 'Dropbox'); |
|
376 | + Display::display_reduced_header($nameTools, 'Dropbox'); |
|
377 | 377 | } else { |
378 | 378 | Display::display_header($nameTools, 'Dropbox'); |
379 | 379 | } |
@@ -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 |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | $last_access = ''; |
8 | 8 | // get the last time the user accessed the tool |
9 | 9 | if (isset($_SESSION[$_course['id']]) && $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] == '') { |
10 | - $last_access = get_last_tool_access(TOOL_DROPBOX); |
|
11 | - $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access; |
|
10 | + $last_access = get_last_tool_access(TOOL_DROPBOX); |
|
11 | + $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access; |
|
12 | 12 | } else { |
13 | - if (isset($_SESSION[$_course['id']])) { |
|
14 | - $last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX]; |
|
15 | - } |
|
13 | + if (isset($_SESSION[$_course['id']])) { |
|
14 | + $last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX]; |
|
15 | + } |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $postAction = isset($_POST['action']) ? $_POST['action'] : null; |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | // Display the form for adding a new dropbox item. |
51 | 51 | if ($action == 'add') { |
52 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
53 | - api_not_allowed(); |
|
54 | - } |
|
52 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
53 | + api_not_allowed(); |
|
54 | + } |
|
55 | 55 | display_add_form( |
56 | 56 | $dropbox_unid, |
57 | 57 | $viewReceivedCategory, |
@@ -61,56 +61,56 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | if (isset($_POST['submitWork'])) { |
64 | - $check = Security::check_token(); |
|
65 | - if ($check) { |
|
64 | + $check = Security::check_token(); |
|
65 | + if ($check) { |
|
66 | 66 | store_add_dropbox(); |
67 | - } |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // Display the form for adding a category |
71 | 71 | if ($action == 'addreceivedcategory' || $action == 'addsentcategory') { |
72 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
73 | - api_not_allowed(); |
|
74 | - } |
|
75 | - $categoryName = isset($_POST['category_name']) ? $_POST['category_name'] : ''; |
|
76 | - display_addcategory_form($categoryName, '', $_GET['action']); |
|
72 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
73 | + api_not_allowed(); |
|
74 | + } |
|
75 | + $categoryName = isset($_POST['category_name']) ? $_POST['category_name'] : ''; |
|
76 | + display_addcategory_form($categoryName, '', $_GET['action']); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // Editing a category: displaying the form |
80 | 80 | if ($action == 'editcategory' && isset($_GET['id'])) { |
81 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
82 | - api_not_allowed(); |
|
83 | - } |
|
84 | - if (!$_POST) { |
|
85 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
86 | - api_not_allowed(); |
|
87 | - } |
|
88 | - display_addcategory_form('', $_GET['id'], 'editcategory'); |
|
89 | - } |
|
81 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
82 | + api_not_allowed(); |
|
83 | + } |
|
84 | + if (!$_POST) { |
|
85 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
86 | + api_not_allowed(); |
|
87 | + } |
|
88 | + display_addcategory_form('', $_GET['id'], 'editcategory'); |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | // Storing a new or edited category |
93 | 93 | if (isset($_POST['StoreCategory'])) { |
94 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
95 | - api_not_allowed(); |
|
96 | - } |
|
97 | - $return_information = store_addcategory(); |
|
98 | - if ($return_information['type'] == 'confirmation') { |
|
99 | - Display :: display_confirmation_message($return_information['message']); |
|
100 | - } |
|
101 | - if ($return_information['type'] == 'error') { |
|
102 | - Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete').'<br />'.$return_information['message']); |
|
103 | - display_addcategory_form($_POST['category_name'], $_POST['edit_id'], $postAction); |
|
104 | - } |
|
94 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
95 | + api_not_allowed(); |
|
96 | + } |
|
97 | + $return_information = store_addcategory(); |
|
98 | + if ($return_information['type'] == 'confirmation') { |
|
99 | + Display :: display_confirmation_message($return_information['message']); |
|
100 | + } |
|
101 | + if ($return_information['type'] == 'error') { |
|
102 | + Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete').'<br />'.$return_information['message']); |
|
103 | + display_addcategory_form($_POST['category_name'], $_POST['edit_id'], $postAction); |
|
104 | + } |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | 108 | // Move a File |
109 | 109 | if (($action == 'movesent' || $action == 'movereceived') AND isset($_GET['move_id'])) { |
110 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
111 | - api_not_allowed(); |
|
112 | - } |
|
113 | - display_move_form( |
|
110 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
111 | + api_not_allowed(); |
|
112 | + } |
|
113 | + display_move_form( |
|
114 | 114 | str_replace('move', '', $action), |
115 | 115 | $_GET['move_id'], |
116 | 116 | get_dropbox_categories(str_replace('move', '', $action)), |
@@ -121,33 +121,33 @@ discard block |
||
121 | 121 | ); |
122 | 122 | } |
123 | 123 | if (isset($_POST['do_move'])) { |
124 | - Display :: display_confirmation_message(store_move($_POST['id'], $_POST['move_target'], $_POST['part'])); |
|
124 | + Display :: display_confirmation_message(store_move($_POST['id'], $_POST['move_target'], $_POST['part'])); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | // Delete a file |
128 | 128 | if (($action == 'deletereceivedfile' || $action == 'deletesentfile') AND isset($_GET['id']) AND is_numeric($_GET['id'])) { |
129 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
130 | - api_not_allowed(); |
|
131 | - } |
|
132 | - $dropboxfile = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
|
133 | - if ($action == 'deletereceivedfile') { |
|
134 | - $dropboxfile->deleteReceivedWork($_GET['id']); |
|
135 | - $message = get_lang('ReceivedFileDeleted'); |
|
136 | - } |
|
137 | - if ($action == 'deletesentfile') { |
|
138 | - $dropboxfile->deleteSentWork($_GET['id']); |
|
139 | - $message = get_lang('SentFileDeleted'); |
|
140 | - } |
|
141 | - Display :: display_confirmation_message($message); |
|
129 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
130 | + api_not_allowed(); |
|
131 | + } |
|
132 | + $dropboxfile = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
|
133 | + if ($action == 'deletereceivedfile') { |
|
134 | + $dropboxfile->deleteReceivedWork($_GET['id']); |
|
135 | + $message = get_lang('ReceivedFileDeleted'); |
|
136 | + } |
|
137 | + if ($action == 'deletesentfile') { |
|
138 | + $dropboxfile->deleteSentWork($_GET['id']); |
|
139 | + $message = get_lang('SentFileDeleted'); |
|
140 | + } |
|
141 | + Display :: display_confirmation_message($message); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | // Delete a category |
145 | 145 | if (($action == 'deletereceivedcategory' || $action == 'deletesentcategory') AND isset($_GET['id']) AND is_numeric($_GET['id'])) { |
146 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
147 | - api_not_allowed(); |
|
148 | - } |
|
149 | - $message = delete_category($action, $_GET['id']); |
|
150 | - Display :: display_confirmation_message($message); |
|
146 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
147 | + api_not_allowed(); |
|
148 | + } |
|
149 | + $message = delete_category($action, $_GET['id']); |
|
150 | + Display :: display_confirmation_message($message); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | // Do an action on multiple files |
@@ -162,27 +162,27 @@ discard block |
||
162 | 162 | $postAction == 'delete_sent' || |
163 | 163 | $postAction == 'download_sent') |
164 | 164 | ) { |
165 | - $display_message = handle_multiple_actions(); |
|
166 | - Display :: display_normal_message($display_message); |
|
165 | + $display_message = handle_multiple_actions(); |
|
166 | + Display :: display_normal_message($display_message); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | // Store Feedback |
170 | 170 | |
171 | 171 | if (isset($_POST['feedback'])) { |
172 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
173 | - api_not_allowed(); |
|
174 | - } |
|
175 | - $check = Security::check_token(); |
|
176 | - if ($check) { |
|
177 | - $display_message = store_feedback(); |
|
178 | - Display :: display_normal_message($display_message); |
|
179 | - Security::check_token(); |
|
180 | - } |
|
172 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
173 | + api_not_allowed(); |
|
174 | + } |
|
175 | + $check = Security::check_token(); |
|
176 | + if ($check) { |
|
177 | + $display_message = store_feedback(); |
|
178 | + Display :: display_normal_message($display_message); |
|
179 | + Security::check_token(); |
|
180 | + } |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // Error Message |
184 | 184 | if (isset($_GET['error']) AND !empty($_GET['error'])) { |
185 | - Display :: display_normal_message(get_lang($_GET['error'])); |
|
185 | + Display :: display_normal_message(get_lang($_GET['error'])); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | $dropbox_data_sent = array(); |
@@ -190,96 +190,96 @@ discard block |
||
190 | 190 | $dropbox_data_recieved = array(); |
191 | 191 | |
192 | 192 | if ($action != 'add') { |
193 | - // Getting all the categories in the dropbox for the given user |
|
194 | - $dropbox_categories = get_dropbox_categories(); |
|
195 | - // Greating the arrays with the categories for the received files and for the sent files |
|
196 | - foreach ($dropbox_categories as $category) { |
|
197 | - if ($category['received'] == '1') { |
|
198 | - $dropbox_received_category[] = $category; |
|
199 | - } |
|
200 | - if ($category['sent'] == '1') { |
|
201 | - $dropbox_sent_category[] = $category; |
|
202 | - } |
|
203 | - } |
|
204 | - |
|
205 | - // ACTIONS |
|
206 | - if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) { |
|
207 | - //echo '<h3>'.get_lang('ReceivedFiles').'</h3>'; |
|
208 | - |
|
209 | - // This is for the categories |
|
210 | - if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') { |
|
211 | - $view_dropbox_category_received = $viewReceivedCategory; |
|
212 | - } else { |
|
213 | - $view_dropbox_category_received = 0; |
|
214 | - } |
|
215 | - |
|
216 | - /* Menu Received */ |
|
217 | - |
|
218 | - if (api_get_session_id() == 0) { |
|
219 | - echo '<div class="actions">'; |
|
220 | - if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
221 | - 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>"; |
|
222 | - echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
|
223 | - $movelist[0] = 'Root'; // move_received selectbox content |
|
224 | - } else { |
|
225 | - 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>'; |
|
226 | - } |
|
227 | - echo '</div>'; |
|
228 | - } else { |
|
229 | - if (api_is_allowed_to_session_edit(false, true)) { |
|
230 | - echo '<div class="actions">'; |
|
231 | - if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
232 | - 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>"; |
|
233 | - echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
|
234 | - $movelist[0] = 'Root'; // move_received selectbox content |
|
235 | - } else { |
|
236 | - 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>'; |
|
237 | - } |
|
238 | - echo '</div>'; |
|
239 | - } |
|
240 | - } |
|
241 | - } |
|
242 | - |
|
243 | - if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) { |
|
244 | - // This is for the categories |
|
245 | - if (isset($viewSentCategory) AND $viewSentCategory != '') { |
|
246 | - $view_dropbox_category_sent = $viewSentCategory; |
|
247 | - } else { |
|
248 | - $view_dropbox_category_sent = 0; |
|
249 | - } |
|
250 | - |
|
251 | - /* Menu Sent */ |
|
252 | - |
|
253 | - if (api_get_session_id() == 0) { |
|
254 | - echo '<div class="actions">'; |
|
255 | - if ($view_dropbox_category_sent != 0) { |
|
256 | - 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>"; |
|
257 | - echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
|
258 | - } else { |
|
259 | - 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"; |
|
260 | - } |
|
261 | - if (empty($viewSentCategory)) { |
|
262 | - 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>"; |
|
263 | - } |
|
264 | - echo '</div>'; |
|
265 | - } else { |
|
266 | - if (api_is_allowed_to_session_edit(false, true)) { |
|
267 | - echo '<div class="actions">'; |
|
268 | - if ($view_dropbox_category_sent != 0) { |
|
269 | - echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
|
270 | - 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>"; |
|
271 | - } else { |
|
272 | - 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"; |
|
273 | - } |
|
274 | - if (empty($viewSentCategory)) { |
|
275 | - 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>"; |
|
276 | - } |
|
277 | - echo '</div>'; |
|
278 | - } |
|
279 | - } |
|
280 | - } |
|
281 | - /* THE MENU TABS */ |
|
282 | - if ($dropbox_cnf['sent_received_tabs']) { |
|
193 | + // Getting all the categories in the dropbox for the given user |
|
194 | + $dropbox_categories = get_dropbox_categories(); |
|
195 | + // Greating the arrays with the categories for the received files and for the sent files |
|
196 | + foreach ($dropbox_categories as $category) { |
|
197 | + if ($category['received'] == '1') { |
|
198 | + $dropbox_received_category[] = $category; |
|
199 | + } |
|
200 | + if ($category['sent'] == '1') { |
|
201 | + $dropbox_sent_category[] = $category; |
|
202 | + } |
|
203 | + } |
|
204 | + |
|
205 | + // ACTIONS |
|
206 | + if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) { |
|
207 | + //echo '<h3>'.get_lang('ReceivedFiles').'</h3>'; |
|
208 | + |
|
209 | + // This is for the categories |
|
210 | + if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') { |
|
211 | + $view_dropbox_category_received = $viewReceivedCategory; |
|
212 | + } else { |
|
213 | + $view_dropbox_category_received = 0; |
|
214 | + } |
|
215 | + |
|
216 | + /* Menu Received */ |
|
217 | + |
|
218 | + if (api_get_session_id() == 0) { |
|
219 | + echo '<div class="actions">'; |
|
220 | + if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
221 | + 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>"; |
|
222 | + echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
|
223 | + $movelist[0] = 'Root'; // move_received selectbox content |
|
224 | + } else { |
|
225 | + 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>'; |
|
226 | + } |
|
227 | + echo '</div>'; |
|
228 | + } else { |
|
229 | + if (api_is_allowed_to_session_edit(false, true)) { |
|
230 | + echo '<div class="actions">'; |
|
231 | + if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) { |
|
232 | + 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>"; |
|
233 | + echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> '; |
|
234 | + $movelist[0] = 'Root'; // move_received selectbox content |
|
235 | + } else { |
|
236 | + 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>'; |
|
237 | + } |
|
238 | + echo '</div>'; |
|
239 | + } |
|
240 | + } |
|
241 | + } |
|
242 | + |
|
243 | + if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) { |
|
244 | + // This is for the categories |
|
245 | + if (isset($viewSentCategory) AND $viewSentCategory != '') { |
|
246 | + $view_dropbox_category_sent = $viewSentCategory; |
|
247 | + } else { |
|
248 | + $view_dropbox_category_sent = 0; |
|
249 | + } |
|
250 | + |
|
251 | + /* Menu Sent */ |
|
252 | + |
|
253 | + if (api_get_session_id() == 0) { |
|
254 | + echo '<div class="actions">'; |
|
255 | + if ($view_dropbox_category_sent != 0) { |
|
256 | + 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>"; |
|
257 | + echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
|
258 | + } else { |
|
259 | + 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"; |
|
260 | + } |
|
261 | + if (empty($viewSentCategory)) { |
|
262 | + 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>"; |
|
263 | + } |
|
264 | + echo '</div>'; |
|
265 | + } else { |
|
266 | + if (api_is_allowed_to_session_edit(false, true)) { |
|
267 | + echo '<div class="actions">'; |
|
268 | + if ($view_dropbox_category_sent != 0) { |
|
269 | + echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> '; |
|
270 | + 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>"; |
|
271 | + } else { |
|
272 | + 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"; |
|
273 | + } |
|
274 | + if (empty($viewSentCategory)) { |
|
275 | + 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>"; |
|
276 | + } |
|
277 | + echo '</div>'; |
|
278 | + } |
|
279 | + } |
|
280 | + } |
|
281 | + /* THE MENU TABS */ |
|
282 | + if ($dropbox_cnf['sent_received_tabs']) { |
|
283 | 283 | ?> |
284 | 284 | <ul class="nav nav-tabs"> |
285 | 285 | <li <?php if (!$view || $view == 'sent') { echo 'class="active"'; } ?> > |
@@ -293,150 +293,150 @@ discard block |
||
293 | 293 | </li> |
294 | 294 | </ul> |
295 | 295 | <?php |
296 | - } |
|
296 | + } |
|
297 | 297 | /* RECEIVED FILES */ |
298 | - if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) { |
|
299 | - // This is for the categories |
|
300 | - if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') { |
|
301 | - $view_dropbox_category_received = $viewReceivedCategory; |
|
302 | - } else { |
|
303 | - $view_dropbox_category_received = 0; |
|
304 | - } |
|
305 | - |
|
306 | - // Object initialisation |
|
307 | - $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
|
308 | - // note: are the $is_courseAdmin and $is_courseTutor parameters needed???? |
|
309 | - |
|
310 | - // Constructing the array that contains the total number of feedback messages per document. |
|
311 | - $number_feedback = get_total_number_feedback(); |
|
312 | - |
|
313 | - // Sorting and paging options |
|
314 | - $sorting_options = array(); |
|
315 | - $paging_options = array(); |
|
316 | - |
|
317 | - // The headers of the sortable tables |
|
318 | - $column_header = array(); |
|
319 | - $column_header[] = array('', false, ''); |
|
320 | - $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"'); |
|
321 | - $column_header[] = array(get_lang('ReceivedTitle'), true, ''); |
|
322 | - $column_header[] = array(get_lang('Size'), true, ''); |
|
323 | - $column_header[] = array(get_lang('Authors'), true, ''); |
|
324 | - $column_header[] = array(get_lang('LastResent'), true); |
|
325 | - |
|
326 | - if (api_get_session_id() == 0) { |
|
327 | - $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
328 | - } elseif (api_is_allowed_to_session_edit(false,true)) { |
|
329 | - $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
330 | - } |
|
331 | - |
|
332 | - $column_header[] = array('RealDate', true); |
|
333 | - $column_header[] = array('RealSize', true); |
|
334 | - |
|
335 | - // An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide |
|
336 | - $column_show[] = 1; |
|
337 | - $column_show[] = 1; |
|
338 | - $column_show[] = 1; |
|
339 | - $column_show[] = 1; |
|
340 | - $column_show[] = 1; |
|
341 | - $column_show[] = 1; |
|
342 | - |
|
343 | - if (api_get_session_id() == 0) { |
|
344 | - $column_show[] = 1; |
|
345 | - } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
346 | - $column_show[] = 1; |
|
347 | - } |
|
348 | - $column_show[] = 0; |
|
349 | - |
|
350 | - // Here we change the way how the columns are going to be sort |
|
351 | - // in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate |
|
352 | - // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48" |
|
353 | - |
|
354 | - $column_order[3] = 8; |
|
355 | - $column_order[5] = 7; |
|
356 | - |
|
357 | - // The content of the sortable table = the received files |
|
358 | - foreach ($dropbox_person -> receivedWork as $dropbox_file) { |
|
359 | - $dropbox_file_data = array(); |
|
360 | - if ($view_dropbox_category_received == $dropbox_file->category) { |
|
298 | + if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) { |
|
299 | + // This is for the categories |
|
300 | + if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') { |
|
301 | + $view_dropbox_category_received = $viewReceivedCategory; |
|
302 | + } else { |
|
303 | + $view_dropbox_category_received = 0; |
|
304 | + } |
|
305 | + |
|
306 | + // Object initialisation |
|
307 | + $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
|
308 | + // note: are the $is_courseAdmin and $is_courseTutor parameters needed???? |
|
309 | + |
|
310 | + // Constructing the array that contains the total number of feedback messages per document. |
|
311 | + $number_feedback = get_total_number_feedback(); |
|
312 | + |
|
313 | + // Sorting and paging options |
|
314 | + $sorting_options = array(); |
|
315 | + $paging_options = array(); |
|
316 | + |
|
317 | + // The headers of the sortable tables |
|
318 | + $column_header = array(); |
|
319 | + $column_header[] = array('', false, ''); |
|
320 | + $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"'); |
|
321 | + $column_header[] = array(get_lang('ReceivedTitle'), true, ''); |
|
322 | + $column_header[] = array(get_lang('Size'), true, ''); |
|
323 | + $column_header[] = array(get_lang('Authors'), true, ''); |
|
324 | + $column_header[] = array(get_lang('LastResent'), true); |
|
325 | + |
|
326 | + if (api_get_session_id() == 0) { |
|
327 | + $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
328 | + } elseif (api_is_allowed_to_session_edit(false,true)) { |
|
329 | + $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
330 | + } |
|
331 | + |
|
332 | + $column_header[] = array('RealDate', true); |
|
333 | + $column_header[] = array('RealSize', true); |
|
334 | + |
|
335 | + // An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide |
|
336 | + $column_show[] = 1; |
|
337 | + $column_show[] = 1; |
|
338 | + $column_show[] = 1; |
|
339 | + $column_show[] = 1; |
|
340 | + $column_show[] = 1; |
|
341 | + $column_show[] = 1; |
|
342 | + |
|
343 | + if (api_get_session_id() == 0) { |
|
344 | + $column_show[] = 1; |
|
345 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
346 | + $column_show[] = 1; |
|
347 | + } |
|
348 | + $column_show[] = 0; |
|
349 | + |
|
350 | + // Here we change the way how the columns are going to be sort |
|
351 | + // in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate |
|
352 | + // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48" |
|
353 | + |
|
354 | + $column_order[3] = 8; |
|
355 | + $column_order[5] = 7; |
|
356 | + |
|
357 | + // The content of the sortable table = the received files |
|
358 | + foreach ($dropbox_person -> receivedWork as $dropbox_file) { |
|
359 | + $dropbox_file_data = array(); |
|
360 | + if ($view_dropbox_category_received == $dropbox_file->category) { |
|
361 | 361 | // we only display the files that are in the category that we are in. |
362 | - $dropbox_file_data[] = $dropbox_file->id; |
|
362 | + $dropbox_file_data[] = $dropbox_file->id; |
|
363 | 363 | |
364 | - if (!is_array($_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])) { |
|
365 | - $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX] = array(); |
|
366 | - } |
|
364 | + if (!is_array($_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])) { |
|
365 | + $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX] = array(); |
|
366 | + } |
|
367 | 367 | |
368 | - // New icon |
|
369 | - $new_icon = ''; |
|
370 | - if ($dropbox_file->last_upload_date > $last_access && |
|
368 | + // New icon |
|
369 | + $new_icon = ''; |
|
370 | + if ($dropbox_file->last_upload_date > $last_access && |
|
371 | 371 | !in_array($dropbox_file->id, $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX]) |
372 | 372 | ) { |
373 | - $new_icon = ' '.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL); |
|
374 | - } |
|
373 | + $new_icon = ' '.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL); |
|
374 | + } |
|
375 | 375 | |
376 | - $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
|
377 | - $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
|
378 | - $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
|
376 | + $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
|
377 | + $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
|
378 | + $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
|
379 | 379 | 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; |
380 | - $file_size = $dropbox_file->filesize; |
|
381 | - $dropbox_file_data[] = format_file_size($file_size); |
|
382 | - $dropbox_file_data[] = $dropbox_file->author; |
|
380 | + $file_size = $dropbox_file->filesize; |
|
381 | + $dropbox_file_data[] = format_file_size($file_size); |
|
382 | + $dropbox_file_data[] = $dropbox_file->author; |
|
383 | 383 | |
384 | - $last_upload_date = api_get_local_time($dropbox_file->last_upload_date); |
|
385 | - $dropbox_file_data[] = date_to_str_ago($dropbox_file->last_upload_date).'<br /><span class="dropbox_date">'. |
|
384 | + $last_upload_date = api_get_local_time($dropbox_file->last_upload_date); |
|
385 | + $dropbox_file_data[] = date_to_str_ago($dropbox_file->last_upload_date).'<br /><span class="dropbox_date">'. |
|
386 | 386 | api_format_date($last_upload_date).'</span>'; |
387 | 387 | |
388 | - $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
|
388 | + $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
|
389 | 389 | <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> |
390 | 390 | <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> |
391 | 391 | <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.'\');">'. |
392 | 392 | Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
393 | 393 | |
394 | - // This is a hack to have an additional row in a sortable table |
|
395 | - |
|
396 | - if ($action == 'viewfeedback' AND isset($_GET['id']) and is_numeric($_GET['id']) AND $dropbox_file->id == $_GET['id']) { |
|
397 | - $action_icons .= "</td></tr>"; // Ending the normal row of the sortable table |
|
398 | - $action_icons .= '<tr><td colspan="2"><a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?"'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a></td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>"; |
|
399 | - } |
|
400 | - if (api_get_session_id() == 0) { |
|
401 | - $dropbox_file_data[] = $action_icons; |
|
402 | - } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
403 | - $dropbox_file_data[] = $action_icons; |
|
404 | - } |
|
405 | - $action_icons = ''; |
|
406 | - $dropbox_file_data[] = $last_upload_date; |
|
407 | - $dropbox_file_data[] = $file_size; |
|
408 | - $dropbox_data_recieved[] = $dropbox_file_data; |
|
409 | - } |
|
410 | - } |
|
411 | - |
|
412 | - // The content of the sortable table = the categories (if we are not in the root) |
|
413 | - if ($view_dropbox_category_received == 0) { |
|
414 | - foreach ($dropbox_categories as $category) { |
|
415 | - /* Note: This can probably be shortened since the categories |
|
394 | + // This is a hack to have an additional row in a sortable table |
|
395 | + |
|
396 | + if ($action == 'viewfeedback' AND isset($_GET['id']) and is_numeric($_GET['id']) AND $dropbox_file->id == $_GET['id']) { |
|
397 | + $action_icons .= "</td></tr>"; // Ending the normal row of the sortable table |
|
398 | + $action_icons .= '<tr><td colspan="2"><a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?"'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a></td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>"; |
|
399 | + } |
|
400 | + if (api_get_session_id() == 0) { |
|
401 | + $dropbox_file_data[] = $action_icons; |
|
402 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
403 | + $dropbox_file_data[] = $action_icons; |
|
404 | + } |
|
405 | + $action_icons = ''; |
|
406 | + $dropbox_file_data[] = $last_upload_date; |
|
407 | + $dropbox_file_data[] = $file_size; |
|
408 | + $dropbox_data_recieved[] = $dropbox_file_data; |
|
409 | + } |
|
410 | + } |
|
411 | + |
|
412 | + // The content of the sortable table = the categories (if we are not in the root) |
|
413 | + if ($view_dropbox_category_received == 0) { |
|
414 | + foreach ($dropbox_categories as $category) { |
|
415 | + /* Note: This can probably be shortened since the categories |
|
416 | 416 | for the received files are already in the |
417 | 417 | $dropbox_received_category array;*/ |
418 | - $dropbox_category_data = array(); |
|
419 | - if ($category['received'] == '1') { |
|
420 | - $movelist[$category['cat_id']] = $category['cat_name']; |
|
418 | + $dropbox_category_data = array(); |
|
419 | + if ($category['received'] == '1') { |
|
420 | + $movelist[$category['cat_id']] = $category['cat_name']; |
|
421 | 421 | // This is where the checkbox icon for the files appear |
422 | - $dropbox_category_data[] = $category['cat_id']; |
|
423 | - // The icon of the category |
|
424 | - $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">'; |
|
425 | - $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>'; |
|
426 | - $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>'; |
|
427 | - $dropbox_category_data[] = ''; |
|
428 | - $dropbox_category_data[] = ''; |
|
429 | - $dropbox_category_data[] = ''; |
|
430 | - $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> |
|
422 | + $dropbox_category_data[] = $category['cat_id']; |
|
423 | + // The icon of the category |
|
424 | + $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">'; |
|
425 | + $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>'; |
|
426 | + $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>'; |
|
427 | + $dropbox_category_data[] = ''; |
|
428 | + $dropbox_category_data[] = ''; |
|
429 | + $dropbox_category_data[] = ''; |
|
430 | + $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> |
|
431 | 431 | <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>'; |
432 | - } |
|
433 | - if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
|
434 | - $dropbox_data_recieved[] = $dropbox_category_data; |
|
435 | - } |
|
436 | - } |
|
437 | - } |
|
438 | - |
|
439 | - // Displaying the table |
|
432 | + } |
|
433 | + if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
|
434 | + $dropbox_data_recieved[] = $dropbox_category_data; |
|
435 | + } |
|
436 | + } |
|
437 | + } |
|
438 | + |
|
439 | + // Displaying the table |
|
440 | 440 | $additional_get_parameters = array( |
441 | 441 | 'view' => $view, |
442 | 442 | 'view_received_category' => $viewReceivedCategory, |
@@ -447,15 +447,15 @@ discard block |
||
447 | 447 | 'download_received' => get_lang('Download') |
448 | 448 | ); |
449 | 449 | |
450 | - if (is_array($movelist)) { |
|
451 | - foreach ($movelist as $catid => $catname){ |
|
452 | - $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
453 | - } |
|
454 | - } |
|
450 | + if (is_array($movelist)) { |
|
451 | + foreach ($movelist as $catid => $catname){ |
|
452 | + $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
453 | + } |
|
454 | + } |
|
455 | 455 | |
456 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
457 | - $selectlist = array(); |
|
458 | - } |
|
456 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
457 | + $selectlist = array(); |
|
458 | + } |
|
459 | 459 | echo '<div class="files-table">'; |
460 | 460 | Display::display_sortable_config_table( |
461 | 461 | 'dropbox', |
@@ -469,154 +469,154 @@ discard block |
||
469 | 469 | $selectlist |
470 | 470 | ); |
471 | 471 | echo '</div>'; |
472 | - } |
|
473 | - |
|
474 | - /* SENT FILES */ |
|
475 | - |
|
476 | - if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) { |
|
477 | - // This is for the categories |
|
478 | - if (isset($viewSentCategory) AND $viewSentCategory != '') { |
|
479 | - $view_dropbox_category_sent = $viewSentCategory; |
|
480 | - } else { |
|
481 | - $view_dropbox_category_sent = 0; |
|
482 | - } |
|
483 | - |
|
484 | - // Object initialisation |
|
485 | - $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
|
486 | - |
|
487 | - // Constructing the array that contains the total number of feedback messages per document. |
|
488 | - $number_feedback = get_total_number_feedback(); |
|
489 | - |
|
490 | - // Sorting and paging options |
|
491 | - $sorting_options = array(); |
|
492 | - $paging_options = array(); |
|
493 | - |
|
494 | - // The headers of the sortable tables |
|
495 | - $column_header = array(); |
|
496 | - |
|
497 | - $column_header[] = array('', false, ''); |
|
498 | - $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"'); |
|
499 | - $column_header[] = array(get_lang('SentTitle'), true, ''); |
|
500 | - $column_header[] = array(get_lang('Size'), true, ''); |
|
501 | - $column_header[] = array(get_lang('SentTo'), true, ''); |
|
502 | - $column_header[] = array(get_lang('LastResent'), true, ''); |
|
503 | - |
|
504 | - if (api_get_session_id() == 0) { |
|
505 | - $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
506 | - } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
507 | - $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
508 | - } |
|
509 | - |
|
510 | - $column_header[] = array('RealDate', true); |
|
511 | - $column_header[] = array('RealSize', true); |
|
512 | - |
|
513 | - $column_show = array(); |
|
514 | - $column_order = array(); |
|
515 | - |
|
516 | - // An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide |
|
517 | - $column_show[] = 1; |
|
518 | - $column_show[] = 1; |
|
519 | - $column_show[] = 1; |
|
520 | - $column_show[] = 1; |
|
521 | - $column_show[] = 1; |
|
522 | - $column_show[] = 1; |
|
523 | - if (api_get_session_id() == 0) { |
|
524 | - $column_show[] = 1; |
|
525 | - } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
526 | - $column_show[] = 1; |
|
527 | - } |
|
528 | - $column_show[] = 0; |
|
529 | - |
|
530 | - // Here we change the way how the colums are going to be sort |
|
531 | - // in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate |
|
532 | - // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48" |
|
533 | - |
|
534 | - $column_order[3] = 8; |
|
535 | - $column_order[5] = 7; |
|
536 | - |
|
537 | - // The content of the sortable table = the received files |
|
538 | - foreach ($dropbox_person->sentWork as $dropbox_file) { |
|
539 | - $dropbox_file_data = array(); |
|
540 | - |
|
541 | - if ($view_dropbox_category_sent == $dropbox_file->category) { |
|
542 | - $dropbox_file_data[] = $dropbox_file->id; |
|
543 | - $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
|
544 | - $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
|
545 | - $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
|
472 | + } |
|
473 | + |
|
474 | + /* SENT FILES */ |
|
475 | + |
|
476 | + if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) { |
|
477 | + // This is for the categories |
|
478 | + if (isset($viewSentCategory) AND $viewSentCategory != '') { |
|
479 | + $view_dropbox_category_sent = $viewSentCategory; |
|
480 | + } else { |
|
481 | + $view_dropbox_category_sent = 0; |
|
482 | + } |
|
483 | + |
|
484 | + // Object initialisation |
|
485 | + $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
|
486 | + |
|
487 | + // Constructing the array that contains the total number of feedback messages per document. |
|
488 | + $number_feedback = get_total_number_feedback(); |
|
489 | + |
|
490 | + // Sorting and paging options |
|
491 | + $sorting_options = array(); |
|
492 | + $paging_options = array(); |
|
493 | + |
|
494 | + // The headers of the sortable tables |
|
495 | + $column_header = array(); |
|
496 | + |
|
497 | + $column_header[] = array('', false, ''); |
|
498 | + $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"'); |
|
499 | + $column_header[] = array(get_lang('SentTitle'), true, ''); |
|
500 | + $column_header[] = array(get_lang('Size'), true, ''); |
|
501 | + $column_header[] = array(get_lang('SentTo'), true, ''); |
|
502 | + $column_header[] = array(get_lang('LastResent'), true, ''); |
|
503 | + |
|
504 | + if (api_get_session_id() == 0) { |
|
505 | + $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
506 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
507 | + $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"'); |
|
508 | + } |
|
509 | + |
|
510 | + $column_header[] = array('RealDate', true); |
|
511 | + $column_header[] = array('RealSize', true); |
|
512 | + |
|
513 | + $column_show = array(); |
|
514 | + $column_order = array(); |
|
515 | + |
|
516 | + // An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide |
|
517 | + $column_show[] = 1; |
|
518 | + $column_show[] = 1; |
|
519 | + $column_show[] = 1; |
|
520 | + $column_show[] = 1; |
|
521 | + $column_show[] = 1; |
|
522 | + $column_show[] = 1; |
|
523 | + if (api_get_session_id() == 0) { |
|
524 | + $column_show[] = 1; |
|
525 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
526 | + $column_show[] = 1; |
|
527 | + } |
|
528 | + $column_show[] = 0; |
|
529 | + |
|
530 | + // Here we change the way how the colums are going to be sort |
|
531 | + // in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate |
|
532 | + // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48" |
|
533 | + |
|
534 | + $column_order[3] = 8; |
|
535 | + $column_order[5] = 7; |
|
536 | + |
|
537 | + // The content of the sortable table = the received files |
|
538 | + foreach ($dropbox_person->sentWork as $dropbox_file) { |
|
539 | + $dropbox_file_data = array(); |
|
540 | + |
|
541 | + if ($view_dropbox_category_sent == $dropbox_file->category) { |
|
542 | + $dropbox_file_data[] = $dropbox_file->id; |
|
543 | + $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">'; |
|
544 | + $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>'; |
|
545 | + $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'. |
|
546 | 546 | 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; |
547 | - $file_size = $dropbox_file->filesize; |
|
548 | - $dropbox_file_data[] = format_file_size($file_size); |
|
547 | + $file_size = $dropbox_file->filesize; |
|
548 | + $dropbox_file_data[] = format_file_size($file_size); |
|
549 | 549 | $receivers_celldata = null; |
550 | - foreach ($dropbox_file->recipients as $recipient) { |
|
551 | - $userInfo = api_get_user_info($recipient['user_id']); |
|
552 | - $receivers_celldata = UserManager::getUserProfileLink($userInfo).', '.$receivers_celldata; |
|
553 | - } |
|
554 | - $receivers_celldata = trim(trim($receivers_celldata), ','); // Removing the trailing comma. |
|
555 | - $dropbox_file_data[] = $receivers_celldata; |
|
556 | - $last_upload_date = api_get_local_time($dropbox_file->last_upload_date); |
|
557 | - $dropbox_file_data[] = date_to_str_ago($dropbox_file->last_upload_date).'<br /><span class="dropbox_date">'. |
|
558 | - api_format_date($last_upload_date).'</span>'; |
|
559 | - |
|
560 | - //$dropbox_file_data[] = $dropbox_file->author; |
|
561 | - $receivers_celldata = ''; |
|
562 | - |
|
563 | - $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
|
550 | + foreach ($dropbox_file->recipients as $recipient) { |
|
551 | + $userInfo = api_get_user_info($recipient['user_id']); |
|
552 | + $receivers_celldata = UserManager::getUserProfileLink($userInfo).', '.$receivers_celldata; |
|
553 | + } |
|
554 | + $receivers_celldata = trim(trim($receivers_celldata), ','); // Removing the trailing comma. |
|
555 | + $dropbox_file_data[] = $receivers_celldata; |
|
556 | + $last_upload_date = api_get_local_time($dropbox_file->last_upload_date); |
|
557 | + $dropbox_file_data[] = date_to_str_ago($dropbox_file->last_upload_date).'<br /><span class="dropbox_date">'. |
|
558 | + api_format_date($last_upload_date).'</span>'; |
|
559 | + |
|
560 | + //$dropbox_file_data[] = $dropbox_file->author; |
|
561 | + $receivers_celldata = ''; |
|
562 | + |
|
563 | + $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').' |
|
564 | 564 | <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> |
565 | 565 | <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> |
566 | 566 | <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>'; |
567 | - // This is a hack to have an additional row in a sortable table |
|
568 | - if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) { |
|
569 | - $action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table |
|
570 | - $action_icons .= "<tr><td colspan=\"2\">"; |
|
571 | - $action_icons .= "<a href=\"".api_get_path(WEB_CODE_PATH)."dropbox/index.php?".api_get_cidreq()."&view_received_category=".$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a>"; |
|
572 | - $action_icons .= "</td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>"; |
|
573 | - } |
|
574 | - $dropbox_file_data[] = $action_icons; |
|
575 | - $dropbox_file_data[] = $last_upload_date; |
|
576 | - $dropbox_file_data[] = $file_size; |
|
577 | - $action_icons = ''; |
|
578 | - $dropbox_data_sent[] = $dropbox_file_data; |
|
579 | - } |
|
580 | - } |
|
567 | + // This is a hack to have an additional row in a sortable table |
|
568 | + if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) { |
|
569 | + $action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table |
|
570 | + $action_icons .= "<tr><td colspan=\"2\">"; |
|
571 | + $action_icons .= "<a href=\"".api_get_path(WEB_CODE_PATH)."dropbox/index.php?".api_get_cidreq()."&view_received_category=".$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a>"; |
|
572 | + $action_icons .= "</td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>"; |
|
573 | + } |
|
574 | + $dropbox_file_data[] = $action_icons; |
|
575 | + $dropbox_file_data[] = $last_upload_date; |
|
576 | + $dropbox_file_data[] = $file_size; |
|
577 | + $action_icons = ''; |
|
578 | + $dropbox_data_sent[] = $dropbox_file_data; |
|
579 | + } |
|
580 | + } |
|
581 | 581 | |
582 | 582 | $moveList = array(); |
583 | - // The content of the sortable table = the categories (if we are not in the root) |
|
584 | - if ($view_dropbox_category_sent == 0) { |
|
585 | - foreach ($dropbox_categories as $category) { |
|
586 | - $dropbox_category_data = array(); |
|
583 | + // The content of the sortable table = the categories (if we are not in the root) |
|
584 | + if ($view_dropbox_category_sent == 0) { |
|
585 | + foreach ($dropbox_categories as $category) { |
|
586 | + $dropbox_category_data = array(); |
|
587 | 587 | |
588 | - if ($category['sent'] == '1') { |
|
588 | + if ($category['sent'] == '1') { |
|
589 | 589 | |
590 | 590 | $moveList[$category['cat_id']] = $category['cat_name']; |
591 | - $dropbox_category_data[] = $category['cat_id']; |
|
592 | - // This is where the checkbox icon for the files appear. |
|
593 | - $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">'; |
|
594 | - $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>'; |
|
595 | - $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>'; |
|
596 | - //$dropbox_category_data[] = ''; |
|
597 | - $dropbox_category_data[] = ''; |
|
598 | - //$dropbox_category_data[] = ''; |
|
599 | - $dropbox_category_data[] = ''; |
|
600 | - $dropbox_category_data[] = ''; |
|
601 | - $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'].'">'. |
|
591 | + $dropbox_category_data[] = $category['cat_id']; |
|
592 | + // This is where the checkbox icon for the files appear. |
|
593 | + $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">'; |
|
594 | + $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>'; |
|
595 | + $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>'; |
|
596 | + //$dropbox_category_data[] = ''; |
|
597 | + $dropbox_category_data[] = ''; |
|
598 | + //$dropbox_category_data[] = ''; |
|
599 | + $dropbox_category_data[] = ''; |
|
600 | + $dropbox_category_data[] = ''; |
|
601 | + $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'].'">'. |
|
602 | 602 | Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> |
603 | 603 | <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']).'\');">'. |
604 | 604 | Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
605 | - } |
|
606 | - if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
|
607 | - $dropbox_data_sent[] = $dropbox_category_data; |
|
608 | - } |
|
609 | - } |
|
610 | - } |
|
611 | - |
|
612 | - // Displaying the table |
|
613 | - $additional_get_parameters = array( |
|
605 | + } |
|
606 | + if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { |
|
607 | + $dropbox_data_sent[] = $dropbox_category_data; |
|
608 | + } |
|
609 | + } |
|
610 | + } |
|
611 | + |
|
612 | + // Displaying the table |
|
613 | + $additional_get_parameters = array( |
|
614 | 614 | 'view' => $view, |
615 | 615 | 'view_received_category' => $viewReceivedCategory, |
616 | 616 | 'view_sent_category' => $viewSentCategory |
617 | 617 | ); |
618 | 618 | |
619 | - $selectlist = array( |
|
619 | + $selectlist = array( |
|
620 | 620 | 'delete_received' => get_lang('Delete'), |
621 | 621 | 'download_received' => get_lang('Download') |
622 | 622 | ); |
@@ -627,12 +627,12 @@ discard block |
||
627 | 627 | } |
628 | 628 | } |
629 | 629 | |
630 | - if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
631 | - $selectlist = array('download_received' => get_lang('Download')); |
|
632 | - } |
|
630 | + if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
|
631 | + $selectlist = array('download_received' => get_lang('Download')); |
|
632 | + } |
|
633 | 633 | |
634 | 634 | echo '<div class="files-table">'; |
635 | - Display::display_sortable_config_table( |
|
635 | + Display::display_sortable_config_table( |
|
636 | 636 | 'dropbox', |
637 | 637 | $column_header, |
638 | 638 | $dropbox_data_sent, |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $selectlist |
645 | 645 | ); |
646 | 646 | echo '</div>'; |
647 | - } |
|
647 | + } |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | Display::display_footer(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | $action = $_GET['a']; |
10 | 10 | |
11 | 11 | switch ($action) { |
12 | - case 'send_contact_information': |
|
12 | + case 'send_contact_information': |
|
13 | 13 | if (!empty($_POST)) { |
14 | 14 | // get params from contact form |
15 | 15 | $person_name = $_POST['person_name']; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | } |
62 | 62 | break; |
63 | - default: |
|
64 | - echo ''; |
|
63 | + default: |
|
64 | + echo ''; |
|
65 | 65 | } |
66 | 66 | exit; |
@@ -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 | /** |
@@ -65,8 +65,10 @@ discard block |
||
65 | 65 | $bords = array_fill(0, $bord_lenght, array()); // building this array |
66 | 66 | |
67 | 67 | /* adding the first point of the polygone */ |
68 | - if (is_array($bords[$poly[0]['y']])) //avoid warning |
|
68 | + if (is_array($bords[$poly[0]['y']])) { |
|
69 | + //avoid warning |
|
69 | 70 | array_push($bords[$poly[0]['y']], $poly[0]['x']); |
71 | + } |
|
70 | 72 | |
71 | 73 | $i = 1; // we re-use $i and $old_pente bellow the loop |
72 | 74 | $old_pente=0; |
@@ -75,11 +77,14 @@ discard block |
||
75 | 77 | |
76 | 78 | /* special cases */ |
77 | 79 | if ($poly[$i-1]['y'] == $poly[$i]['y']) { |
78 | - if ($poly[$i-1]['x'] == $poly[$i]['x']) |
|
79 | - continue; // twice the same point |
|
80 | + if ($poly[$i-1]['x'] == $poly[$i]['x']) { |
|
81 | + continue; |
|
82 | + } |
|
83 | + // twice the same point |
|
80 | 84 | else { // infinite elevation of the edge |
81 | - if (is_array($bords[$poly[$i]['y']])) |
|
82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
85 | + if (is_array($bords[$poly[$i]['y']])) { |
|
86 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
87 | + } |
|
83 | 88 | $old_pente=0; |
84 | 89 | continue; |
85 | 90 | } |
@@ -87,9 +92,13 @@ discard block |
||
87 | 92 | |
88 | 93 | //echo 'point:'.$poly[$i]['y']; bug here |
89 | 94 | // adding the point as a part of an edge |
90 | - if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
95 | + if (is_array($bords[$poly[$i]['y']])) { |
|
96 | + //avoid warning |
|
91 | 97 | array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
92 | - if (DEBUG) echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].') '; |
|
98 | + } |
|
99 | + if (DEBUG) { |
|
100 | + echo '('.$poly[$i]['x'].';'.$poly[$i]['y'].') '; |
|
101 | + } |
|
93 | 102 | |
94 | 103 | /* computing the elevation of the edge going */ |
95 | 104 | // from $poly[$i-1] to $poly[$i] |
@@ -99,15 +108,17 @@ discard block |
||
99 | 108 | // if the sign of the elevation change from the one of the |
100 | 109 | // previous edge, the point must be added a second time inside |
101 | 110 | // $bords |
102 | - if ($i>1) |
|
103 | - if (($old_pente<0 && $pente>0) |
|
111 | + if ($i>1) { |
|
112 | + if (($old_pente<0 && $pente>0) |
|
104 | 113 | || ($old_pente>0 && $pente<0)) { |
105 | 114 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
106 | 115 | array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
116 | + } |
|
107 | 117 | |
108 | - if (DEBUG) |
|
109 | - echo '*('.$poly[$i]['x']. |
|
118 | + if (DEBUG) { |
|
119 | + echo '*('.$poly[$i]['x']. |
|
110 | 120 | ';'.$poly[$i]['y'].') '; |
121 | + } |
|
111 | 122 | } |
112 | 123 | |
113 | 124 | /* detect the direction of the elevation in Y */ |
@@ -136,10 +147,11 @@ discard block |
||
136 | 147 | |
137 | 148 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
138 | 149 | $rest = $poly[0]['y']-$poly[1]['y']; |
139 | - if ($rest!=0) |
|
140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
141 | - else |
|
142 | - $pente1 = 0; |
|
150 | + if ($rest!=0) { |
|
151 | + $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
152 | + } else { |
|
153 | + $pente1 = 0; |
|
154 | + } |
|
143 | 155 | |
144 | 156 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
145 | 157 | $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
@@ -151,14 +163,17 @@ discard block |
||
151 | 163 | |
152 | 164 | // doubling the first point if needed (see above) |
153 | 165 | if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
154 | - if (is_array($bords[$poly[$i - 1]['y']])) |
|
155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
166 | + if (is_array($bords[$poly[$i - 1]['y']])) { |
|
167 | + array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
168 | + } |
|
156 | 169 | //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
157 | 170 | } |
158 | 171 | // doubling the last point if neededd |
159 | 172 | if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) { |
160 | - if (is_array($bords[$poly[$i-1]['y']])) //avoid warning |
|
173 | + if (is_array($bords[$poly[$i-1]['y']])) { |
|
174 | + //avoid warning |
|
161 | 175 | array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x'])); |
176 | + } |
|
162 | 177 | //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].') '; |
163 | 178 | } |
164 | 179 | |
@@ -227,11 +242,13 @@ discard block |
||
227 | 242 | $s = "<div style='font-size: 8px; line-height:3px'><pre>\n"; |
228 | 243 | } |
229 | 244 | for ($i=0; $i<$max['y']; $i++) { |
230 | - for($j=0; $j<$max['x']; $j++) |
|
231 | - if($poly[$j][$i] == TRUE) |
|
245 | + for($j=0; $j<$max['x']; $j++) { |
|
246 | + if($poly[$j][$i] == TRUE) |
|
232 | 247 | $s .= ($format=='html'?"<b>1</b>":'1'); |
233 | - else |
|
234 | - $s .= "0"; |
|
248 | + } |
|
249 | + else { |
|
250 | + $s .= "0"; |
|
251 | + } |
|
235 | 252 | $s .= ($format=='html'?"<br />\n":"\n"); |
236 | 253 | } |
237 | 254 | $s .= ($format=='html'?"</pre></div>\n":"\n"); |
@@ -252,15 +269,19 @@ discard block |
||
252 | 269 | $surfaceOf1 = 0; |
253 | 270 | $surfaceOf2 = 0; |
254 | 271 | |
255 | - for ($i=0; $i<$max['x']; $i++) |
|
256 | - for($j=0; $j<$max['y']; $j++) { |
|
272 | + for ($i=0; $i<$max['x']; $i++) { |
|
273 | + for($j=0; |
|
274 | + } |
|
275 | + $j<$max['y']; $j++) { |
|
257 | 276 | if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) { |
258 | 277 | $surfaceOf1++; |
259 | - if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) |
|
260 | - $onlyIn1++; |
|
278 | + if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE)) { |
|
279 | + $onlyIn1++; |
|
280 | + } |
|
281 | + } |
|
282 | + if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) { |
|
283 | + $surfaceOf2++; |
|
261 | 284 | } |
262 | - if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == TRUE)) |
|
263 | - $surfaceOf2++; |
|
264 | 285 | } |
265 | 286 | |
266 | 287 | return array ( |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | * for all j in [O..max[y][ : for all i in bords[$j] : |
57 | 57 | * (i,j) is a point inside an edge of the polygone |
58 | 58 | */ |
59 | - $bord_lenght = $max['x']; |
|
59 | + $bord_lenght = $max['x']; |
|
60 | 60 | if ($max['y'] > $bord_lenght) { |
61 | - $bord_lenght = $max['y']; |
|
61 | + $bord_lenght = $max['y']; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | //$bords = array_fill(0, $bord_lenght-1, array()); // building this array |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | /* adding the first point of the polygone */ |
68 | 68 | if (is_array($bords[$poly[0]['y']])) //avoid warning |
69 | - array_push($bords[$poly[0]['y']], $poly[0]['x']); |
|
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 | 72 | $old_pente=0; |
@@ -78,14 +78,14 @@ discard block |
||
78 | 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 | - if (is_array($bords[$poly[$i]['y']])) |
|
82 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
81 | + if (is_array($bords[$poly[$i]['y']])) |
|
82 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
83 | 83 | $old_pente=0; |
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - //echo 'point:'.$poly[$i]['y']; bug here |
|
88 | + //echo 'point:'.$poly[$i]['y']; bug here |
|
89 | 89 | // adding the point as a part of an edge |
90 | 90 | if (is_array($bords[$poly[$i]['y']])) //avoid warning |
91 | 91 | array_push($bords[$poly[$i]['y']], $poly[$i]['x']); |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | if ($i>1) |
103 | 103 | if (($old_pente<0 && $pente>0) |
104 | 104 | || ($old_pente>0 && $pente<0)) { |
105 | - if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
106 | - array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
105 | + if (is_array($bords[$poly[$i]['y']])) //avoid warning |
|
106 | + array_push($bords[$poly[$i]['y']],$poly[$i]['x']); |
|
107 | 107 | |
108 | 108 | if (DEBUG) |
109 | 109 | echo '*('.$poly[$i]['x']. |
110 | 110 | ';'.$poly[$i]['y'].') '; |
111 | - } |
|
111 | + } |
|
112 | 112 | |
113 | 113 | /* detect the direction of the elevation in Y */ |
114 | 114 | $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1; |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | // elevation between $poly[0]['x'] and $poly[1]['x']) |
138 | 138 | $rest = $poly[0]['y']-$poly[1]['y']; |
139 | 139 | if ($rest!=0) |
140 | - $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
140 | + $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest); |
|
141 | 141 | else |
142 | - $pente1 = 0; |
|
142 | + $pente1 = 0; |
|
143 | 143 | |
144 | 144 | // elevation between $poly[$i-1]['x'] and $poly[0]['x']) |
145 | 145 | $pente = ($poly[$i-1]['x']-$poly[0]['x'])/ |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | |
152 | 152 | // doubling the first point if needed (see above) |
153 | 153 | if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) { |
154 | - if (is_array($bords[$poly[$i - 1]['y']])) |
|
155 | - array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x'])); |
|
154 | + if (is_array($bords[$poly[$i - 1]['y']])) |
|
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 | 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'])); |
|
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 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 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 | - sort($bords[$i]); |
|
188 | + sort($bords[$i]); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords |
@@ -196,7 +196,7 @@ discard block |
||
196 | 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 | 198 | if ($test == 1) { |
199 | - /*how to draw the polygon in a human way: |
|
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) |
202 | 202 | In gnuplot: |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | For 2 polygons: plot "/home/jmontoya/test", "/home/jmontoya/test2" |
205 | 205 | A new window will appear with the plot |
206 | 206 | */ |
207 | - echo $k.' '.$i; echo '<br />'; |
|
207 | + echo $k.' '.$i; echo '<br />'; |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | list($x,$y) = explode(';',$pcoord); |
309 | 309 | $points[] = array('x'=>$x,'y'=>$y); |
310 | 310 | } |
311 | - return $points; |
|
311 | + return $points; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | $mx = 0; |
322 | 322 | $my = 0; |
323 | 323 | foreach ($coords1 as $coord) { |
324 | - if ($coord['x'] > $mx) { |
|
324 | + if ($coord['x'] > $mx) { |
|
325 | 325 | $mx = $coord['x']; |
326 | - } |
|
326 | + } |
|
327 | 327 | if ($coord['y'] > $my) { |
328 | - $my = $coord['y']; |
|
328 | + $my = $coord['y']; |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | foreach ($coords2 as $coord) { |
@@ -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 | } |
@@ -16,7 +16,6 @@ |
||
16 | 16 | * @author Patrick Cool |
17 | 17 | * @author René Haentjens, added CSV file import (October 2004) |
18 | 18 | * @package chamilo.link |
19 | - |
|
20 | 19 | */ |
21 | 20 | |
22 | 21 | // Including libraries |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | return true; |
291 | 291 | } else { |
292 | 292 | $tbl_document = Database::get_course_table(TABLE_DOCUMENT); |
293 | - $tbl_item_property = $this_course . 'item_property'; |
|
293 | + $tbl_item_property = $this_course.'item_property'; |
|
294 | 294 | $doc_url = Database::escape_string($doc_url); |
295 | 295 | $query = "SELECT 1 FROM $tbl_document AS docs,$tbl_item_property AS props |
296 | 296 | WHERE |
@@ -340,18 +340,18 @@ discard block |
||
340 | 340 | } |
341 | 341 | |
342 | 342 | header('Content-type: application/octet-stream'); |
343 | - header('Content-length: ' . $len); |
|
343 | + header('Content-length: '.$len); |
|
344 | 344 | if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) { |
345 | - header('Content-Disposition: filename= ' . $filename); |
|
345 | + header('Content-Disposition: filename= '.$filename); |
|
346 | 346 | } else { |
347 | - header('Content-Disposition: attachment; filename= ' . $filename); |
|
347 | + header('Content-Disposition: attachment; filename= '.$filename); |
|
348 | 348 | } |
349 | 349 | if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { |
350 | 350 | header('Pragma: '); |
351 | 351 | header('Cache-Control: '); |
352 | 352 | header('Cache-Control: public'); // IE cannot download from sessions without a cache |
353 | 353 | } |
354 | - header('Content-Description: ' . $filename); |
|
354 | + header('Content-Description: '.$filename); |
|
355 | 355 | header('Content-Transfer-Encoding: binary'); |
356 | 356 | |
357 | 357 | $res = fopen($full_file_name, 'r'); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | } else { |
379 | 379 | $encoding = @api_detect_encoding_html(file_get_contents($full_file_name)); |
380 | 380 | if (!empty($encoding)) { |
381 | - $content_type .= '; charset=' . $encoding; |
|
381 | + $content_type .= '; charset='.$encoding; |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | break; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | } else { |
389 | 389 | $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name))); |
390 | 390 | if (!empty($encoding)) { |
391 | - $content_type .= '; charset=' . $encoding; |
|
391 | + $content_type .= '; charset='.$encoding; |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 | break; |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | header('Content-type: application/octet-stream'); |
398 | 398 | break; |
399 | 399 | } |
400 | - header('Content-type: ' . $content_type); |
|
401 | - header('Content-Length: ' . $len); |
|
400 | + header('Content-type: '.$content_type); |
|
401 | + header('Content-Length: '.$len); |
|
402 | 402 | $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); |
403 | 403 | if (strpos($user_agent, 'msie')) { |
404 | - header('Content-Disposition: ; filename= ' . $filename); |
|
404 | + header('Content-Disposition: ; filename= '.$filename); |
|
405 | 405 | } else { |
406 | - header('Content-Disposition: inline; filename= ' . $filename); |
|
406 | + header('Content-Disposition: inline; filename= '.$filename); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if ($fixLinksHttpToHttps) { |
@@ -444,18 +444,18 @@ discard block |
||
444 | 444 | |
445 | 445 | header('Content-type: application/octet-stream'); |
446 | 446 | //header('Content-Type: application/force-download'); |
447 | - header('Content-length: ' . $len); |
|
447 | + header('Content-length: '.$len); |
|
448 | 448 | if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) { |
449 | - header('Content-Disposition: filename= ' . $filename); |
|
449 | + header('Content-Disposition: filename= '.$filename); |
|
450 | 450 | } else { |
451 | - header('Content-Disposition: attachment; filename= ' . $filename); |
|
451 | + header('Content-Disposition: attachment; filename= '.$filename); |
|
452 | 452 | } |
453 | 453 | if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { |
454 | 454 | header('Pragma: '); |
455 | 455 | header('Cache-Control: '); |
456 | 456 | header('Cache-Control: public'); // IE cannot download from sessions without a cache |
457 | 457 | } |
458 | - header('Content-Description: ' . $filename); |
|
458 | + header('Content-Description: '.$filename); |
|
459 | 459 | header('Content-transfer-encoding: binary'); |
460 | 460 | echo $full_string; |
461 | 461 | |
@@ -468,30 +468,30 @@ discard block |
||
468 | 468 | |
469 | 469 | $content_type = self::file_get_mime_type($filename); |
470 | 470 | header('Expires: Wed, 01 Jan 1990 00:00:00 GMT'); |
471 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
471 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
472 | 472 | header('Cache-Control: no-cache, must-revalidate'); |
473 | 473 | header('Pragma: no-cache'); |
474 | 474 | switch ($content_type) { |
475 | 475 | case 'text/html': |
476 | 476 | $encoding = @api_detect_encoding_html($full_string); |
477 | 477 | if (!empty($encoding)) { |
478 | - $content_type .= '; charset=' . $encoding; |
|
478 | + $content_type .= '; charset='.$encoding; |
|
479 | 479 | } |
480 | 480 | break; |
481 | 481 | case 'text/plain': |
482 | 482 | $encoding = @api_detect_encoding(strip_tags($full_string)); |
483 | 483 | if (!empty($encoding)) { |
484 | - $content_type .= '; charset=' . $encoding; |
|
484 | + $content_type .= '; charset='.$encoding; |
|
485 | 485 | } |
486 | 486 | break; |
487 | 487 | } |
488 | - header('Content-type: ' . $content_type); |
|
489 | - header('Content-Length: ' . $len); |
|
488 | + header('Content-type: '.$content_type); |
|
489 | + header('Content-Length: '.$len); |
|
490 | 490 | $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); |
491 | 491 | if (strpos($user_agent, 'msie')) { |
492 | - header('Content-Disposition: ; filename= ' . $filename); |
|
492 | + header('Content-Disposition: ; filename= '.$filename); |
|
493 | 493 | } else { |
494 | - header('Content-Disposition: inline; filename= ' . $filename); |
|
494 | + header('Content-Disposition: inline; filename= '.$filename); |
|
495 | 495 | } |
496 | 496 | echo($full_string); |
497 | 497 | //You have to ensure that the calling script then stops processing (exit();) |
@@ -584,9 +584,9 @@ discard block |
||
584 | 584 | if (!empty($students)) { |
585 | 585 | $conditionList = array(); |
586 | 586 | foreach ($students as $studentId => $studentInfo) { |
587 | - $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id']; |
|
587 | + $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id']; |
|
588 | 588 | } |
589 | - $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")'; |
|
589 | + $sharedCondition .= ' AND docs.path IN ("'.implode('","', $conditionList).'")'; |
|
590 | 590 | } |
591 | 591 | } |
592 | 592 | |
@@ -612,8 +612,8 @@ discard block |
||
612 | 612 | last.c_id = {$_course['real_id']} |
613 | 613 | ) |
614 | 614 | WHERE |
615 | - docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND |
|
616 | - docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND |
|
615 | + docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND |
|
616 | + docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND |
|
617 | 617 | docs.path NOT LIKE '%_DELETED_%' AND |
618 | 618 | $userGroupFilter AND |
619 | 619 | last.visibility $visibility_bit |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES); |
655 | 655 | $sql = "SELECT id FROM $table_template |
656 | 656 | WHERE |
657 | - course_code = '" . $_course['code'] . "' AND |
|
657 | + course_code = '".$_course['code']."' AND |
|
658 | 658 | user_id = '".api_get_user_id()."' AND |
659 | 659 | ref_doc = '".$row['id']."'"; |
660 | 660 | $template_result = Database::query($sql); |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | if (!empty($students)) { |
765 | 765 | $conditionList = array(); |
766 | 766 | foreach ($students as $studentId => $studentInfo) { |
767 | - $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id']; |
|
767 | + $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id']; |
|
768 | 768 | } |
769 | 769 | } |
770 | 770 | |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | INNER JOIN $TABLE_DOCUMENT AS docs |
789 | 789 | ON ( |
790 | 790 | docs.id = last.ref AND |
791 | - last.tool = '" . TOOL_DOCUMENT . "' AND |
|
791 | + last.tool = '".TOOL_DOCUMENT."' AND |
|
792 | 792 | last.c_id = {$_course['real_id']} AND |
793 | 793 | docs.c_id = {$_course['real_id']} |
794 | 794 | ) |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | INNER JOIN $TABLE_DOCUMENT AS docs |
806 | 806 | ON ( |
807 | 807 | docs.id = last.ref AND |
808 | - last.tool = '" . TOOL_DOCUMENT . "' AND |
|
808 | + last.tool = '".TOOL_DOCUMENT."' AND |
|
809 | 809 | last.c_id = {$_course['real_id']} AND |
810 | 810 | docs.c_id = {$_course['real_id']} |
811 | 811 | ) |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | WHERE |
853 | 853 | docs.id = last.ref AND |
854 | 854 | docs.filetype = 'folder' AND |
855 | - last.tool = '" . TOOL_DOCUMENT . "' AND |
|
855 | + last.tool = '".TOOL_DOCUMENT."' AND |
|
856 | 856 | $groupCondition AND |
857 | 857 | last.visibility = 1 |
858 | 858 | $condition_session AND |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | WHERE |
874 | 874 | docs.id = last.ref AND |
875 | 875 | docs.filetype = 'folder' AND |
876 | - last.tool = '" . TOOL_DOCUMENT . "' AND |
|
876 | + last.tool = '".TOOL_DOCUMENT."' AND |
|
877 | 877 | $groupCondition AND |
878 | 878 | last.visibility = 0 $condition_session AND |
879 | 879 | last.c_id = {$_course['real_id']} AND |
@@ -889,9 +889,9 @@ discard block |
||
889 | 889 | FROM $TABLE_ITEMPROPERTY AS last, $TABLE_DOCUMENT AS docs |
890 | 890 | WHERE |
891 | 891 | docs.id = last.ref AND |
892 | - docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND |
|
892 | + docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND |
|
893 | 893 | docs.filetype = 'folder' AND |
894 | - last.tool = '" . TOOL_DOCUMENT . "' AND |
|
894 | + last.tool = '" . TOOL_DOCUMENT."' AND |
|
895 | 895 | $groupCondition AND |
896 | 896 | last.visibility = 1 $condition_session AND |
897 | 897 | last.c_id = {$_course['real_id']} AND |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | tp.c_id = $course_id AND |
969 | 969 | td.session_id = $sessionId AND |
970 | 970 | tp.ref= td.id AND |
971 | - (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) "; |
|
971 | + (path='".$path."' OR path LIKE BINARY '".$path."/%' ) "; |
|
972 | 972 | // Get all id's of documents that are deleted |
973 | 973 | $what_to_check_result = Database::query($sql); |
974 | 974 | |
@@ -1311,7 +1311,7 @@ discard block |
||
1311 | 1311 | $res = Database::query($sql); |
1312 | 1312 | if (Database::num_rows($res) > 0) { |
1313 | 1313 | $row2 = Database::fetch_array($res); |
1314 | - require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
1314 | + require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
1315 | 1315 | $di = new ChamiloIndexer(); |
1316 | 1316 | $di->remove_document((int) $row2['search_did']); |
1317 | 1317 | } |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | Database::query($sql); |
1321 | 1321 | |
1322 | 1322 | // remove terms from db |
1323 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
1323 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
1324 | 1324 | delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id); |
1325 | 1325 | } |
1326 | 1326 | } |
@@ -1408,12 +1408,12 @@ discard block |
||
1408 | 1408 | $path = str_replace('%2F', '/', $url_path); |
1409 | 1409 | $pathinfo = pathinfo($row['path']); |
1410 | 1410 | |
1411 | - $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id; |
|
1412 | - $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id; |
|
1413 | - $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path']; |
|
1414 | - $row['absolute_path_from_document'] = '/document' . $row['path']; |
|
1415 | - $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/'; |
|
1416 | - $row['direct_url'] = $www . $path; |
|
1411 | + $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id; |
|
1412 | + $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id; |
|
1413 | + $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path']; |
|
1414 | + $row['absolute_path_from_document'] = '/document'.$row['path']; |
|
1415 | + $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/'; |
|
1416 | + $row['direct_url'] = $www.$path; |
|
1417 | 1417 | |
1418 | 1418 | if (dirname($row['path']) == '.') { |
1419 | 1419 | $row['parent_id'] = '0'; |
@@ -1432,7 +1432,7 @@ discard block |
||
1432 | 1432 | $real_dir = ''; |
1433 | 1433 | |
1434 | 1434 | for ($i = 1; $i < $array_len; $i++) { |
1435 | - $real_dir .= '/' . (isset($dir_array[$i]) ? $dir_array[$i] : ''); |
|
1435 | + $real_dir .= '/'.(isset($dir_array[$i]) ? $dir_array[$i] : ''); |
|
1436 | 1436 | $parent_id = self::get_document_id($course_info, $real_dir); |
1437 | 1437 | if ($session_id != 0 && empty($parent_id)) { |
1438 | 1438 | $parent_id = self::get_document_id($course_info, $real_dir, 0); |
@@ -1506,21 +1506,21 @@ discard block |
||
1506 | 1506 | $user_id = intval($user_id); |
1507 | 1507 | $document_id = intval($document_id); |
1508 | 1508 | |
1509 | - $sql = 'SELECT id FROM ' . $table_template . ' |
|
1509 | + $sql = 'SELECT id FROM '.$table_template.' |
|
1510 | 1510 | WHERE |
1511 | - course_code="' . $course_code . '" AND |
|
1512 | - user_id="' . $user_id . '" AND |
|
1513 | - ref_doc="' . $document_id . '"'; |
|
1511 | + course_code="' . $course_code.'" AND |
|
1512 | + user_id="' . $user_id.'" AND |
|
1513 | + ref_doc="' . $document_id.'"'; |
|
1514 | 1514 | $result = Database::query($sql); |
1515 | 1515 | $template_id = Database::result($result, 0, 0); |
1516 | 1516 | |
1517 | - my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg'); |
|
1517 | + my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg'); |
|
1518 | 1518 | |
1519 | - $sql = 'DELETE FROM ' . $table_template . ' |
|
1519 | + $sql = 'DELETE FROM '.$table_template.' |
|
1520 | 1520 | WHERE |
1521 | - course_code="' . $course_code . '" AND |
|
1522 | - user_id="' . $user_id . '" AND |
|
1523 | - ref_doc="' . $document_id . '"'; |
|
1521 | + course_code="' . $course_code.'" AND |
|
1522 | + user_id="' . $user_id.'" AND |
|
1523 | + ref_doc="' . $document_id.'"'; |
|
1524 | 1524 | |
1525 | 1525 | Database::query($sql); |
1526 | 1526 | } |
@@ -1581,7 +1581,7 @@ discard block |
||
1581 | 1581 | INNER JOIN $propTable ip |
1582 | 1582 | ON (d.id = ip.ref AND d.c_id = $course_id AND ip.c_id = $course_id) |
1583 | 1583 | WHERE |
1584 | - ip.tool = '" . TOOL_DOCUMENT . "' $condition AND |
|
1584 | + ip.tool = '".TOOL_DOCUMENT."' $condition AND |
|
1585 | 1585 | filetype = '$file_type' AND |
1586 | 1586 | locate(concat(path,'/'), '$doc_path')=1 |
1587 | 1587 | "; |
@@ -1745,12 +1745,12 @@ discard block |
||
1745 | 1745 | if (empty($session_id)) { |
1746 | 1746 | $sql_session = 'AND (session_id = 0 OR isnull(session_id)) '; |
1747 | 1747 | } elseif ($session_id > 0) { |
1748 | - $sql_session = 'AND session_id=' . intval($session_id); |
|
1748 | + $sql_session = 'AND session_id='.intval($session_id); |
|
1749 | 1749 | } else { |
1750 | 1750 | $sql_session = ''; |
1751 | 1751 | } |
1752 | - $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '" |
|
1753 | - WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session; |
|
1752 | + $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'" |
|
1753 | + WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session; |
|
1754 | 1754 | Database::query($sql); |
1755 | 1755 | } |
1756 | 1756 | |
@@ -1772,12 +1772,12 @@ discard block |
||
1772 | 1772 | if (empty($session_id)) { |
1773 | 1773 | $sql_session = 'AND (session_id = 0 OR isnull(session_id)) '; |
1774 | 1774 | } elseif ($session_id > 0) { |
1775 | - $sql_session = 'AND session_id=' . intval($session_id); |
|
1775 | + $sql_session = 'AND session_id='.intval($session_id); |
|
1776 | 1776 | } else { |
1777 | 1777 | $sql_session = ''; |
1778 | 1778 | } |
1779 | - $sql = 'SELECT document_id FROM ' . $tbl_category . ' |
|
1780 | - WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session; |
|
1779 | + $sql = 'SELECT document_id FROM '.$tbl_category.' |
|
1780 | + WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session; |
|
1781 | 1781 | |
1782 | 1782 | $rs = Database::query($sql); |
1783 | 1783 | $num = Database::num_rows($rs); |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | $all_user_info = array(); |
1819 | 1819 | if (Database::num_rows($rs)) { |
1820 | 1820 | $row = Database::fetch_array($rs); |
1821 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path']; |
|
1821 | + $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path']; |
|
1822 | 1822 | if (is_file($filepath)) { |
1823 | 1823 | $my_content_html = file_get_contents($filepath); |
1824 | 1824 | } |
@@ -1901,9 +1901,9 @@ discard block |
||
1901 | 1901 | $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY); |
1902 | 1902 | } |
1903 | 1903 | |
1904 | - $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id']; |
|
1904 | + $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id']; |
|
1905 | 1905 | |
1906 | - $externalStyleFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/certificate.css'; |
|
1906 | + $externalStyleFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/certificate.css'; |
|
1907 | 1907 | $externalStyle = ''; |
1908 | 1908 | |
1909 | 1909 | if (is_file($externalStyleFile)) { |
@@ -1925,7 +1925,7 @@ discard block |
||
1925 | 1925 | $course_info['name'], |
1926 | 1926 | $info_grade_certificate['grade'], |
1927 | 1927 | $url, |
1928 | - '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>', |
|
1928 | + '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>', |
|
1929 | 1929 | '((certificate_barcode))', |
1930 | 1930 | $externalStyle |
1931 | 1931 | ); |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | if (!empty($extraFields)) { |
1952 | 1952 | foreach ($extraFields as $extraField) { |
1953 | 1953 | $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : ''; |
1954 | - $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))'; |
|
1954 | + $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))'; |
|
1955 | 1955 | $info_to_replace_in_content_html[] = $valueExtra; |
1956 | 1956 | } |
1957 | 1957 | } |
@@ -1979,17 +1979,17 @@ discard block |
||
1979 | 1979 | $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); |
1980 | 1980 | $session_id = api_get_session_id(); |
1981 | 1981 | if ($session_id == 0 || is_null($session_id)) { |
1982 | - $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) '; |
|
1982 | + $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) '; |
|
1983 | 1983 | } elseif ($session_id > 0) { |
1984 | - $sql_session = 'AND session_id=' . intval($session_id); |
|
1984 | + $sql_session = 'AND session_id='.intval($session_id); |
|
1985 | 1985 | } else { |
1986 | 1986 | $sql_session = ''; |
1987 | 1987 | } |
1988 | 1988 | |
1989 | - $sql = 'UPDATE ' . $tbl_category . ' SET document_id=null |
|
1989 | + $sql = 'UPDATE '.$tbl_category.' SET document_id=null |
|
1990 | 1990 | WHERE |
1991 | - course_code = "' . Database::escape_string($course_id) . '" AND |
|
1992 | - document_id="' . $default_certificate_id . '" ' . $sql_session; |
|
1991 | + course_code = "' . Database::escape_string($course_id).'" AND |
|
1992 | + document_id="' . $default_certificate_id.'" '.$sql_session; |
|
1993 | 1993 | Database::query($sql); |
1994 | 1994 | } |
1995 | 1995 | } |
@@ -2005,10 +2005,10 @@ discard block |
||
2005 | 2005 | if (!empty($courseInfo)) { |
2006 | 2006 | $to_group_id = 0; |
2007 | 2007 | $to_user_id = null; |
2008 | - $course_dir = $courseInfo['path'] . "/document/"; |
|
2008 | + $course_dir = $courseInfo['path']."/document/"; |
|
2009 | 2009 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
2010 | - $base_work_dir = $sys_course_path . $course_dir; |
|
2011 | - $base_work_dir_test = $base_work_dir . 'certificates'; |
|
2010 | + $base_work_dir = $sys_course_path.$course_dir; |
|
2011 | + $base_work_dir_test = $base_work_dir.'certificates'; |
|
2012 | 2012 | $dir_name = '/certificates'; |
2013 | 2013 | $post_dir_name = get_lang('CertificatesFiles'); |
2014 | 2014 | $visibility_command = 'invisible'; |
@@ -2235,9 +2235,9 @@ discard block |
||
2235 | 2235 | //$new_abs_path = realpath($dir.'/'.$second_part); |
2236 | 2236 | $dir = ''; |
2237 | 2237 | if (!empty($abs_path)) { |
2238 | - $dir = dirname($abs_path) . '/'; |
|
2238 | + $dir = dirname($abs_path).'/'; |
|
2239 | 2239 | } |
2240 | - $new_abs_path = realpath($dir . $second_part); |
|
2240 | + $new_abs_path = realpath($dir.$second_part); |
|
2241 | 2241 | $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1); |
2242 | 2242 | if (count($in_files_list) > 0) { |
2243 | 2243 | $files_list = array_merge($files_list, $in_files_list); |
@@ -2250,9 +2250,9 @@ discard block |
||
2250 | 2250 | $files_list[] = array($second_part, 'local', 'rel'); |
2251 | 2251 | $dir = ''; |
2252 | 2252 | if (!empty($abs_path)) { |
2253 | - $dir = dirname($abs_path) . '/'; |
|
2253 | + $dir = dirname($abs_path).'/'; |
|
2254 | 2254 | } |
2255 | - $new_abs_path = realpath($dir . $second_part); |
|
2255 | + $new_abs_path = realpath($dir.$second_part); |
|
2256 | 2256 | $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1); |
2257 | 2257 | if (count($in_files_list) > 0) { |
2258 | 2258 | $files_list = array_merge($files_list, $in_files_list); |
@@ -2286,9 +2286,9 @@ discard block |
||
2286 | 2286 | $files_list[] = array($source, 'local', 'rel'); |
2287 | 2287 | $dir = ''; |
2288 | 2288 | if (!empty($abs_path)) { |
2289 | - $dir = dirname($abs_path) . '/'; |
|
2289 | + $dir = dirname($abs_path).'/'; |
|
2290 | 2290 | } |
2291 | - $new_abs_path = realpath($dir . $source); |
|
2291 | + $new_abs_path = realpath($dir.$source); |
|
2292 | 2292 | $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1); |
2293 | 2293 | if (count($in_files_list) > 0) { |
2294 | 2294 | $files_list = array_merge($files_list, $in_files_list); |
@@ -2301,9 +2301,9 @@ discard block |
||
2301 | 2301 | $files_list[] = array($source, 'local', 'rel'); |
2302 | 2302 | $dir = ''; |
2303 | 2303 | if (!empty($abs_path)) { |
2304 | - $dir = dirname($abs_path) . '/'; |
|
2304 | + $dir = dirname($abs_path).'/'; |
|
2305 | 2305 | } |
2306 | - $new_abs_path = realpath($dir . $source); |
|
2306 | + $new_abs_path = realpath($dir.$source); |
|
2307 | 2307 | $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1); |
2308 | 2308 | if (count($in_files_list) > 0) { |
2309 | 2309 | $files_list = array_merge($files_list, $in_files_list); |
@@ -2337,9 +2337,9 @@ discard block |
||
2337 | 2337 | $files_list[] = array($source, 'local', 'rel'); |
2338 | 2338 | $dir = ''; |
2339 | 2339 | if (!empty($abs_path)) { |
2340 | - $dir = dirname($abs_path) . '/'; |
|
2340 | + $dir = dirname($abs_path).'/'; |
|
2341 | 2341 | } |
2342 | - $new_abs_path = realpath($dir . $source); |
|
2342 | + $new_abs_path = realpath($dir.$source); |
|
2343 | 2343 | $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1); |
2344 | 2344 | if (count($in_files_list) > 0) { |
2345 | 2345 | $files_list = array_merge($files_list, $in_files_list); |
@@ -2352,9 +2352,9 @@ discard block |
||
2352 | 2352 | $files_list[] = array($source, 'local', 'rel'); |
2353 | 2353 | $dir = ''; |
2354 | 2354 | if (!empty($abs_path)) { |
2355 | - $dir = dirname($abs_path) . '/'; |
|
2355 | + $dir = dirname($abs_path).'/'; |
|
2356 | 2356 | } |
2357 | - $new_abs_path = realpath($dir . $source); |
|
2357 | + $new_abs_path = realpath($dir.$source); |
|
2358 | 2358 | $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1); |
2359 | 2359 | if (count($in_files_list) > 0) { |
2360 | 2360 | $files_list = array_merge($files_list, $in_files_list); |
@@ -2413,24 +2413,24 @@ discard block |
||
2413 | 2413 | // then possible closing brackets if we were in the opening bracket case |
2414 | 2414 | // OR something like @import() |
2415 | 2415 | $res = preg_match_all( |
2416 | - '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' . |
|
2416 | + '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'. |
|
2417 | 2417 | // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much |
2418 | 2418 | // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name |
2419 | - '([ \n\t\r]+)?(' . |
|
2419 | + '([ \n\t\r]+)?('. |
|
2420 | 2420 | // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself |
2421 | - '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' . |
|
2422 | - '|' . |
|
2421 | + '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'. |
|
2422 | + '|'. |
|
2423 | 2423 | // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself |
2424 | - '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' . |
|
2425 | - '))' . |
|
2426 | - '|' . |
|
2424 | + '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'. |
|
2425 | + '))'. |
|
2426 | + '|'. |
|
2427 | 2427 | // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities) |
2428 | 2428 | '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/', |
2429 | 2429 | $attrString, |
2430 | 2430 | $regs |
2431 | 2431 | ); |
2432 | 2432 | } catch (Exception $e) { |
2433 | - error_log('Caught exception: ' . $e->getMessage(), 0); |
|
2433 | + error_log('Caught exception: '.$e->getMessage(), 0); |
|
2434 | 2434 | } |
2435 | 2435 | if ($res) { |
2436 | 2436 | for ($i = 0; $i < count($regs[1]); $i++) { |
@@ -2508,14 +2508,14 @@ discard block |
||
2508 | 2508 | $orig_course_info_path = $origin_course_info_path; |
2509 | 2509 | } |
2510 | 2510 | } else { |
2511 | - $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/'; |
|
2511 | + $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/'; |
|
2512 | 2512 | $orig_course_info_path = $orig_course_info['path']; |
2513 | 2513 | } |
2514 | 2514 | |
2515 | 2515 | $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory); |
2516 | 2516 | $destination_course_info = api_get_course_info($destination_course_code); |
2517 | - $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/'; |
|
2518 | - $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/'; |
|
2517 | + $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/'; |
|
2518 | + $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/'; |
|
2519 | 2519 | |
2520 | 2520 | $user_id = api_get_user_id(); |
2521 | 2521 | |
@@ -2524,7 +2524,7 @@ discard block |
||
2524 | 2524 | |
2525 | 2525 | // Get information about source url |
2526 | 2526 | $real_orig_url = $source[0]; // url |
2527 | - $scope_url = $source[1]; // scope (local, remote) |
|
2527 | + $scope_url = $source[1]; // scope (local, remote) |
|
2528 | 2528 | $type_url = $source[2]; // type (rel, abs, url) |
2529 | 2529 | |
2530 | 2530 | // Get path and query from origin url |
@@ -2536,7 +2536,7 @@ discard block |
||
2536 | 2536 | $dest_url_query = ''; |
2537 | 2537 | |
2538 | 2538 | if (!empty($real_orig_query)) { |
2539 | - $dest_url_query = '?' . $real_orig_query; |
|
2539 | + $dest_url_query = '?'.$real_orig_query; |
|
2540 | 2540 | if (strpos($dest_url_query, $origin_course_code) !== false) { |
2541 | 2541 | $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query); |
2542 | 2542 | } |
@@ -2617,7 +2617,7 @@ discard block |
||
2617 | 2617 | |
2618 | 2618 | //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query; |
2619 | 2619 | // See BT#7780 |
2620 | - $destination_url = $dest_course_path_rel . $document_file . $dest_url_query; |
|
2620 | + $destination_url = $dest_course_path_rel.$document_file.$dest_url_query; |
|
2621 | 2621 | |
2622 | 2622 | // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985 |
2623 | 2623 | if (strpos($real_orig_path, $origin_course_code) === false) { |
@@ -2652,14 +2652,14 @@ discard block |
||
2652 | 2652 | public function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path) |
2653 | 2653 | { |
2654 | 2654 | if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') { |
2655 | - $original = $original_path . $file_name; |
|
2655 | + $original = $original_path.$file_name; |
|
2656 | 2656 | } else { |
2657 | - $original = $original_path . '/' . $file_name; |
|
2657 | + $original = $original_path.'/'.$file_name; |
|
2658 | 2658 | } |
2659 | 2659 | if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') { |
2660 | - $destination = $destiny_path . $file_name; |
|
2660 | + $destination = $destiny_path.$file_name; |
|
2661 | 2661 | } else { |
2662 | - $destination = $destiny_path . '/' . $file_name; |
|
2662 | + $destination = $destiny_path.'/'.$file_name; |
|
2663 | 2663 | } |
2664 | 2664 | $original_count = count(explode('/', $original)); |
2665 | 2665 | $destination_count = count(explode('/', $destination)); |
@@ -2673,8 +2673,8 @@ discard block |
||
2673 | 2673 | $mode = 'inside'; |
2674 | 2674 | } |
2675 | 2675 | //We do not select the $original_path becayse the file was already moved |
2676 | - $content_html = file_get_contents($destiny_path . '/' . $file_name); |
|
2677 | - $destination_file = $destiny_path . '/' . $file_name; |
|
2676 | + $content_html = file_get_contents($destiny_path.'/'.$file_name); |
|
2677 | + $destination_file = $destiny_path.'/'.$file_name; |
|
2678 | 2678 | |
2679 | 2679 | $pre_original = strstr($original_path, 'document'); |
2680 | 2680 | $pre_destin = strstr($destiny_path, 'document'); |
@@ -2696,11 +2696,11 @@ discard block |
||
2696 | 2696 | } |
2697 | 2697 | |
2698 | 2698 | if ($pre_original != '') { |
2699 | - $pre_original = '..' . $pre_original . '/'; |
|
2699 | + $pre_original = '..'.$pre_original.'/'; |
|
2700 | 2700 | } |
2701 | 2701 | |
2702 | 2702 | if ($pre_destin != '') { |
2703 | - $pre_destin = '..' . $pre_destin . '/'; |
|
2703 | + $pre_destin = '..'.$pre_destin.'/'; |
|
2704 | 2704 | } |
2705 | 2705 | |
2706 | 2706 | $levels = explode('/', $pre_original); |
@@ -2718,7 +2718,7 @@ discard block |
||
2718 | 2718 | //echo '$count_pre_destination_levels '. $count_pre_destination_levels; |
2719 | 2719 | $pre_remove = ''; |
2720 | 2720 | for ($i = 1; $i <= $count_pre_destination_levels; $i++) { |
2721 | - $pre_remove .='..\/'; |
|
2721 | + $pre_remove .= '..\/'; |
|
2722 | 2722 | } |
2723 | 2723 | |
2724 | 2724 | $orig_source_html = DocumentManager::get_resources_from_source_html($content_html); |
@@ -2726,9 +2726,9 @@ discard block |
||
2726 | 2726 | foreach ($orig_source_html as $source) { |
2727 | 2727 | |
2728 | 2728 | // get information about source url |
2729 | - $real_orig_url = $source[0]; // url |
|
2730 | - $scope_url = $source[1]; // scope (local, remote) |
|
2731 | - $type_url = $source[2]; // tyle (rel, abs, url) |
|
2729 | + $real_orig_url = $source[0]; // url |
|
2730 | + $scope_url = $source[1]; // scope (local, remote) |
|
2731 | + $type_url = $source[2]; // tyle (rel, abs, url) |
|
2732 | 2732 | // Get path and query from origin url |
2733 | 2733 | $orig_parse_url = parse_url($real_orig_url); |
2734 | 2734 | $real_orig_path = $orig_parse_url['path']; |
@@ -2755,11 +2755,11 @@ discard block |
||
2755 | 2755 | $real_orig_url_temp = ''; |
2756 | 2756 | if ($mode == 'inside') { |
2757 | 2757 | $real_orig_url_temp = str_replace('../', '', $real_orig_url); |
2758 | - $destination_url = $link_to_add . $real_orig_url_temp; |
|
2758 | + $destination_url = $link_to_add.$real_orig_url_temp; |
|
2759 | 2759 | } else { |
2760 | 2760 | $real_orig_url_temp = $real_orig_url; |
2761 | 2761 | |
2762 | - $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1); |
|
2762 | + $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1); |
|
2763 | 2763 | } |
2764 | 2764 | if ($real_orig_url == $destination_url) { |
2765 | 2765 | //echo 'continue2'; |
@@ -2785,7 +2785,7 @@ discard block |
||
2785 | 2785 | { |
2786 | 2786 | $course_data = api_get_course_info($course_code); |
2787 | 2787 | $document_data = self::get_document_data_by_id($document_id, $course_code); |
2788 | - $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path']; |
|
2788 | + $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path']; |
|
2789 | 2789 | $pdf = new PDF('A4-L', 'L'); |
2790 | 2790 | $pdf->html_to_pdf($file_path, $document_data['title'], $course_code); |
2791 | 2791 | } |
@@ -2818,9 +2818,9 @@ discard block |
||
2818 | 2818 | ) { |
2819 | 2819 | $course_info = api_get_course_info(); |
2820 | 2820 | $sessionId = api_get_session_id(); |
2821 | - $course_dir = $course_info['path'] . '/document'; |
|
2821 | + $course_dir = $course_info['path'].'/document'; |
|
2822 | 2822 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
2823 | - $base_work_dir = $sys_course_path . $course_dir; |
|
2823 | + $base_work_dir = $sys_course_path.$course_dir; |
|
2824 | 2824 | |
2825 | 2825 | if (isset($files[$fileKey])) { |
2826 | 2826 | $upload_ok = process_uploaded_file($files[$fileKey], $show_output); |
@@ -3007,7 +3007,7 @@ discard block |
||
3007 | 3007 | } |
3008 | 3008 | if (isset($output)) { |
3009 | 3009 | foreach ($output as & $line) { |
3010 | - $content .= $line . "\n"; |
|
3010 | + $content .= $line."\n"; |
|
3011 | 3011 | } |
3012 | 3012 | return $content; |
3013 | 3013 | } else { |
@@ -3039,13 +3039,13 @@ discard block |
||
3039 | 3039 | $group_condition = null; |
3040 | 3040 | if (isset($group_id)) { |
3041 | 3041 | $group_id = intval($group_id); |
3042 | - $group_condition = " AND props.to_group_id='" . $group_id . "' "; |
|
3042 | + $group_condition = " AND props.to_group_id='".$group_id."' "; |
|
3043 | 3043 | } |
3044 | 3044 | |
3045 | 3045 | $session_condition = null; |
3046 | 3046 | if (isset($session_id)) { |
3047 | 3047 | $session_id = intval($session_id); |
3048 | - $session_condition = " AND props.session_id='" . $session_id . "' "; |
|
3048 | + $session_condition = " AND props.session_id='".$session_id."' "; |
|
3049 | 3049 | } |
3050 | 3050 | |
3051 | 3051 | $sql = "SELECT SUM(size) |
@@ -3055,7 +3055,7 @@ discard block |
||
3055 | 3055 | WHERE |
3056 | 3056 | props.c_id = $course_id AND |
3057 | 3057 | docs.c_id = $course_id AND |
3058 | - props.tool = '" . TOOL_DOCUMENT . "' AND |
|
3058 | + props.tool = '".TOOL_DOCUMENT."' AND |
|
3059 | 3059 | props.visibility <> 2 |
3060 | 3060 | $group_condition |
3061 | 3061 | $session_condition |
@@ -3078,8 +3078,8 @@ discard block |
||
3078 | 3078 | $course_quota_m = round($course_quota / 1048576); |
3079 | 3079 | $already_consumed_space_m = round($already_consumed_space / 1048576); |
3080 | 3080 | |
3081 | - $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />'; |
|
3082 | - $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />'; |
|
3081 | + $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />'; |
|
3082 | + $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />'; |
|
3083 | 3083 | |
3084 | 3084 | $percentage = round(($already_consumed_space / $course_quota * 100), 1); |
3085 | 3085 | |
@@ -3087,33 +3087,33 @@ discard block |
||
3087 | 3087 | |
3088 | 3088 | // Decide where to place percentage in graph |
3089 | 3089 | if ($percentage >= 50) { |
3090 | - $text_in_filled = ' ' . $other_percentage . '%'; |
|
3090 | + $text_in_filled = ' '.$other_percentage.'%'; |
|
3091 | 3091 | $text_in_unfilled = ''; |
3092 | 3092 | } else { |
3093 | - $text_in_unfilled = ' ' . $other_percentage . '%'; |
|
3093 | + $text_in_unfilled = ' '.$other_percentage.'%'; |
|
3094 | 3094 | $text_in_filled = ''; |
3095 | 3095 | } |
3096 | 3096 | |
3097 | 3097 | // Decide the background colour of the graph |
3098 | 3098 | if ($percentage < 65) { |
3099 | - $colour = '#00BB00'; // Safe - green |
|
3099 | + $colour = '#00BB00'; // Safe - green |
|
3100 | 3100 | } elseif ($percentage < 90) { |
3101 | - $colour = '#ffd400'; // Filling up - yelloworange |
|
3101 | + $colour = '#ffd400'; // Filling up - yelloworange |
|
3102 | 3102 | } else { |
3103 | - $colour = '#DD0000'; // Full - red |
|
3103 | + $colour = '#DD0000'; // Full - red |
|
3104 | 3104 | } |
3105 | 3105 | |
3106 | 3106 | // This is used for the table width: a table of only 100 pixels looks too small |
3107 | 3107 | $visual_percentage = 4 * $percentage; |
3108 | 3108 | $visual_other_percentage = 4 * $other_percentage; |
3109 | 3109 | |
3110 | - $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' . |
|
3111 | - get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />'; |
|
3110 | + $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'. |
|
3111 | + get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />'; |
|
3112 | 3112 | |
3113 | - $show_percentage = ' ' . $percentage . '%'; |
|
3114 | - $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\'' . api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/bg-header4.png\');" class="document-quota-bar">' . |
|
3115 | - '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;"> </div>' . |
|
3116 | - '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>'; |
|
3113 | + $show_percentage = ' '.$percentage.'%'; |
|
3114 | + $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\''.api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/bg-header4.png\');" class="document-quota-bar">'. |
|
3115 | + '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;"> </div>'. |
|
3116 | + '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>'; |
|
3117 | 3117 | echo $message; |
3118 | 3118 | } |
3119 | 3119 | |
@@ -3129,7 +3129,7 @@ discard block |
||
3129 | 3129 | $percentage = $already_consumed_space / $course_quota * 100; |
3130 | 3130 | $percentage = round($percentage, 1); |
3131 | 3131 | $message = get_lang('YouAreCurrentlyUsingXOfYourX'); |
3132 | - $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' '); |
|
3132 | + $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' '); |
|
3133 | 3133 | echo Display::div($message, array('id' => 'document_quota')); |
3134 | 3134 | } |
3135 | 3135 | |
@@ -3161,13 +3161,13 @@ discard block |
||
3161 | 3161 | */ |
3162 | 3162 | public static function generate_jplayer_jquery($params = array()) |
3163 | 3163 | { |
3164 | - $js_path = api_get_path(WEB_LIBRARY_PATH) . 'javascript/'; |
|
3164 | + $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; |
|
3165 | 3165 | |
3166 | 3166 | $js = ' |
3167 | - $("#jquery_jplayer_' . $params['count'] . '").jPlayer({ |
|
3167 | + $("#jquery_jplayer_' . $params['count'].'").jPlayer({ |
|
3168 | 3168 | ready: function() { |
3169 | 3169 | $(this).jPlayer("setMedia", { |
3170 | - ' . $params['extension'] . ' : "' . $params['url'] . '" |
|
3170 | + ' . $params['extension'].' : "'.$params['url'].'" |
|
3171 | 3171 | }); |
3172 | 3172 | }, |
3173 | 3173 | play: function() { // To avoid both jPlayers playing together. |
@@ -3175,12 +3175,12 @@ discard block |
||
3175 | 3175 | }, |
3176 | 3176 | //errorAlerts: true, |
3177 | 3177 | //warningAlerts: true, |
3178 | - swfPath: "' . $js_path . 'jquery-jplayer/jplayer/", |
|
3178 | + swfPath: "' . $js_path.'jquery-jplayer/jplayer/", |
|
3179 | 3179 | //supplied: "m4a, oga, mp3, ogg, wav", |
3180 | - supplied: "' . $params['extension'] . '", |
|
3180 | + supplied: "' . $params['extension'].'", |
|
3181 | 3181 | wmode: "window", |
3182 | 3182 | solution: "flash, html", // Do not change this setting |
3183 | - cssSelectorAncestor: "#jp_container_' . $params['count'] . '", |
|
3183 | + cssSelectorAncestor: "#jp_container_' . $params['count'].'", |
|
3184 | 3184 | }); ' . "\n\n"; |
3185 | 3185 | |
3186 | 3186 | return $js; |
@@ -3210,16 +3210,16 @@ discard block |
||
3210 | 3210 | } |
3211 | 3211 | |
3212 | 3212 | //Shows only the play button |
3213 | - $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div> |
|
3214 | - <div id="jp_container_' . $i . '" class="jp-audio"> |
|
3213 | + $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div> |
|
3214 | + <div id="jp_container_' . $i.'" class="jp-audio"> |
|
3215 | 3215 | <div class="jp-type-single"> |
3216 | 3216 | <div class="jp-gui jp-interface"> |
3217 | 3217 | <ul class="jp-controls"> |
3218 | 3218 | <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li> |
3219 | 3219 | <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li> |
3220 | - ' . $extra_controls . ' |
|
3220 | + ' . $extra_controls.' |
|
3221 | 3221 | </ul> |
3222 | - ' . $progress . ' |
|
3222 | + ' . $progress.' |
|
3223 | 3223 | </div> |
3224 | 3224 | </div> |
3225 | 3225 | </div>'; |
@@ -3272,8 +3272,8 @@ discard block |
||
3272 | 3272 | </div> |
3273 | 3273 | </div> |
3274 | 3274 | <div class="jp-no-solution"> |
3275 | - <span>' . get_lang('UpdateRequire') . '</span> |
|
3276 | - ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . ' |
|
3275 | + <span>' . get_lang('UpdateRequire').'</span> |
|
3276 | + ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").' |
|
3277 | 3277 | </div> |
3278 | 3278 | </div> |
3279 | 3279 | </div>'; |
@@ -3354,7 +3354,7 @@ discard block |
||
3354 | 3354 | |
3355 | 3355 | $add_folder_filter = null; |
3356 | 3356 | if (!empty($filter_by_folder)) { |
3357 | - $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'"; |
|
3357 | + $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'"; |
|
3358 | 3358 | } |
3359 | 3359 | |
3360 | 3360 | // If we are in LP display hidden folder https://support.chamilo.org/issues/6679 |
@@ -3389,7 +3389,7 @@ discard block |
||
3389 | 3389 | |
3390 | 3390 | $notLikeCondition = null; |
3391 | 3391 | for ($i = 1; $i <= $num; $i++) { |
3392 | - $repeat = str_repeat('/%', $i+1); |
|
3392 | + $repeat = str_repeat('/%', $i + 1); |
|
3393 | 3393 | $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' "; |
3394 | 3394 | } |
3395 | 3395 | |
@@ -3414,7 +3414,7 @@ discard block |
||
3414 | 3414 | ON (docs.id = last.ref AND docs.c_id = last.c_id) |
3415 | 3415 | WHERE |
3416 | 3416 | docs.path NOT LIKE '%_DELETED_%' AND |
3417 | - last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND |
|
3417 | + last.tool = '".TOOL_DOCUMENT."' $condition_session AND |
|
3418 | 3418 | (last.visibility = '1' $lp_visibility_condition) AND |
3419 | 3419 | last.visibility <> 2 AND |
3420 | 3420 | docs.c_id = {$course_info['real_id']} AND |
@@ -3444,7 +3444,7 @@ discard block |
||
3444 | 3444 | Display::url( |
3445 | 3445 | Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL), |
3446 | 3446 | ' javascript:void(0);', |
3447 | - array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div') |
|
3447 | + array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div') |
|
3448 | 3448 | ), |
3449 | 3449 | array('style' => 'position:absolute;right:10px') |
3450 | 3450 | ); |
@@ -3548,7 +3548,7 @@ discard block |
||
3548 | 3548 | $('#'+tempId).hide(); |
3549 | 3549 | } else { |
3550 | 3550 | image.addClass('open'); |
3551 | - image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "'); |
|
3551 | + image.attr('src', '" . Display::returnIconPath('nolines_minus.gif')."'); |
|
3552 | 3552 | $('#'+id).hide(); |
3553 | 3553 | $('#'+tempId).show(); |
3554 | 3554 | |
@@ -3595,7 +3595,7 @@ discard block |
||
3595 | 3595 | $target, |
3596 | 3596 | $overwrite_url |
3597 | 3597 | ) { |
3598 | - $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/'; |
|
3598 | + $img_sys_path = api_get_path(SYS_CODE_PATH).'img/'; |
|
3599 | 3599 | $web_code_path = api_get_path(WEB_CODE_PATH); |
3600 | 3600 | |
3601 | 3601 | $documentId = $resource['id']; |
@@ -3610,7 +3610,7 @@ discard block |
||
3610 | 3610 | // It's a file. |
3611 | 3611 | $icon = choose_image($path); |
3612 | 3612 | $position = strrpos($icon, '.'); |
3613 | - $icon = substr($icon, 0, $position) . '_small.gif'; |
|
3613 | + $icon = substr($icon, 0, $position).'_small.gif'; |
|
3614 | 3614 | $my_file_title = $resource['title']; |
3615 | 3615 | $visibility = $resource['visibility']; |
3616 | 3616 | |
@@ -3622,29 +3622,29 @@ discard block |
||
3622 | 3622 | // Show the "image name" not the filename of the image. |
3623 | 3623 | if ($lp_id) { |
3624 | 3624 | // LP URL |
3625 | - $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&action=add_item&type=' . TOOL_DOCUMENT . '&file=' . $documentId . '&lp_id=' . $lp_id; |
|
3625 | + $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&action=add_item&type='.TOOL_DOCUMENT.'&file='.$documentId.'&lp_id='.$lp_id; |
|
3626 | 3626 | if (!empty($overwrite_url)) { |
3627 | - $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.''; |
|
3627 | + $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.''; |
|
3628 | 3628 | } |
3629 | 3629 | } else { |
3630 | 3630 | // Direct document URL |
3631 | - $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId; |
|
3631 | + $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId; |
|
3632 | 3632 | if (!empty($overwrite_url)) { |
3633 | - $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId; |
|
3633 | + $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId; |
|
3634 | 3634 | } |
3635 | 3635 | } |
3636 | 3636 | |
3637 | 3637 | $img = Display::returnIconPath($icon); |
3638 | - if (!file_exists($img_sys_path . $icon)) { |
|
3638 | + if (!file_exists($img_sys_path.$icon)) { |
|
3639 | 3639 | $img = Display::returnIconPath('default_small.gif'); |
3640 | 3640 | } |
3641 | 3641 | |
3642 | 3642 | $link = Display::url( |
3643 | - '<img alt="" src="' . $img . '" title="" /> ' . $my_file_title, $url, |
|
3643 | + '<img alt="" src="'.$img.'" title="" /> '.$my_file_title, $url, |
|
3644 | 3644 | array('target' => $target, 'class' => 'moved') |
3645 | 3645 | ); |
3646 | 3646 | |
3647 | - $directUrl = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId; |
|
3647 | + $directUrl = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId; |
|
3648 | 3648 | |
3649 | 3649 | $link .= Display::url( |
3650 | 3650 | Display::return_icon('preview_view.png', get_lang('Preview')), |
@@ -3659,12 +3659,12 @@ discard block |
||
3659 | 3659 | $return = null; |
3660 | 3660 | |
3661 | 3661 | if ($lp_id == false) { |
3662 | - $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >'; |
|
3662 | + $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >'; |
|
3663 | 3663 | } else { |
3664 | - $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >'; |
|
3664 | + $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >'; |
|
3665 | 3665 | } |
3666 | 3666 | |
3667 | - $return .= '<div class="item_data" style="margin-left:' . ($num * 5 ) . 'px;margin-right:5px;">'; |
|
3667 | + $return .= '<div class="item_data" style="margin-left:'.($num * 5).'px;margin-right:5px;">'; |
|
3668 | 3668 | |
3669 | 3669 | if ($add_move_button) { |
3670 | 3670 | $return .= '<a class="moved" href="#">'; |
@@ -3729,7 +3729,7 @@ discard block |
||
3729 | 3729 | if (isset($resource['visible']) && $resource['visible'] == 0) { |
3730 | 3730 | $folder_class_hidden = "doc_folder_hidden"; // in base.css |
3731 | 3731 | } |
3732 | - $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"'; |
|
3732 | + $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"'; |
|
3733 | 3733 | } |
3734 | 3734 | $return = null; |
3735 | 3735 | |
@@ -3737,22 +3737,22 @@ discard block |
||
3737 | 3737 | $return = '<ul class="lp_resource">'; |
3738 | 3738 | } |
3739 | 3739 | |
3740 | - $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '" style="margin-left:' . ($num * 18) . 'px; ">'; |
|
3740 | + $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'" style="margin-left:'.($num * 18).'px; ">'; |
|
3741 | 3741 | |
3742 | 3742 | $image = Display::returnIconPath('nolines_plus.gif'); |
3743 | 3743 | if (empty($path)) { |
3744 | 3744 | $image = Display::returnIconPath('nolines_minus.gif'); |
3745 | 3745 | } |
3746 | - $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>'; |
|
3746 | + $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>'; |
|
3747 | 3747 | $return .= Display::return_icon('lp_folder.gif').' '; |
3748 | 3748 | $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>'; |
3749 | 3749 | $return .= '</li>'; |
3750 | 3750 | |
3751 | 3751 | if (empty($path)) { |
3752 | 3752 | if ($folderId == false) { |
3753 | - $return .= '<div id="res_' . $resource['id'] . '" >'; |
|
3753 | + $return .= '<div id="res_'.$resource['id'].'" >'; |
|
3754 | 3754 | } else { |
3755 | - $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >'; |
|
3755 | + $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >'; |
|
3756 | 3756 | } |
3757 | 3757 | } |
3758 | 3758 | |
@@ -3914,9 +3914,9 @@ discard block |
||
3914 | 3914 | $session_id = api_get_session_id(); |
3915 | 3915 | } |
3916 | 3916 | $course_info = api_get_course_info($course_code); |
3917 | - $course_dir = $course_info['path'] . '/document'; |
|
3917 | + $course_dir = $course_info['path'].'/document'; |
|
3918 | 3918 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
3919 | - $base_work_dir = $sys_course_path . $course_dir; |
|
3919 | + $base_work_dir = $sys_course_path.$course_dir; |
|
3920 | 3920 | |
3921 | 3921 | $course_id = $course_info['real_id']; |
3922 | 3922 | $table_document = Database::get_course_table(TABLE_DOCUMENT); |
@@ -3925,7 +3925,7 @@ discard block |
||
3925 | 3925 | $result = Database::query($qry); |
3926 | 3926 | if (Database::num_rows($result) == 1) { |
3927 | 3927 | $row = Database::fetch_array($result); |
3928 | - $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path']; |
|
3928 | + $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path']; |
|
3929 | 3929 | //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0 |
3930 | 3930 | // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while |
3931 | 3931 | $doc_mime = mime_content_type($doc_path); |
@@ -3956,8 +3956,8 @@ discard block |
||
3956 | 3956 | $file_content = self::get_text_content($doc_path, $doc_mime); |
3957 | 3957 | $course_code = Database::escape_string($course_code); |
3958 | 3958 | |
3959 | - require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
3960 | - require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php'; |
|
3959 | + require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
3960 | + require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php'; |
|
3961 | 3961 | |
3962 | 3962 | $ic_slide = new IndexableChunk(); |
3963 | 3963 | $ic_slide->addValue('title', $file_title); |
@@ -3974,7 +3974,7 @@ discard block |
||
3974 | 3974 | $di = new ChamiloIndexer(); |
3975 | 3975 | $return = $di->connectDb(null, null, $lang); |
3976 | 3976 | |
3977 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
3977 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
3978 | 3978 | $specific_fields = get_specific_field_list(); |
3979 | 3979 | |
3980 | 3980 | // process different depending on what to do if file exists |
@@ -4011,7 +4011,7 @@ discard block |
||
4011 | 4011 | } else { //if the specific field is not defined, force an empty one |
4012 | 4012 | $sterms = ''; |
4013 | 4013 | } |
4014 | - $all_specific_terms .= ' ' . $sterms; |
|
4014 | + $all_specific_terms .= ' '.$sterms; |
|
4015 | 4015 | $sterms = explode(',', $sterms); |
4016 | 4016 | foreach ($sterms as $sterm) { |
4017 | 4017 | $sterm = trim($sterm); |
@@ -4025,7 +4025,7 @@ discard block |
||
4025 | 4025 | } |
4026 | 4026 | } |
4027 | 4027 | // Add terms also to content to make terms findable by probabilistic search |
4028 | - $file_content = $all_specific_terms . ' ' . $file_content; |
|
4028 | + $file_content = $all_specific_terms.' '.$file_content; |
|
4029 | 4029 | |
4030 | 4030 | if (!$simulation) { |
4031 | 4031 | $ic_slide->addValue('content', $file_content); |
@@ -4051,7 +4051,7 @@ discard block |
||
4051 | 4051 | } else { //if the specific field is not defined, force an empty one |
4052 | 4052 | $sterms = ''; |
4053 | 4053 | } |
4054 | - $all_specific_terms .= ' ' . $sterms; |
|
4054 | + $all_specific_terms .= ' '.$sterms; |
|
4055 | 4055 | if (!empty($sterms)) { |
4056 | 4056 | $sterms = explode(',', $sterms); |
4057 | 4057 | foreach ($sterms as $sterm) { |
@@ -4063,7 +4063,7 @@ discard block |
||
4063 | 4063 | } |
4064 | 4064 | } |
4065 | 4065 | // Add terms also to content to make terms findable by probabilistic search |
4066 | - $file_content = $all_specific_terms . ' ' . $file_content; |
|
4066 | + $file_content = $all_specific_terms.' '.$file_content; |
|
4067 | 4067 | if (!$simulation) { |
4068 | 4068 | $ic_slide->addValue('content', $file_content); |
4069 | 4069 | $di->addChunk($ic_slide); |
@@ -4346,7 +4346,7 @@ discard block |
||
4346 | 4346 | $defaultVisibility = 'visible'; |
4347 | 4347 | |
4348 | 4348 | if (isset($settings['documents'])) { |
4349 | - $portalDefaultVisibility = 'invisible'; |
|
4349 | + $portalDefaultVisibility = 'invisible'; |
|
4350 | 4350 | if ($settings['documents'] == 'true') { |
4351 | 4351 | $portalDefaultVisibility = 'visible'; |
4352 | 4352 | } |
@@ -4585,7 +4585,7 @@ discard block |
||
4585 | 4585 | //make htaccess with allow from all, and file index.html into temp/audio |
4586 | 4586 | $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess'; |
4587 | 4587 | if (!file_exists($htaccess)) { |
4588 | - $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes"; |
|
4588 | + $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes"; |
|
4589 | 4589 | $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w'); |
4590 | 4590 | if ($fp) { |
4591 | 4591 | fwrite($fp, $htaccess_content); |
@@ -4594,9 +4594,9 @@ discard block |
||
4594 | 4594 | } |
4595 | 4595 | |
4596 | 4596 | //encript temp name file |
4597 | - $name_crip = sha1(uniqid());//encript |
|
4598 | - $findext= explode(".", $file); |
|
4599 | - $extension = $findext[count($findext)-1]; |
|
4597 | + $name_crip = sha1(uniqid()); //encript |
|
4598 | + $findext = explode(".", $file); |
|
4599 | + $extension = $findext[count($findext) - 1]; |
|
4600 | 4600 | $file_crip = $name_crip.'.'.$extension; |
4601 | 4601 | |
4602 | 4602 | //copy file to temp/audio directory |
@@ -4700,7 +4700,7 @@ discard block |
||
4700 | 4700 | $comment = null; |
4701 | 4701 | |
4702 | 4702 | $fileName = api_replace_dangerous_char($title); |
4703 | - $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}"; |
|
4703 | + $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}"; |
|
4704 | 4704 | $fileFullPath = "{$filePath}/{$fileName}.html"; |
4705 | 4705 | $fileSize = 0; |
4706 | 4706 | $fileType = 'file'; |
@@ -4752,7 +4752,7 @@ discard block |
||
4752 | 4752 | $fileSize, |
4753 | 4753 | $title, |
4754 | 4754 | $comment, |
4755 | - 0,//$readonly = 0, |
|
4755 | + 0, //$readonly = 0, |
|
4756 | 4756 | true, //$save_visibility = true, |
4757 | 4757 | null, //$group_id = null, |
4758 | 4758 | $sessionId |
@@ -5038,8 +5038,8 @@ discard block |
||
5038 | 5038 | $sessionId, |
5039 | 5039 | $groupId |
5040 | 5040 | )) { |
5041 | - $uniqueName = self::addSuffixToFileName($name, '_' . $counter); |
|
5042 | - $filePath = $path . $uniqueName; |
|
5041 | + $uniqueName = self::addSuffixToFileName($name, '_'.$counter); |
|
5042 | + $filePath = $path.$uniqueName; |
|
5043 | 5043 | $counter++; |
5044 | 5044 | } |
5045 | 5045 | |
@@ -5078,7 +5078,7 @@ discard block |
||
5078 | 5078 | $folder_sql = implode("','", $escaped_folders); |
5079 | 5079 | |
5080 | 5080 | $sql = "SELECT * FROM $doc_table |
5081 | - WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('" . $folder_sql . "')"; |
|
5081 | + WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('".$folder_sql."')"; |
|
5082 | 5082 | $res = Database::query($sql); |
5083 | 5083 | $folder_titles = array(); |
5084 | 5084 | while ($obj = Database::fetch_object($res)) { |
@@ -5115,9 +5115,9 @@ discard block |
||
5115 | 5115 | $folder_titles[$folder] = cut($folder_titles[$folder], 80); |
5116 | 5116 | $counter = count($path_parts) - 2; |
5117 | 5117 | if ($counter > 0) { |
5118 | - $label = str_repeat(' ', $counter) . ' — ' . $folder_titles[$folder]; |
|
5118 | + $label = str_repeat(' ', $counter).' — '.$folder_titles[$folder]; |
|
5119 | 5119 | } else { |
5120 | - $label = ' — ' . $folder_titles[$folder]; |
|
5120 | + $label = ' — '.$folder_titles[$folder]; |
|
5121 | 5121 | } |
5122 | 5122 | $parent_select->addOption($label, $folder_id); |
5123 | 5123 | if ($selected != '') { |
@@ -5135,7 +5135,7 @@ discard block |
||
5135 | 5135 | } else { |
5136 | 5136 | $path_parts = explode('/', str_replace($group_dir, '', $folder)); |
5137 | 5137 | $label = cut($label, 80); |
5138 | - $label = str_repeat(' ', count($path_parts) - 2) . ' — ' . $label; |
|
5138 | + $label = str_repeat(' ', count($path_parts) - 2).' — '.$label; |
|
5139 | 5139 | } |
5140 | 5140 | $parent_select->addOption($label, $folder_id); |
5141 | 5141 | if ($selected != '') { |
@@ -5168,7 +5168,7 @@ discard block |
||
5168 | 5168 | ) { |
5169 | 5169 | global $dbl_click_id; |
5170 | 5170 | $course_info = api_get_course_info(); |
5171 | - $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document'; |
|
5171 | + $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document'; |
|
5172 | 5172 | $webOdflist = DocumentManager::get_web_odf_extension_list(); |
5173 | 5173 | |
5174 | 5174 | // Get the title or the basename depending on what we're using |
@@ -5192,11 +5192,11 @@ discard block |
||
5192 | 5192 | |
5193 | 5193 | if (!$show_as_icon) { |
5194 | 5194 | // Build download link (icon) |
5195 | - $forcedownload_link = ($filetype == 'folder') ? api_get_self() . '?' . api_get_cidreq() . '&action=downloadfolder&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq() . '&action=download&id=' . $document_data['id']; |
|
5195 | + $forcedownload_link = ($filetype == 'folder') ? api_get_self().'?'.api_get_cidreq().'&action=downloadfolder&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq().'&action=download&id='.$document_data['id']; |
|
5196 | 5196 | // Folder download or file download? |
5197 | 5197 | $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png'; |
5198 | 5198 | // Prevent multiple clicks on zipped folder download |
5199 | - $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_" . ($dbl_click_id++) . "=false;',10000); } else { return false; }\"" : ''; |
|
5199 | + $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_".($dbl_click_id++)."=false;',10000); } else { return false; }\"" : ''; |
|
5200 | 5200 | } |
5201 | 5201 | |
5202 | 5202 | $target = '_self'; |
@@ -5212,17 +5212,17 @@ discard block |
||
5212 | 5212 | |
5213 | 5213 | if ($is_browser_viewable_file) { |
5214 | 5214 | if ($ext == 'pdf' || in_array($ext, $webOdflist)) { |
5215 | - $url = api_get_self() . '?' . api_get_cidreq() . '&action=download&id=' . $document_data['id']; |
|
5215 | + $url = api_get_self().'?'.api_get_cidreq().'&action=download&id='.$document_data['id']; |
|
5216 | 5216 | } else { |
5217 | - $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; |
|
5217 | + $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; |
|
5218 | 5218 | } |
5219 | 5219 | } else { |
5220 | 5220 | // url-encode for problematic characters (we may not call them dangerous characters...) |
5221 | - $path = str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq(); |
|
5222 | - $url = $www . $path; |
|
5221 | + $path = str_replace('%2F', '/', $url_path).'?'.api_get_cidreq(); |
|
5222 | + $url = $www.$path; |
|
5223 | 5223 | } |
5224 | 5224 | } else { |
5225 | - $url = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_data['id']; |
|
5225 | + $url = api_get_self().'?'.api_get_cidreq().'&id='.$document_data['id']; |
|
5226 | 5226 | } |
5227 | 5227 | |
5228 | 5228 | // The little download icon |
@@ -5232,10 +5232,10 @@ discard block |
||
5232 | 5232 | if ($path == '/shared_folder') { |
5233 | 5233 | $tooltip_title_alt = get_lang('UserFolders'); |
5234 | 5234 | } elseif (strstr($path, 'shared_folder_session_')) { |
5235 | - $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')'; |
|
5235 | + $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')'; |
|
5236 | 5236 | } elseif (strstr($tooltip_title, 'sf_user_')) { |
5237 | 5237 | $userinfo = api_get_user_info(substr($tooltip_title, 8)); |
5238 | - $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name']; |
|
5238 | + $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name']; |
|
5239 | 5239 | } elseif ($path == '/chat_files') { |
5240 | 5240 | $tooltip_title_alt = get_lang('ChatFiles'); |
5241 | 5241 | } elseif ($path == '/learning_path') { |
@@ -5267,24 +5267,24 @@ discard block |
||
5267 | 5267 | ) { |
5268 | 5268 | //filter when I am into shared folder, I can show for donwload only my shared folder |
5269 | 5269 | if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) { |
5270 | - if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) || |
|
5271 | - preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) || |
|
5270 | + if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) || |
|
5271 | + preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) || |
|
5272 | 5272 | api_is_allowed_to_edit() || api_is_platform_admin() |
5273 | 5273 | ) { |
5274 | - $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' . |
|
5275 | - Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5274 | + $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'. |
|
5275 | + Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5276 | 5276 | } |
5277 | 5277 | } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) || |
5278 | 5278 | api_is_allowed_to_edit() || |
5279 | 5279 | api_is_platform_admin() |
5280 | 5280 | ) { |
5281 | - $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' . |
|
5282 | - Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5281 | + $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'. |
|
5282 | + Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5283 | 5283 | } |
5284 | 5284 | } |
5285 | 5285 | } else { |
5286 | - $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' . |
|
5287 | - Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5286 | + $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'. |
|
5287 | + Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5288 | 5288 | } |
5289 | 5289 | |
5290 | 5290 | // Copy files to users myfiles |
@@ -5292,12 +5292,12 @@ discard block |
||
5292 | 5292 | api_get_setting('users_copy_files') === 'true' && |
5293 | 5293 | !api_is_anonymous() |
5294 | 5294 | ) { |
5295 | - $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq(); |
|
5295 | + $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq(); |
|
5296 | 5296 | |
5297 | 5297 | if ($filetype == 'file') { |
5298 | 5298 | |
5299 | - $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' . |
|
5300 | - Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . ' </a>'; |
|
5299 | + $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'. |
|
5300 | + Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).' </a>'; |
|
5301 | 5301 | |
5302 | 5302 | if (api_get_setting('allow_my_files') === 'false') { |
5303 | 5303 | $copy_to_myfiles = ''; |
@@ -5316,13 +5316,13 @@ discard block |
||
5316 | 5316 | $filetype == 'file' && |
5317 | 5317 | in_array($extension, array('html', 'htm')) |
5318 | 5318 | ) { |
5319 | - $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' . |
|
5320 | - Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> '; |
|
5319 | + $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$document_data['id'].'">'. |
|
5320 | + Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> '; |
|
5321 | 5321 | } |
5322 | 5322 | |
5323 | 5323 | if ($is_browser_viewable_file) { |
5324 | - $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' . |
|
5325 | - Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . ' </a>'; |
|
5324 | + $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.api_get_cidreq().'" style="float:right"'.$prevent_multiple_click.' target="_blank">'. |
|
5325 | + Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).' </a>'; |
|
5326 | 5326 | } |
5327 | 5327 | |
5328 | 5328 | if ($filetype == 'file') { |
@@ -5331,9 +5331,9 @@ discard block |
||
5331 | 5331 | (preg_match('/wav$/i', urldecode($checkExtension))) || |
5332 | 5332 | preg_match('/ogg$/i', urldecode($checkExtension)) |
5333 | 5333 | ) { |
5334 | - return '<span style="float:left" ' . $visibility_class . '>' . |
|
5335 | - $title . |
|
5336 | - '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon; |
|
5334 | + return '<span style="float:left" '.$visibility_class.'>'. |
|
5335 | + $title. |
|
5336 | + '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; |
|
5337 | 5337 | } elseif ( |
5338 | 5338 | |
5339 | 5339 | // Show preview |
@@ -5346,7 +5346,7 @@ discard block |
||
5346 | 5346 | preg_match('/svg$/i', urldecode($checkExtension)) |
5347 | 5347 | ) { |
5348 | 5348 | // Simpler version of showinframesmin.php with no headers |
5349 | - $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id']; |
|
5349 | + $url = 'show_content.php?'.api_get_cidreq().'&id='.$document_data['id']; |
|
5350 | 5350 | $class = 'ajax'; |
5351 | 5351 | if ($visibility == false) { |
5352 | 5352 | $class = "ajax invisible"; |
@@ -5361,34 +5361,34 @@ discard block |
||
5361 | 5361 | 'style' => 'float: left;' |
5362 | 5362 | ] |
5363 | 5363 | ) |
5364 | - . $force_download_html . $send_to . $copy_to_myfiles |
|
5365 | - . $open_in_new_window_link . $pdf_icon; |
|
5364 | + . $force_download_html.$send_to.$copy_to_myfiles |
|
5365 | + . $open_in_new_window_link.$pdf_icon; |
|
5366 | 5366 | } else { |
5367 | 5367 | // For PDF Download the file. |
5368 | 5368 | $pdfPreview = null; |
5369 | 5369 | if ($ext != 'pdf' && !in_array($ext, $webOdflist)) { |
5370 | - $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; |
|
5370 | + $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; |
|
5371 | 5371 | } else { |
5372 | 5372 | $pdfPreview = Display::url( |
5373 | 5373 | Display::return_icon('preview.gif', get_lang('Preview')), |
5374 | - api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'], |
|
5374 | + api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'], |
|
5375 | 5375 | array('style' => 'float:right') |
5376 | 5376 | ); |
5377 | 5377 | } |
5378 | 5378 | // No plugin just the old and good showinframes.php page |
5379 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' . |
|
5380 | - $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon; |
|
5379 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'. |
|
5380 | + $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; |
|
5381 | 5381 | } |
5382 | 5382 | } else { |
5383 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' . |
|
5384 | - $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon; |
|
5383 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'. |
|
5384 | + $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; |
|
5385 | 5385 | } |
5386 | 5386 | // end copy files to users myfiles |
5387 | 5387 | } else { |
5388 | 5388 | // Icon column |
5389 | 5389 | if (preg_match('/shared_folder/', urldecode($checkExtension)) && |
5390 | 5390 | preg_match('/shared_folder$/', urldecode($checkExtension)) == false && |
5391 | - preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false |
|
5391 | + preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false |
|
5392 | 5392 | ) { |
5393 | 5393 | if ($filetype == 'file') { |
5394 | 5394 | //Sound preview with jplayer |
@@ -5408,19 +5408,19 @@ discard block |
||
5408 | 5408 | preg_match('/bmp$/i', urldecode($checkExtension)) || |
5409 | 5409 | preg_match('/svg$/i', urldecode($checkExtension)) |
5410 | 5410 | ) { |
5411 | - $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; |
|
5412 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . |
|
5413 | - DocumentManager::build_document_icon_tag($filetype, $path) . |
|
5414 | - Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>'; |
|
5411 | + $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; |
|
5412 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'. |
|
5413 | + DocumentManager::build_document_icon_tag($filetype, $path). |
|
5414 | + Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>'; |
|
5415 | 5415 | } else { |
5416 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . |
|
5417 | - DocumentManager::build_document_icon_tag($filetype, $path) . |
|
5418 | - Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>'; |
|
5416 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'. |
|
5417 | + DocumentManager::build_document_icon_tag($filetype, $path). |
|
5418 | + Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>'; |
|
5419 | 5419 | } |
5420 | 5420 | } else { |
5421 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' . |
|
5422 | - DocumentManager::build_document_icon_tag($filetype, $path) . |
|
5423 | - Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>'; |
|
5421 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'. |
|
5422 | + DocumentManager::build_document_icon_tag($filetype, $path). |
|
5423 | + Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>'; |
|
5424 | 5424 | } |
5425 | 5425 | } else { |
5426 | 5426 | if ($filetype == 'file') { |
@@ -5443,16 +5443,16 @@ discard block |
||
5443 | 5443 | preg_match('/bmp$/i', urldecode($checkExtension)) || |
5444 | 5444 | preg_match('/svg$/i', urldecode($checkExtension)) |
5445 | 5445 | ) { |
5446 | - $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; //without preview |
|
5447 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . |
|
5448 | - DocumentManager::build_document_icon_tag($filetype, $path) . '</a>'; |
|
5446 | + $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; //without preview |
|
5447 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'. |
|
5448 | + DocumentManager::build_document_icon_tag($filetype, $path).'</a>'; |
|
5449 | 5449 | } else { |
5450 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . |
|
5451 | - DocumentManager::build_document_icon_tag($filetype, $path) . '</a>'; |
|
5450 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'. |
|
5451 | + DocumentManager::build_document_icon_tag($filetype, $path).'</a>'; |
|
5452 | 5452 | } |
5453 | 5453 | } else { |
5454 | - return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' . |
|
5455 | - DocumentManager::build_document_icon_tag($filetype, $path) . '</a>'; |
|
5454 | + return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'. |
|
5455 | + DocumentManager::build_document_icon_tag($filetype, $path).'</a>'; |
|
5456 | 5456 | } |
5457 | 5457 | } |
5458 | 5458 | } |
@@ -5487,13 +5487,13 @@ discard block |
||
5487 | 5487 | $userinfo = api_get_user_info(substr($basename, 8)); |
5488 | 5488 | $icon = $userinfo['avatar_small']; |
5489 | 5489 | |
5490 | - $basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name']; |
|
5490 | + $basename = get_lang('UserFolder').' '.$userinfo['complete_name']; |
|
5491 | 5491 | $user_image = true; |
5492 | 5492 | } elseif (strstr($path, 'shared_folder_session_')) { |
5493 | 5493 | if ($is_allowed_to_edit) { |
5494 | - $basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder'); |
|
5494 | + $basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder'); |
|
5495 | 5495 | } else { |
5496 | - $basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')'; |
|
5496 | + $basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')'; |
|
5497 | 5497 | } |
5498 | 5498 | $icon = 'folder_users.gif'; |
5499 | 5499 | } else { |
@@ -5587,16 +5587,16 @@ discard block |
||
5587 | 5587 | // Build URL-parameters for table-sorting |
5588 | 5588 | $sort_params = array(); |
5589 | 5589 | if (isset($_GET['column'])) { |
5590 | - $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']); |
|
5590 | + $sort_params[] = 'column='.Security::remove_XSS($_GET['column']); |
|
5591 | 5591 | } |
5592 | 5592 | if (isset($_GET['page_nr'])) { |
5593 | - $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']); |
|
5593 | + $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']); |
|
5594 | 5594 | } |
5595 | 5595 | if (isset($_GET['per_page'])) { |
5596 | - $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']); |
|
5596 | + $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']); |
|
5597 | 5597 | } |
5598 | 5598 | if (isset($_GET['direction'])) { |
5599 | - $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']); |
|
5599 | + $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']); |
|
5600 | 5600 | } |
5601 | 5601 | $sort_params = implode('&', $sort_params); |
5602 | 5602 | $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible'; |
@@ -5609,89 +5609,89 @@ discard block |
||
5609 | 5609 | if ($is_read_only /* or ($session_id!=api_get_session_id()) */) { |
5610 | 5610 | if (api_is_course_admin() || api_is_platform_admin()) { |
5611 | 5611 | if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') { |
5612 | - $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5613 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5614 | - } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) { |
|
5615 | - $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5616 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5612 | + $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5613 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5614 | + } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) { |
|
5615 | + $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5616 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5617 | 5617 | } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') { |
5618 | - $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5619 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5618 | + $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5619 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5620 | 5620 | } else { |
5621 | - $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id. '">' . |
|
5622 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5621 | + $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5622 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5623 | 5623 | } |
5624 | 5624 | } else { |
5625 | 5625 | $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
5626 | 5626 | } |
5627 | - $modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL); |
|
5627 | + $modify_icons .= ' '.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL); |
|
5628 | 5628 | if (api_is_allowed_to_edit() || api_is_platform_admin()) { |
5629 | - $modify_icons .= ' ' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL); |
|
5629 | + $modify_icons .= ' '.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL); |
|
5630 | 5630 | } |
5631 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL); |
|
5631 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL); |
|
5632 | 5632 | } else { |
5633 | 5633 | //Edit button |
5634 | 5634 | if (in_array($path, DocumentManager::get_system_folders())) { |
5635 | 5635 | $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
5636 | - } elseif ($is_certificate_mode ) { |
|
5636 | + } elseif ($is_certificate_mode) { |
|
5637 | 5637 | // gradebook category doesn't seem to be taken into account |
5638 | - $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5638 | + $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&curdirpath=/certificates">'.Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5639 | 5639 | } else { |
5640 | 5640 | if (api_get_session_id()) { |
5641 | 5641 | if ($document_data['session_id'] == api_get_session_id()) { |
5642 | 5642 | if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') { |
5643 | - $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5644 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5645 | - } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) { |
|
5646 | - $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5647 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5643 | + $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5644 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5645 | + } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) { |
|
5646 | + $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5647 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5648 | 5648 | } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') { |
5649 | - $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5650 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5649 | + $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5650 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5651 | 5651 | } else { |
5652 | - $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5653 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5652 | + $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5653 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5654 | 5654 | } |
5655 | 5655 | } else { |
5656 | - $modify_icons .= ' ' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5656 | + $modify_icons .= ' '.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5657 | 5657 | } |
5658 | 5658 | } else { |
5659 | 5659 | if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') { |
5660 | - $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5661 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5662 | - } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) { |
|
5663 | - $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5664 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5660 | + $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5661 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5662 | + } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) { |
|
5663 | + $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5664 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5665 | 5665 | } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') { |
5666 | - $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5667 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5666 | + $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5667 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5668 | 5668 | } else { |
5669 | - $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id . '">' . |
|
5670 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5669 | + $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'. |
|
5670 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
5671 | 5671 | } |
5672 | 5672 | } |
5673 | 5673 | } |
5674 | 5674 | |
5675 | 5675 | // Move button. |
5676 | 5676 | if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) { |
5677 | - $modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5677 | + $modify_icons .= ' '.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5678 | 5678 | } else { |
5679 | 5679 | if (api_get_session_id()) { |
5680 | 5680 | if ($document_data['session_id'] == api_get_session_id()) { |
5681 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&move=' . $document_id . '">' . |
|
5682 | - Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5681 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$parent_id.'&move='.$document_id.'">'. |
|
5682 | + Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5683 | 5683 | } else { |
5684 | - $modify_icons .= ' ' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5684 | + $modify_icons .= ' '.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5685 | 5685 | } |
5686 | 5686 | } else { |
5687 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&move=' . $document_id . '">' . |
|
5688 | - Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5687 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$parent_id.'&move='.$document_id.'">'. |
|
5688 | + Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5689 | 5689 | } |
5690 | 5690 | } |
5691 | 5691 | |
5692 | 5692 | //Visibility button |
5693 | 5693 | if ($is_certificate_mode) { |
5694 | - $modify_icons .= ' ' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5694 | + $modify_icons .= ' '.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5695 | 5695 | } else { |
5696 | 5696 | if (api_is_allowed_to_edit() || api_is_platform_admin()) { |
5697 | 5697 | if ($visibility_icon == 'invisible') { |
@@ -5699,14 +5699,14 @@ discard block |
||
5699 | 5699 | } else { |
5700 | 5700 | $tip_visibility = get_lang('Hide'); |
5701 | 5701 | } |
5702 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&id=' . $parent_id . '&' . $visibility_command . '=' . $id . '&' . $sort_params . '">' . |
|
5703 | - Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>'; |
|
5702 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$parent_id.'&'.$visibility_command.'='.$id.'&'.$sort_params.'">'. |
|
5703 | + Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>'; |
|
5704 | 5704 | } |
5705 | 5705 | } |
5706 | 5706 | |
5707 | 5707 | // Delete button |
5708 | 5708 | if (in_array($path, DocumentManager::get_system_folders())) { |
5709 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL); |
|
5709 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL); |
|
5710 | 5710 | } else { |
5711 | 5711 | $titleToShow = addslashes(basename($document_data['title'])); |
5712 | 5712 | |
@@ -5714,23 +5714,23 @@ discard block |
||
5714 | 5714 | $_GET['curdirpath'] == '/certificates' && |
5715 | 5715 | DocumentManager::get_default_certificate_id(api_get_course_id()) == $id |
5716 | 5716 | ) { |
5717 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . $titleToShow . '\');">' . |
|
5718 | - Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5717 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&'.$sort_params.'delete_certificate_id='.$id.'" onclick="return confirmation(\''.$titleToShow.'\');">'. |
|
5718 | + Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5719 | 5719 | } else { |
5720 | 5720 | if ($is_certificate_mode) { |
5721 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid=' . $document_id . '&' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' . |
|
5722 | - Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5721 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'. |
|
5722 | + Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5723 | 5723 | } else { |
5724 | 5724 | if (api_get_session_id()) { |
5725 | 5725 | if ($document_data['session_id'] == api_get_session_id()) { |
5726 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . '&' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">'. |
|
5727 | - Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5726 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'. |
|
5727 | + Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5728 | 5728 | } else { |
5729 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL); |
|
5729 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL); |
|
5730 | 5730 | } |
5731 | 5731 | } else { |
5732 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . '&' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow. '\');">' . |
|
5733 | - Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5732 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'. |
|
5733 | + Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5734 | 5734 | } |
5735 | 5735 | } |
5736 | 5736 | } |
@@ -5742,15 +5742,15 @@ discard block |
||
5742 | 5742 | // nothing to do |
5743 | 5743 | } else { |
5744 | 5744 | if ($usePpt2lp && $formatType) { |
5745 | - $modify_icons .= ' <a class="convertAction" href="#" ' . |
|
5746 | - 'data-documentId = ' . $document_id . |
|
5747 | - ' data-formatType = ' . $formatType . '>' . |
|
5745 | + $modify_icons .= ' <a class="convertAction" href="#" '. |
|
5746 | + 'data-documentId = '.$document_id. |
|
5747 | + ' data-formatType = '.$formatType.'>'. |
|
5748 | 5748 | Display::return_icon( |
5749 | 5749 | 'convert.png', |
5750 | 5750 | get_lang('Convert'), |
5751 | 5751 | array(), |
5752 | 5752 | ICON_SIZE_SMALL |
5753 | - ) . '</a>'; |
|
5753 | + ).'</a>'; |
|
5754 | 5754 | } |
5755 | 5755 | } |
5756 | 5756 | } |
@@ -5758,8 +5758,8 @@ discard block |
||
5758 | 5758 | if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) { |
5759 | 5759 | if ($is_template == 0) { |
5760 | 5760 | if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) { |
5761 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&add_as_template=' . $id . '&' . $sort_params . '">' . |
|
5762 | - Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5761 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&add_as_template='.$id.'&'.$sort_params.'">'. |
|
5762 | + Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5763 | 5763 | } |
5764 | 5764 | if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course |
5765 | 5765 | $visibility_icon_certificate = 'nocertificate'; |
@@ -5773,21 +5773,21 @@ discard block |
||
5773 | 5773 | $certificate = get_lang('NoDefaultCertificate'); |
5774 | 5774 | } |
5775 | 5775 | if (isset($_GET['selectcat'])) { |
5776 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&selectcat=' . intval($_GET['selectcat']) . '&set_certificate=' . $id . '&' . $sort_params . '">'; |
|
5776 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&selectcat='.intval($_GET['selectcat']).'&set_certificate='.$id.'&'.$sort_params.'">'; |
|
5777 | 5777 | $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate); |
5778 | 5778 | $modify_icons .= '</a>'; |
5779 | 5779 | if ($is_preview) { |
5780 | - $modify_icons .= ' <a target="_blank" href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&set_preview=' . $id . '&' . $sort_params . '" >' . |
|
5781 | - Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>'; |
|
5780 | + $modify_icons .= ' <a target="_blank" href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&set_preview='.$id.'&'.$sort_params.'" >'. |
|
5781 | + Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>'; |
|
5782 | 5782 | } |
5783 | 5783 | } |
5784 | 5784 | } |
5785 | 5785 | } else { |
5786 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&remove_as_template=' . $id. '&' . $sort_params . '">' . |
|
5787 | - Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>'; |
|
5786 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&remove_as_template='.$id.'&'.$sort_params.'">'. |
|
5787 | + Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>'; |
|
5788 | 5788 | } |
5789 | - $modify_icons .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' . |
|
5790 | - Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
5789 | + $modify_icons .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'">'. |
|
5790 | + Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>'; |
|
5791 | 5791 | } |
5792 | 5792 | |
5793 | 5793 | return $modify_icons; |
@@ -5859,7 +5859,7 @@ discard block |
||
5859 | 5859 | // 3. inside a subfolder of the folder you want to move |
5860 | 5860 | if (($curdirpath != $folder) && |
5861 | 5861 | ($folder != $move_file) && |
5862 | - (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/') |
|
5862 | + (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/') |
|
5863 | 5863 | ) { |
5864 | 5864 | $path_displayed = $folder; |
5865 | 5865 | // If document title is used, we have to display titles instead of real paths... |
@@ -5876,7 +5876,7 @@ discard block |
||
5876 | 5876 | foreach ($folders as $folder) { |
5877 | 5877 | if (($curdirpath != $folder) && |
5878 | 5878 | ($folder != $move_file) && |
5879 | - (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/') |
|
5879 | + (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/') |
|
5880 | 5880 | ) { |
5881 | 5881 | // Cannot copy dir into his own subdir |
5882 | 5882 | $path_displayed = DocumentManager::get_titles_of_path($folder); |
@@ -5919,10 +5919,10 @@ discard block |
||
5919 | 5919 | // If this path has soon been stored here we don't need a new query |
5920 | 5920 | $path_displayed .= $tmp_folders_titles[$tmp_path]; |
5921 | 5921 | } else { |
5922 | - $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . ' |
|
5923 | - WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"'; |
|
5922 | + $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).' |
|
5923 | + WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"'; |
|
5924 | 5924 | $rs = Database::query($sql); |
5925 | - $tmp_title = '/' . Database::result($rs, 0, 0); |
|
5925 | + $tmp_title = '/'.Database::result($rs, 0, 0); |
|
5926 | 5926 | $path_displayed .= $tmp_title; |
5927 | 5927 | $tmp_folders_titles[$tmp_path] = $tmp_title; |
5928 | 5928 | } |
@@ -5959,7 +5959,7 @@ discard block |
||
5959 | 5959 | $clean_curdirpath = Security::remove_XSS($curdirpath); |
5960 | 5960 | if ($clean_curdirpath == '/shared_folder') { |
5961 | 5961 | return true; |
5962 | - } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) { |
|
5962 | + } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) { |
|
5963 | 5963 | return true; |
5964 | 5964 | } else { |
5965 | 5965 | return false; |
@@ -5975,7 +5975,7 @@ discard block |
||
5975 | 5975 | $clean_path = Security::remove_XSS($path); |
5976 | 5976 | if (strpos($clean_path, 'shared_folder/sf_user_')) { |
5977 | 5977 | return true; |
5978 | - } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) { |
|
5978 | + } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) { |
|
5979 | 5979 | return true; |
5980 | 5980 | } else { |
5981 | 5981 | return false; |
@@ -5988,11 +5988,11 @@ discard block |
||
5988 | 5988 | */ |
5989 | 5989 | public static function is_my_shared_folder($user_id, $path, $current_session_id) |
5990 | 5990 | { |
5991 | - $clean_path = Security::remove_XSS($path) . '/'; |
|
5991 | + $clean_path = Security::remove_XSS($path).'/'; |
|
5992 | 5992 | //for security does not remove the last slash |
5993 | - $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//'; |
|
5993 | + $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//'; |
|
5994 | 5994 | //for security does not remove the last slash |
5995 | - $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//'; |
|
5995 | + $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//'; |
|
5996 | 5996 | |
5997 | 5997 | if (preg_match($main_user_shared_folder, $clean_path)) { |
5998 | 5998 | return true; |
@@ -6265,7 +6265,7 @@ discard block |
||
6265 | 6265 | ON (i.c_id = d.c_id) |
6266 | 6266 | WHERE |
6267 | 6267 | d.id = i.ref AND |
6268 | - i.tool = '" . TOOL_DOCUMENT . "' |
|
6268 | + i.tool = '".TOOL_DOCUMENT."' |
|
6269 | 6269 | $conditionSession AND |
6270 | 6270 | i.c_id = $courseId AND |
6271 | 6271 | d.c_id = $courseId "; |
@@ -6273,9 +6273,9 @@ discard block |
||
6273 | 6273 | $result = Database::query($sql); |
6274 | 6274 | $documents = Database::store_result($result, 'ASSOC'); |
6275 | 6275 | if ($documents) { |
6276 | - $course_dir = $courseInfo['directory'] . '/document'; |
|
6276 | + $course_dir = $courseInfo['directory'].'/document'; |
|
6277 | 6277 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
6278 | - $base_work_dir = $sys_course_path . $course_dir; |
|
6278 | + $base_work_dir = $sys_course_path.$course_dir; |
|
6279 | 6279 | |
6280 | 6280 | foreach ($documents as $document) { |
6281 | 6281 | $documentId = $document['id']; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | /** |
278 | 278 | * @param string |
279 | 279 | * @param string |
280 | - * @return true if the user is allowed to see the document, false otherwise |
|
280 | + * @return boolean if the user is allowed to see the document, false otherwise |
|
281 | 281 | * @author Sergio A Kessler, first version |
282 | 282 | * @author Roan Embrechts, bugfix |
283 | 283 | * @todo not only check if a file is visible, but also check if the user is allowed to see the file?? |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | * Return true if the documentpath have visibility=1 as |
1530 | 1530 | * item_property (you should use the is_visible_by_id) |
1531 | 1531 | * |
1532 | - * @param string $document_path the relative complete path of the document |
|
1532 | + * @param string $doc_path the relative complete path of the document |
|
1533 | 1533 | * @param array $course the _course array info of the document's course |
1534 | 1534 | * @param int |
1535 | 1535 | * @param string |
@@ -1615,6 +1615,8 @@ discard block |
||
1615 | 1615 | * @param int |
1616 | 1616 | * @param int |
1617 | 1617 | * @param bool |
1618 | + * @param integer $session_id |
|
1619 | + * @param integer $user_id |
|
1618 | 1620 | * @return bool |
1619 | 1621 | */ |
1620 | 1622 | public static function is_visible_by_id( |
@@ -1966,7 +1968,7 @@ discard block |
||
1966 | 1968 | * Remove default certificate |
1967 | 1969 | * @param string $course_id The course code |
1968 | 1970 | * @param int $default_certificate_id The document id of the default certificate |
1969 | - * @return void |
|
1971 | + * @return false|null |
|
1970 | 1972 | */ |
1971 | 1973 | public static function remove_attach_certificate($course_id, $default_certificate_id) |
1972 | 1974 | { |
@@ -2101,6 +2103,7 @@ discard block |
||
2101 | 2103 | * @param bool is file or string html |
2102 | 2104 | * @param string type (one of the app tools) - optional (otherwise takes the current item's type) |
2103 | 2105 | * @param int level of recursivity we're in |
2106 | + * @param string $source_html |
|
2104 | 2107 | * @return array List of file paths. An additional field containing 'local' or 'remote' helps determine |
2105 | 2108 | * if the file should be copied into the zip or just linked |
2106 | 2109 | */ |
@@ -2940,6 +2943,7 @@ discard block |
||
2940 | 2943 | |
2941 | 2944 | /** |
2942 | 2945 | * Obtains the text inside the file with the right parser |
2946 | + * @param string $doc_path |
|
2943 | 2947 | */ |
2944 | 2948 | public static function get_text_content($doc_path, $doc_mime) |
2945 | 2949 | { |
@@ -3191,6 +3195,7 @@ discard block |
||
3191 | 3195 | * Shows a play icon next to the document title in the document list |
3192 | 3196 | * @param int |
3193 | 3197 | * @param string |
3198 | + * @param integer|null $i |
|
3194 | 3199 | * @return string html content |
3195 | 3200 | */ |
3196 | 3201 | public static function generate_media_preview($i, $type = 'simple') |
@@ -4089,7 +4094,7 @@ discard block |
||
4089 | 4094 | } |
4090 | 4095 | |
4091 | 4096 | /** |
4092 | - * @return array |
|
4097 | + * @return string[] |
|
4093 | 4098 | */ |
4094 | 4099 | public static function get_web_odf_extension_list() |
4095 | 4100 | { |
@@ -4098,10 +4103,10 @@ discard block |
||
4098 | 4103 | |
4099 | 4104 | /** |
4100 | 4105 | * Set of extension allowed to use Jodconverter |
4101 | - * @param $mode 'from' |
|
4106 | + * @param string $mode 'from' |
|
4102 | 4107 | * 'to' |
4103 | 4108 | * 'all' |
4104 | - * @param $format 'text' |
|
4109 | + * @param string $format 'text' |
|
4105 | 4110 | * 'spreadsheet' |
4106 | 4111 | * 'presentation' |
4107 | 4112 | * 'drawing' |
@@ -4305,7 +4310,7 @@ discard block |
||
4305 | 4310 | } |
4306 | 4311 | |
4307 | 4312 | /** |
4308 | - * @return array |
|
4313 | + * @return string[] |
|
4309 | 4314 | */ |
4310 | 4315 | public static function get_system_folders() |
4311 | 4316 | { |
@@ -4323,7 +4328,7 @@ discard block |
||
4323 | 4328 | } |
4324 | 4329 | |
4325 | 4330 | /** |
4326 | - * @return array |
|
4331 | + * @return string[] |
|
4327 | 4332 | */ |
4328 | 4333 | public static function getProtectedFolderFromStudent() |
4329 | 4334 | { |
@@ -4479,7 +4484,7 @@ discard block |
||
4479 | 4484 | * Requires the ffmpeg lib. In ubuntu: sudo apt-get install ffmpeg |
4480 | 4485 | * @param string $wavFile |
4481 | 4486 | * @param bool $removeWavFileIfSuccess |
4482 | - * @return bool |
|
4487 | + * @return string|false |
|
4483 | 4488 | */ |
4484 | 4489 | public static function convertWavToMp3($wavFile, $removeWavFileIfSuccess = false) |
4485 | 4490 | { |
@@ -5055,6 +5060,8 @@ discard block |
||
5055 | 5060 | * @param string The current folder (path inside of the "document" directory, including the prefix "/") |
5056 | 5061 | * @param string Group directory, if empty, prevents documents to be uploaded (because group documents cannot be uploaded in root) |
5057 | 5062 | * @param boolean Whether to change the renderer (this will add a template <span> to the QuickForm object displaying the form) |
5063 | + * @param string $document_id |
|
5064 | + * @param FormValidator $form |
|
5058 | 5065 | |
5059 | 5066 | * @return string html form |
5060 | 5067 | */ |
@@ -5560,9 +5567,6 @@ discard block |
||
5560 | 5567 | /** |
5561 | 5568 | * Creates the row of edit icons for a file/folder |
5562 | 5569 | * |
5563 | - * @param string $curdirpath current path (cfr open folder) |
|
5564 | - * @param string $type (file/folder) |
|
5565 | - * @param string $path dbase path of file/folder |
|
5566 | 5570 | * @param int $visibility (1/0) |
5567 | 5571 | * @param int $id dbase id of the document |
5568 | 5572 | * @return string html img tags with hyperlinks |
@@ -5896,7 +5900,7 @@ discard block |
||
5896 | 5900 | /** |
5897 | 5901 | * Gets the path translated with title of docs and folders |
5898 | 5902 | * @param string $path the real path |
5899 | - * @return the path which should be displayed |
|
5903 | + * @return string path which should be displayed |
|
5900 | 5904 | */ |
5901 | 5905 | public static function get_titles_of_path($path) |
5902 | 5906 | { |
@@ -5952,7 +5956,8 @@ discard block |
||
5952 | 5956 | |
5953 | 5957 | /** |
5954 | 5958 | * Checks whether the user is in shared folder |
5955 | - * @return return bool Return true when user is into shared folder |
|
5959 | + * @param integer $current_session_id |
|
5960 | + * @return boolean bool Return true when user is into shared folder |
|
5956 | 5961 | */ |
5957 | 5962 | public static function is_shared_folder($curdirpath, $current_session_id) |
5958 | 5963 | { |
@@ -5968,7 +5973,7 @@ discard block |
||
5968 | 5973 | |
5969 | 5974 | /** |
5970 | 5975 | * Checks whether the user is into any user shared folder |
5971 | - * @return return bool Return true when user is in any user shared folder |
|
5976 | + * @return boolean bool Return true when user is in any user shared folder |
|
5972 | 5977 | */ |
5973 | 5978 | public static function is_any_user_shared_folder($path, $current_session_id) |
5974 | 5979 | { |
@@ -6182,7 +6187,7 @@ discard block |
||
6182 | 6187 | * @param int $id |
6183 | 6188 | * @param array $courseInfo |
6184 | 6189 | * @param int $sessionId |
6185 | - * @return bool |
|
6190 | + * @return boolean|null |
|
6186 | 6191 | */ |
6187 | 6192 | public static function downloadDeletedDocument($id, $courseInfo, $sessionId) |
6188 | 6193 | { |
@@ -6201,7 +6206,7 @@ discard block |
||
6201 | 6206 | * @param array $courseInfo |
6202 | 6207 | * @param int $sessionId |
6203 | 6208 | * |
6204 | - * @return bool |
|
6209 | + * @return false|null |
|
6205 | 6210 | */ |
6206 | 6211 | public static function downloadAllDeletedDocument($courseInfo, $sessionId) |
6207 | 6212 | { |
@@ -6240,7 +6245,7 @@ discard block |
||
6240 | 6245 | * @param array $courseInfo |
6241 | 6246 | * @param int $sessionId |
6242 | 6247 | * |
6243 | - * @return bool |
|
6248 | + * @return false|null |
|
6244 | 6249 | */ |
6245 | 6250 | public static function deleteDocumentsFromSession($courseInfo, $sessionId) |
6246 | 6251 | { |