Code Duplication    Length = 4-5 lines in 3 locations

main/inc/lib/document.lib.php 3 locations

@@ 5481-5485 (lines=5) @@
5478
                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) .
5479
                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5480
                    }
5481
                } else {
5482
                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5483
                    DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) .
5484
                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5485
                }
5486
            } else {
5487
                if ($filetype == 'file') {
5488
                    // Sound preview with jplayer
@@ 5860-5863 (lines=4) @@
5857
                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . intval($_GET['selectcat']) . '&amp;set_certificate=' . $id . '&amp;' . $sort_params . '">';
5858
                        $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate);
5859
                        $modify_icons .= '</a>';
5860
                        if ($is_preview) {
5861
                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5862
                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5863
                        }
5864
                    }
5865
                }
5866
            } else {
@@ 5866-5869 (lines=4) @@
5863
                        }
5864
                    }
5865
                }
5866
            } else {
5867
                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5868
                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5869
            }
5870
            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&action=export_to_pdf&id=' . $id . '">' .
5871
                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5872
        }