Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 406-410 (lines=5) @@
403
                    }
404
                }
405
                if (is_array($lnk)) {
406
                    foreach ($lnk as & $this_link) {
407
                        if (!$tool['adminlink']) {
408
                            $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$tool['id'].'&amp;'.$this_link['cmd'].'">'.$this_link['name'].'</a>';
409
                        }
410
                    }
411
                }
412
                $html .= "</td>";
413
@@ 776-781 (lines=6) @@
773
                $item['visibility'] = null;
774
775
                if (isset($lnk) && is_array($lnk)) {
776
                    foreach ($lnk as $this_link) {
777
                        if (empty($tool['adminlink'])) {
778
                            $item['visibility'] .= '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$tool['id'].'&amp;'.$this_link['cmd'].'">'.
779
                                $this_link['name'].'</a>';
780
                        }
781
                    }
782
                } else {
783
                    $item['visibility'] .= '';
784
                }