Code Duplication    Length = 4-6 lines in 4 locations

main/group/group.php 2 locations

@@ 254-257 (lines=4) @@
251
                        'onclick' => 'javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;'
252
                    )
253
                );
254
            if ($index != 0) {
255
                $actions .=  ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index -1]['id'].'">'.
256
                    Display::return_icon('up.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
257
            }
258
            if ($index != count($group_cats) - 1) {
259
                $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index +1]['id'].'">'.
260
                    Display::return_icon('down.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
@@ 258-261 (lines=4) @@
255
                $actions .=  ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index -1]['id'].'">'.
256
                    Display::return_icon('up.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
257
            }
258
            if ($index != count($group_cats) - 1) {
259
                $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index +1]['id'].'">'.
260
                    Display::return_icon('down.png','&nbsp;','',ICON_SIZE_SMALL).'</a>';
261
            }
262
        }
263
264
        echo Display::page_header(

main/admin/user_list.php 1 location

@@ 569-573 (lines=5) @@
566
    //only allow platform admins to login_as, or session admins only for students (not teachers nor other admins)
567
    if (api_is_platform_admin() || (api_is_session_admin() && $current_user_status_label == $statusname[STUDENT])) {
568
        if (!$user_is_anonymous) {
569
            if (api_global_admin_can_edit_admin($user_id)) {
570
                $result .= '<a href="user_list.php?action=login_as&user_id='.$user_id.'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('login_as.png', get_lang('LoginAs')).'</a>&nbsp;';
571
            } else {
572
                $result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;';
573
            }
574
        } else {
575
            $result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;';
576
        }

main/inc/lib/AnnouncementManager.php 1 location

@@ 1629-1634 (lines=6) @@
1626
                        Display::return_icon($image_visibility.'.png', $alt_visibility,'',ICON_SIZE_SMALL)."</a>";
1627
1628
                    // DISPLAY MOVE UP COMMAND only if it is not the top announcement
1629
                    if ($iterator != 1) {
1630
                        $modify_icons .= "<a href=\"".$actionUrl."&action=move&up=".$myrow["id"]."&sec_token=".$stok."\">".
1631
                            Display::return_icon('up.gif', get_lang('Up'))."</a>";
1632
                    } else {
1633
                        $modify_icons .= Display::return_icon('up_na.gif', get_lang('Up'));
1634
                    }
1635
                    if ($iterator < $bottomAnnouncement) {
1636
                        $modify_icons .= "<a href=\"".$actionUrl."&action=move&down=".$myrow["id"]."&sec_token=".$stok."\">".
1637
                            Display::return_icon('down.gif', get_lang('Down'))."</a>";