Code Duplication    Length = 14-14 lines in 2 locations

main/wiki/wiki.inc.php 2 locations

@@ 1783-1796 (lines=14) @@
1780
            $row = Database::fetch_array($result);
1781
            $id = $row['id'];
1782
            $email_page_name = $row['title'];
1783
            if ($row['visibility'] == 1) {
1784
                $allow_send_mail = true; //if visibility off - notify off
1785
                $sql = 'SELECT * FROM '.$tbl_wiki_mailcue.'
1786
                        WHERE
1787
                            c_id = '.$course_id.' AND
1788
                            id="'.$id.'" AND
1789
                            type="'.$type.'" OR
1790
                            type="F" AND
1791
                            group_id="'.$groupId.'" AND
1792
                            session_id="'.$session_id.'"';
1793
                //type: P=page, D=discuss, F=full.
1794
                $result = Database::query($sql);
1795
                $emailtext = get_lang('EmailWikipageModified').' <strong>'.$email_page_name.'</strong> '.get_lang('Wiki');
1796
            }
1797
        } elseif ($type == 'D') {
1798
            //if added a post to discuss
1799
            //first, current author and time
@@ 1822-1835 (lines=14) @@
1819
            $row = Database::fetch_array($result);
1820
1821
            $email_page_name = $row['title'];
1822
            if ($row['visibility_disc'] == 1) {
1823
                $allow_send_mail = true; //if visibility off - notify off
1824
                $sql = 'SELECT * FROM '.$tbl_wiki_mailcue.'
1825
                        WHERE
1826
                            c_id = '.$course_id.' AND
1827
                            id="'.$id.'" AND
1828
                            type="'.$type.'" OR
1829
                            type="F" AND
1830
                            group_id="'.$groupId.'" AND
1831
                            session_id="'.$session_id.'"';
1832
                //type: P=page, D=discuss, F=full
1833
                $result = Database::query($sql);
1834
                $emailtext = get_lang('EmailWikiPageDiscAdded').' <strong>'.$email_page_name.'</strong> '.get_lang('Wiki');
1835
            }
1836
        } elseif ($type == 'A') {
1837
            //for added pages
1838
            $id = 0; //for tbl_wiki_mailcue