Code Duplication    Length = 10-10 lines in 4 locations

main/forum/forumfunction.inc.php 4 locations

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