|
17 | 17 | $viewReceivedCategory = isset($_GET['view_received_category']) ? Security::remove_XSS($_GET['view_received_category']) : null; |
18 | 18 | $viewSentCategory = isset($_GET['view_sent_category']) ? Security::remove_XSS($_GET['view_sent_category']) : null; |
19 | 19 |
|
20 | | - |
21 | 20 | // Do the tracking |
22 | 21 | event_access_tool(TOOL_DROPBOX); |
23 | 22 |
|
|
151 | 150 | // only the download has is handled separately in dropbox_init_inc.php because this has to be done before the headers are sent |
152 | 151 | // (which also happens in dropbox_init.inc.php |
153 | 152 |
|
154 | | -if (!isset($_POST['feedback']) && (strstr($postAction, 'move_received') OR |
155 | | - $postAction == 'delete_received' OR $postAction == 'download_received' OR |
156 | | - $postAction == 'delete_sent' OR $postAction == 'download_sent')) { |
157 | | - |
| 153 | +if (!isset($_POST['feedback']) && ( |
| 154 | + strstr($postAction, 'move_received') OR |
| 155 | + strstr($postAction, 'move_sent') OR |
| 156 | + $postAction == 'delete_received' OR |
| 157 | + $postAction == 'download_received' OR |
| 158 | + $postAction == 'delete_sent' OR |
| 159 | + $postAction == 'download_sent') |
| 160 | +) { |
158 | 161 | $display_message = handle_multiple_actions(); |
159 | 162 | Display :: display_normal_message($display_message); |
160 | 163 | } |
|
269 | 272 | } |
270 | 273 | } |
271 | 274 | } |
272 | | - |
273 | 275 | /* THE MENU TABS */ |
274 | | - |
275 | 276 | if ($dropbox_cnf['sent_received_tabs']) { |
276 | 277 | ?> |
277 | | - |
278 | 278 | <ul class="nav nav-tabs"> |
279 | 279 | <li <?php if (!$view OR $view == 'sent') { echo 'class="active"'; } ?> > |
280 | 280 | <a href="index.php?<?php echo api_get_cidreq(); ?>&view=sent" ><?php echo get_lang('SentFiles'); ?></a></li> |
281 | 281 | <li <?php if ($view == 'received') { echo 'class="active"'; } ?> > |
282 | 282 | <a href="index.php?<?php echo api_get_cidreq(); ?>&view=received" ><?php echo get_lang('ReceivedFiles'); ?></a></li> |
283 | 283 | </ul> |
284 | | - |
285 | 284 | <?php |
286 | 285 | } |
287 | 286 |
|
|
345 | 344 | $column_order[3] = 8; |
346 | 345 | $column_order[5] = 7; |
347 | 346 |
|
348 | | - |
349 | 347 | // The content of the sortable table = the received files |
350 | 348 | foreach ($dropbox_person -> receivedWork as $dropbox_file) { |
351 | 349 | $dropbox_file_data = array(); |
|
400 | 398 |
|
401 | 399 | // The content of the sortable table = the categories (if we are not in the root) |
402 | 400 | if ($view_dropbox_category_received == 0) { |
403 | | - foreach ($dropbox_categories as $category) { // Note: This can probably be shortened since the categories for the received files are already in the $dropbox_received_category array; |
| 401 | + foreach ($dropbox_categories as $category) { |
| 402 | + /* Note: This can probably be shortened since the categories |
| 403 | + for the received files are already in the |
| 404 | + $dropbox_received_category array;*/ |
404 | 405 | $dropbox_category_data = array(); |
405 | 406 | if ($category['received'] == '1') { |
406 | 407 | $movelist[$category['cat_id']] = $category['cat_name']; |
407 | | - $dropbox_category_data[] = $category['cat_id']; // This is where the checkbox icon for the files appear |
| 408 | + // This is where the checkbox icon for the files appear |
| 409 | + $dropbox_category_data[] = $category['cat_id']; |
408 | 410 | // The icon of the category |
409 | 411 | $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">'; |
410 | 412 | $dropbox_category_data[] = $link_open.build_document_icon_tag('folder', $category['cat_name']).'</a>'; |
|
420 | 422 | } |
421 | 423 | } |
422 | 424 | } |
| 425 | + |
423 | 426 | // Displaying the table |
424 | 427 | $additional_get_parameters = array('view' => $view, 'view_received_category' => $viewReceivedCategory, 'view_sent_category' => $viewSentCategory); |
425 | | - $selectlist = array('delete_received' => get_lang('Delete'), 'download_received' => get_lang('Download')); |
| 428 | + $selectlist = array( |
| 429 | + 'delete_received' => get_lang('Delete'), |
| 430 | + 'download_received' => get_lang('Download') |
| 431 | + ); |
| 432 | + |
426 | 433 | if (is_array($movelist)) { |
427 | 434 | foreach ($movelist as $catid => $catname){ |
428 | 435 | $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
|
433 | 440 | $selectlist = array(); |
434 | 441 | } |
435 | 442 |
|
436 | | - Display::display_sortable_config_table('dropbox', $column_header, $dropbox_data_recieved, $sorting_options, $paging_options, $additional_get_parameters, $column_show, $column_order, $selectlist); |
| 443 | + Display::display_sortable_config_table( |
| 444 | + 'dropbox', |
| 445 | + $column_header, |
| 446 | + $dropbox_data_recieved, |
| 447 | + $sorting_options, |
| 448 | + $paging_options, |
| 449 | + $additional_get_parameters, |
| 450 | + $column_show, |
| 451 | + $column_order, |
| 452 | + $selectlist |
| 453 | + ); |
437 | 454 | } |
438 | 455 |
|
439 | 456 | /* SENT FILES */ |
|
500 | 517 | $column_order[5] = 7; |
501 | 518 |
|
502 | 519 | // The content of the sortable table = the received files |
503 | | - foreach ($dropbox_person -> sentWork as $dropbox_file) { |
| 520 | + foreach ($dropbox_person->sentWork as $dropbox_file) { |
504 | 521 | $dropbox_file_data = array(); |
505 | 522 |
|
506 | 523 | if ($view_dropbox_category_sent == $dropbox_file->category) { |
|
541 | 558 | } |
542 | 559 | } |
543 | 560 |
|
| 561 | + $moveList = array(); |
544 | 562 | // The content of the sortable table = the categories (if we are not in the root) |
545 | 563 | if ($view_dropbox_category_sent == 0) { |
546 | 564 | foreach ($dropbox_categories as $category) { |
547 | 565 | $dropbox_category_data = array(); |
| 566 | + |
548 | 567 | if ($category['sent'] == '1') { |
| 568 | + |
| 569 | + $moveList[$category['cat_id']] = $category['cat_name']; |
| 570 | + |
549 | 571 | $dropbox_category_data[] = $category['cat_id']; // This is where the checkbox icon for the files appear. |
550 | 572 | $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">'; |
551 | 573 | $dropbox_category_data[] = $link_open.build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>'; |
|
565 | 587 | } |
566 | 588 | } |
567 | 589 | } |
| 590 | + |
568 | 591 | // Displaying the table |
569 | | - $additional_get_parameters = array('view' => $view, 'view_received_category' => $viewReceivedCategory, 'view_sent_category' => $viewSentCategory); |
570 | | - $selectlist = array('delete_received' => get_lang('Delete'), 'download_received' => get_lang('Download')); |
| 592 | + $additional_get_parameters = array( |
| 593 | + 'view' => $view, |
| 594 | + 'view_received_category' => $viewReceivedCategory, |
| 595 | + 'view_sent_category' => $viewSentCategory |
| 596 | + ); |
| 597 | + |
| 598 | + $selectlist = array( |
| 599 | + 'delete_received' => get_lang('Delete'), |
| 600 | + 'download_received' => get_lang('Download') |
| 601 | + ); |
| 602 | + |
| 603 | + if (!empty($moveList)) { |
| 604 | + foreach ($moveList as $catid => $catname) { |
| 605 | + $selectlist['move_sent_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname); |
| 606 | + } |
| 607 | + } |
| 608 | + |
571 | 609 | if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { |
572 | 610 | $selectlist = array('download_received' => get_lang('Download')); |
573 | 611 | } |
574 | | - Display::display_sortable_config_table('dropbox', $column_header, $dropbox_data_sent, $sorting_options, $paging_options, $additional_get_parameters, $column_show, $column_order, $selectlist); |
| 612 | + Display::display_sortable_config_table( |
| 613 | + 'dropbox', |
| 614 | + $column_header, |
| 615 | + $dropbox_data_sent, |
| 616 | + $sorting_options, |
| 617 | + $paging_options, |
| 618 | + $additional_get_parameters, |
| 619 | + $column_show, |
| 620 | + $column_order, |
| 621 | + $selectlist |
| 622 | + ); |
575 | 623 | } |
576 | 624 | } |
577 | 625 |
|
|
0 commit comments