Code Duplication    Length = 27-27 lines in 2 locations

main/dropbox/dropbox_class.inc.php 2 locations

@@ 510-536 (lines=27) @@
507
	 *
508
	 * @param unknown_type $sort
509
	 */
510
	function orderSentWork($sort)
511
    {
512
		switch($sort) {
513
			case 'lastDate':
514
				$this->_orderBy = 'last_upload_date';
515
				break;
516
			case 'firstDate':
517
				$this->_orderBy = 'upload_date';
518
				break;
519
			case 'title':
520
				$this->_orderBy = 'title';
521
				break;
522
			case 'size':
523
				$this->_orderBy = 'filesize';
524
				break;
525
			case 'author':
526
				$this->_orderBy = 'author';
527
				break;
528
			case 'recipient':
529
				$this->_orderBy = 'recipients';
530
				break;
531
			default:
532
				$this->_orderBy = 'last_upload_date';
533
		}
534
535
		usort($this->sentWork, array($this, '_cmpWork'));
536
	}
537
538
	/**
539
	 * method that sorts the objects in the receivedWork array, dependent on the $sort parameter.
@@ 543-569 (lines=27) @@
540
	 * $sort can be lastDate, firstDate, title, size, ...
541
	 * @param unknown_type $sort
542
	 */
543
	function orderReceivedWork($sort)
544
    {
545
		switch($sort) {
546
			case 'lastDate':
547
				$this->_orderBy = 'last_upload_date';
548
				break;
549
			case 'firstDate':
550
				$this->_orderBy = 'upload_date';
551
				break;
552
			case 'title':
553
				$this->_orderBy = 'title';
554
				break;
555
			case 'size':
556
				$this->_orderBy = 'filesize';
557
				break;
558
			case 'author':
559
				$this->_orderBy = 'author';
560
				break;
561
			case 'sender':
562
				$this->_orderBy = 'uploaderName';
563
				break;
564
			default:
565
				$this->_orderBy = 'last_upload_date';
566
		}
567
568
		usort($this->receivedWork, array($this, '_cmpWork'));
569
	}
570
571
	/**
572
	 * Deletes all the received work of this person