Code Duplication    Length = 10-10 lines in 4 locations

main/forum/forumfunction.inc.php 4 locations

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