Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 415-419 (lines=5) @@
412
                    $html .= '<div class="pull-right">';
413
                    $html .= '<div class="btn-options">';
414
                    $html .= '<div class="btn-group btn-group-sm" role="group">';
415
                    foreach ($lnk as & $this_link) {
416
                        if (!isset($tool['adminlink'])) {
417
                            $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>';
418
                        }
419
                    }
420
                    $html .= '</div>';
421
                    $html .= '</div>';
422
                    $html .= '</div>';
@@ 799-804 (lines=6) @@
796
                $item['visibility'] = null;
797
798
                if (isset($lnk) && is_array($lnk)) {
799
                    foreach ($lnk as $this_link) {
800
                        if (empty($tool['adminlink'])) {
801
                            $item['visibility'] .= '<a class="make_visible_and_invisible" href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$tool['id'].'&amp;'.$this_link['cmd'].'">'.
802
                                $this_link['name'].'</a>';
803
                        }
804
                    }
805
                } else {
806
                    $item['visibility'] .= '';
807
                }