Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 371-381 (lines=11) @@
368
                        $lnk[] = $link;
369
                    }
370
371
                    if ($course_tool_category == TOOL_PUBLIC_BUT_HIDDEN) {
372
                        $link['name'] = Display::return_icon('add.gif', get_lang('Activate'));
373
                        $link['cmd'] = 'restore=yes';
374
                        $lnk[] = $link;
375
376
                        if ($tool['added_tool'] == 1) {
377
                            $link['name'] = Display::return_icon('delete.gif', get_lang('Remove'));
378
                            $link['cmd'] = 'remove=yes';
379
                            $lnk[] = $link;
380
                        }
381
                    }
382
                    if ($tool['adminlink']) {
383
                        $html .= '<a href="'.$tool['adminlink'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
384
                    }
@@ 387-398 (lines=12) @@
384
                    }
385
                }
386
                if (api_is_platform_admin() && !api_is_coach()) {
387
                    if ($tool['visibility'] == 2) {
388
                        $link['name'] = Display::return_icon('undelete.gif', get_lang('Activate'));
389
390
                        $link['cmd'] = 'hide=yes';
391
                        $lnk[] = $link;
392
393
                        if ($tool['added_tool'] == 1) {
394
                            $link['name'] = get_lang('Delete');
395
                            $link['cmd'] = 'askDelete=yes';
396
                            $lnk[] = $link;
397
                        }
398
                    }
399
                    if ($tool['visibility'] == 0 && $tool['added_tool'] == 0) {
400
                        $link['name'] = Display::return_icon('delete.gif', get_lang('Remove'));
401
                        $link['cmd'] = 'remove=yes';