Code Duplication    Length = 6-9 lines in 2 locations

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

@@ 784-792 (lines=9) @@
781
782
        $viewBySession = api_get_setting('my_courses_view_by_session') === 'true';
783
784
        if (api_is_global_chat_enabled() || $viewBySession) {
785
            // Do not include the global chat in LP
786
            if ($this->show_learnpath == false &&
787
                $this->show_footer == true &&
788
                $this->hide_global_chat == false
789
            ) {
790
                $js_files[] = 'chat/js/chat.js';
791
            }
792
        }
793
794
        if (api_get_setting('accessibility_font_resize') == 'true') {
795
            $js_files[] = 'fontresize.js';
@@ 870-875 (lines=6) @@
867
    {
868
        global $disable_js_and_css_files, $htmlHeadXtra;
869
        $js_files = array();
870
        if (api_is_global_chat_enabled()) {
871
            //Do not include the global chat in LP
872
            if ($this->show_learnpath == false && $this->show_footer == true && $this->hide_global_chat == false) {
873
                $js_files[] = 'chat/js/chat.js';
874
            }
875
        }
876
        $js_file_to_string = null;
877
878
        foreach ($js_files as $js_file) {