Code Duplication    Length = 4-13 lines in 7 locations

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

@@ 196-199 (lines=4) @@
193
							Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>';
194
						$attendance[2] = '<span class="muted">'.$attendance[2].'</span>';
195
					}
196
					if ($allowDelete === 'true') {
197
						$actions .= '<a href="index.php?' . api_get_cidreq() . '&action=attendance_delete&attendance_id=' . $attendance[0]. '">' .
198
							Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
199
					}
200
				} else {
201
					$is_locked_attendance = self::is_locked_attendance($attendance[0]);
202
					if ($is_locked_attendance) {
@@ 217-220 (lines=4) @@
214
								Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>';
215
							$attendance[2] = '<span class="muted">'.$attendance[2].'</span>';
216
						}
217
						if ($allowDelete === 'true') {
218
							$actions .= ' <a href="index.php?' . api_get_cidreq() . '&action=attendance_delete&attendance_id=' . $attendance[0].'">' .
219
								Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
220
						}
221
					}
222
				}
223

main/gradebook/lib/fe/displaygradebook.php 1 location

@@ 51-54 (lines=4) @@
48
49
                $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&print=&selecteval=' . $evalobj->get_id() . '" target="_blank">' .
50
                    Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM) . '</a>';
51
            } else {
52
                $header .= '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' .
53
                    Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>';
54
            }
55
            $header .= '</div>';
56
        }
57

main/announcements/announcements.php 1 location

@@ 611-614 (lines=4) @@
608
    if (in_array($action, array('add', 'modify', 'view'))) {
609
        $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
610
            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
611
    } else {
612
        $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&action=add&origin=".$origin."'>".
613
            Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM)."</a>";
614
    }
615
    $show_actions = true;
616
} else {
617
    if (in_array($action, array('view'))) {

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

@@ 5266-5269 (lines=4) @@
5263
                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5264
                    }
5265
                }
5266
            } else {
5267
                $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5268
                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5269
            }
5270
5271
            // Copy files to users myfiles
5272
            if (api_get_setting('allow_social_tool') == 'true' &&
@@ 5637-5640 (lines=4) @@
5634
            //Edit button
5635
            if (in_array($path, DocumentManager::get_system_folders())) {
5636
                $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5637
            } elseif ($is_certificate_mode ) {
5638
                // gradebook category doesn't seem to be taken into account
5639
                $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5640
            } else {
5641
                if (api_get_session_id()) {
5642
                    if ($document_data['session_id'] == api_get_session_id()) {
5643
                        if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
@@ 5744-5756 (lines=13) @@
5741
            // @TODO: add prompt to select a format target
5742
            if (in_array($path, DocumentManager::get_system_folders())) {
5743
                // nothing to do
5744
            } else {
5745
                if ($usePpt2lp && $formatType) {
5746
                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5747
                        'data-documentId = ' . $document_id .
5748
                        ' data-formatType = ' . $formatType . '>' .
5749
                        Display::return_icon(
5750
                            'convert.png',
5751
                            get_lang('Convert'),
5752
                            array(),
5753
                            ICON_SIZE_SMALL
5754
                        ) . '</a>';
5755
                }
5756
            }
5757
        }
5758
5759
        if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {