Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 806-816 (lines=11) @@
803
                if ($is_allowed_to_edit) {
804
                    if (empty($session_id)) {
805
                        if (isset($tool['id'])) {
806
                            if ($tool['visibility'] == '1' && $toolAdmin != '1') {
807
                                $link['name'] = Display::return_icon(
808
                                    'visible.png',
809
                                    get_lang('Deactivate'),
810
                                    array('id' => 'linktool_'.$tool['iid']),
811
                                    ICON_SIZE_SMALL,
812
                                    false
813
                                );
814
                                $link['cmd'] = 'hide=yes';
815
                                $lnk[] = $link;
816
                            }
817
                            if ($tool['visibility'] == '0' && $toolAdmin != '1') {
818
                                $link['name'] = Display::return_icon(
819
                                    'invisible.png',
@@ 817-827 (lines=11) @@
814
                                $link['cmd'] = 'hide=yes';
815
                                $lnk[] = $link;
816
                            }
817
                            if ($tool['visibility'] == '0' && $toolAdmin != '1') {
818
                                $link['name'] = Display::return_icon(
819
                                    'invisible.png',
820
                                    get_lang('Activate'),
821
                                    array('id' => 'linktool_'.$tool['iid']),
822
                                    ICON_SIZE_SMALL,
823
                                    false
824
                                );
825
                                $link['cmd'] = 'restore=yes';
826
                                $lnk[] = $link;
827
                            }
828
                        }
829
                    } elseif ($allowEditionInSession) {
830
                        $criteria = [