Code Duplication    Length = 4-11 lines in 2 locations

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

@@ 863-873 (lines=11) @@
860
                                    $lnk[] = $link;
861
                                    break;
862
                            }
863
                        } else {
864
                            $link['name'] = Display::return_icon(
865
                                'visible.png',
866
                                get_lang('Deactivate'),
867
                                array('id' => 'linktool_'.$tool['iid']),
868
                                ICON_SIZE_SMALL,
869
                                false
870
                            );
871
                            $link['cmd'] = 'hide=yes';
872
                            $lnk[] = $link;
873
                        }
874
                    }
875
                    if (!empty($tool['adminlink'])) {
876
                        $item['extra'] = '<a href="'.$tool['adminlink'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
@@ 1337-1340 (lines=4) @@
1334
                    array('class' => 'tool-img'),
1335
                    ICON_SIZE_SMALL
1336
                );
1337
            } else {
1338
                $class = 'icons-text';
1339
                $item = $navigation_item['name'].Display::return_icon(substr($navigation_item['image'], 0, -3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL);
1340
            }
1341
1342
            if (stristr($url_item['path'], $url_current['path'])) {
1343
                if (!isset($_GET['learnpath_id']) || strpos($url_item['query'], 'learnpath_id='.intval($_GET['learnpath_id'])) === 0) {