Code Duplication    Length = 10-10 lines in 4 locations

main/forum/forumfunction.inc.php 4 locations

@@ 1011-1020 (lines=10) @@
1008
{
1009
    $html = '';
1010
    $id = Security::remove_XSS($id);
1011
    if ($current_visibility_status == '1') {
1012
        $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&';
1013
        if (is_array($additional_url_parameters)) {
1014
            foreach ($additional_url_parameters as $key => $value) {
1015
                $html .= $key . '=' . $value . '&';
1016
            }
1017
        }
1018
        $html.='action=invisible&content='.$content.'&id='.$id.'">'.
1019
            Display::return_icon('visible.png', get_lang('MakeInvisible'), array(), ICON_SIZE_SMALL).'</a>';
1020
    }
1021
    if ($current_visibility_status == '0') {
1022
        $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&';
1023
        if (is_array($additional_url_parameters)) {
@@ 1021-1030 (lines=10) @@
1018
        $html.='action=invisible&content='.$content.'&id='.$id.'">'.
1019
            Display::return_icon('visible.png', get_lang('MakeInvisible'), array(), ICON_SIZE_SMALL).'</a>';
1020
    }
1021
    if ($current_visibility_status == '0') {
1022
        $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&';
1023
        if (is_array($additional_url_parameters)) {
1024
            foreach ($additional_url_parameters as $key => $value) {
1025
                $html .= $key . '=' . $value . '&';
1026
            }
1027
        }
1028
        $html .= 'action=visible&content=' . $content . '&id=' . $id . '">' .
1029
            Display::return_icon('invisible.png', get_lang('MakeVisible'), array(), ICON_SIZE_SMALL) . '</a>';
1030
    }
1031
    return $html;
1032
}
1033
@@ 1053-1062 (lines=10) @@
1050
            return $html;
1051
        }
1052
    }
1053
    if ($current_lock_status == '1') {
1054
        $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&';
1055
        if (is_array($additional_url_parameters)) {
1056
            foreach ($additional_url_parameters as $key => $value) {
1057
                $html .= $key . '=' . $value . '&';
1058
            }
1059
        }
1060
        $html.= 'action=unlock&content='.$content.'&id='.$id.'">'.
1061
            Display::return_icon('lock.png', get_lang('Unlock'), array(), ICON_SIZE_SMALL).'</a>';
1062
    }
1063
    if ($current_lock_status == '0') {
1064
        $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&';
1065
        if (is_array($additional_url_parameters)) {
@@ 1063-1072 (lines=10) @@
1060
        $html.= 'action=unlock&content='.$content.'&id='.$id.'">'.
1061
            Display::return_icon('lock.png', get_lang('Unlock'), array(), ICON_SIZE_SMALL).'</a>';
1062
    }
1063
    if ($current_lock_status == '0') {
1064
        $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&';
1065
        if (is_array($additional_url_parameters)) {
1066
            foreach ($additional_url_parameters as $key => $value) {
1067
                $html .= $key . '=' . $value . '&';
1068
            }
1069
        }
1070
        $html .= 'action=lock&content=' . $content . '&id=' . $id . '">' .
1071
            Display::return_icon('unlock.png', get_lang('Lock'), array(), ICON_SIZE_SMALL) . '</a>';
1072
    }
1073
1074
    return $html;
1075
}