Code Duplication    Length = 12-13 lines in 2 locations

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

@@ 296-307 (lines=12) @@
293
                    }
294
295
                    // Add attachment.
296
                    if (isset($attachmentArray) && !empty($attachmentArray)) {
297
                        $counter = 0;
298
                        foreach ($attachmentArray as $attachmentItem) {
299
                            $this->addAttachment(
300
                                $id,
301
                                $attachmentItem,
302
                                $attachmentCommentList[$counter],
303
                                $this->course
304
                            );
305
                            $counter++;
306
                        }
307
                    }
308
                }
309
                break;
310
            case 'admin':
@@ 783-795 (lines=13) @@
780
                    }
781
782
                    // Add attachment.
783
                    if (isset($attachmentArray) && !empty($attachmentArray)) {
784
                        $counter = 0;
785
                        foreach ($attachmentArray as $attachmentItem) {
786
                            $this->updateAttachment(
787
                                $attachmentItem['id'],
788
                                $id,
789
                                $attachmentItem,
790
                                $attachmentCommentList[$counter],
791
                                $this->course
792
                            );
793
                            $counter++;
794
                        }
795
                    }
796
                }
797
                break;
798
            case 'admin':