Code Duplication    Length = 12-13 lines in 2 locations

main/inc/lib/agenda.lib.php 2 locations

@@ 392-403 (lines=12) @@
389
                    }
390
391
                    // Add attachment.
392
                    if (isset($attachmentArray) && !empty($attachmentArray)) {
393
                        $counter = 0;
394
                        foreach ($attachmentArray as $attachmentItem) {
395
                            $this->addAttachment(
396
                                $id,
397
                                $attachmentItem,
398
                                $attachmentCommentList[$counter],
399
                                $this->course
400
                            );
401
                            $counter++;
402
                        }
403
                    }
404
                }
405
                break;
406
            case 'admin':
@@ 966-978 (lines=13) @@
963
                    }
964
965
                    // Add attachment.
966
                    if (isset($attachmentArray) && !empty($attachmentArray)) {
967
                        $counter = 0;
968
                        foreach ($attachmentArray as $attachmentItem) {
969
                            $this->updateAttachment(
970
                                $attachmentItem['id'],
971
                                $id,
972
                                $attachmentItem,
973
                                $attachmentCommentList[$counter],
974
                                $this->course
975
                            );
976
                            $counter++;
977
                        }
978
                    }
979
980
                    return true;
981
                } else {