Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 421-425 (lines=5) @@
418
                    $html .= '<div class="pull-right">';
419
                    $html .= '<div class="btn-options">';
420
                    $html .= '<div class="btn-group btn-group-sm" role="group">';
421
                    foreach ($lnk as & $this_link) {
422
                        if (!isset($tool['adminlink'])) {
423
                            $html .= '<a class="btn btn-default" title='.$this_link['title'].' href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$tool['id'].'&amp;'.$this_link['cmd'].'">'.$this_link['name'].'</a>';
424
                        }
425
                    }
426
                    $html .= '</div>';
427
                    $html .= '</div>';
428
                    $html .= '</div>';
@@ 891-896 (lines=6) @@
888
889
                $item['visibility'] = null;
890
                if (isset($lnk) && is_array($lnk)) {
891
                    foreach ($lnk as $this_link) {
892
                        if (empty($tool['adminlink'])) {
893
                            $item['visibility'] .= '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&id='.$tool['id'].'&'.$this_link['cmd'].'">'.
894
                                $this_link['name'].'</a>';
895
                        }
896
                    }
897
                } else {
898
                    $item['visibility'] .= '';
899
                }