Code Duplication    Length = 12-12 lines in 2 locations

main/admin/add_courses_to_usergroup.php 1 location

@@ 154-165 (lines=12) @@
151
        } else {
152
            $list = CourseManager::get_courses_list(0, 0, 2, 'ASC', -1, $needle);
153
        }
154
        if ($type=='single') {
155
        } else {
156
            $return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">';
157
158
            foreach ($list as $row) {
159
                if (!in_array($row['id'], array_keys($elements_in))) {
160
                    $return .= '<option value="'.$row['id'].'">'.$row['title'].' ('.$row['visual_code'].')</option>';
161
                }
162
            }
163
            $return .= '</select>';
164
            $xajax_response->addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
165
        }
166
    }
167
    return $xajax_response;
168
}

main/admin/add_sessions_to_usergroup.php 1 location

@@ 145-156 (lines=12) @@
142
            );
143
        }
144
        $i=0;
145
        if ($type=='single') {
146
        } else {
147
            $return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">';
148
149
            foreach ($session_list as $row ) {
150
                if (!in_array($row['id'], array_keys($elements_in))) {
151
                    $return .= '<option value="'.$row['id'].'">'.$row['name'].'</option>';
152
                }
153
            }
154
            $return .= '</select>';
155
            $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
156
        }
157
    }
158
159
    return $xajax_response;