Code Duplication    Length = 10-10 lines in 4 locations

main/forum/forumfunction.inc.php 4 locations

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