Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

@@ 224-241 (lines=18) @@
221
}
222
223
// access_url == 1 is the default chamilo location
224
if ($_configuration['access_url'] != 1) {
225
    $url_info = api_get_access_url($_configuration['access_url']);
226
    if ($url_info['active'] == 1) {
227
        $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
228
        foreach ($settings_by_access as & $row) {
229
            if (empty($row['variable'])) {
230
                $row['variable'] = 0;
231
            }
232
            if (empty($row['subkey'])) {
233
                $row['subkey'] = 0;
234
            }
235
            if (empty($row['category'])) {
236
                $row['category'] = 0;
237
            }
238
            $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
239
        }
240
    }
241
}
242
243
$result = & api_get_settings(null, 'list', 1);
244
foreach ($result as & $row) {

main/inc/lib/api.lib.php 1 location

@@ 7081-7098 (lines=18) @@
7078
    // access_url == 1 is the default chamilo location
7079
    $settings_by_access_list = array();
7080
    $access_url_id = api_get_current_access_url_id();
7081
    if ($access_url_id != 1) {
7082
        $url_info = api_get_access_url($_configuration['access_url']);
7083
        if ($url_info['active'] == 1) {
7084
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
7085
            foreach ($settings_by_access as & $row) {
7086
                if (empty($row['variable'])) {
7087
                    $row['variable'] = 0;
7088
                }
7089
                if (empty($row['subkey'])) {
7090
                    $row['subkey'] = 0;
7091
                }
7092
                if (empty($row['category'])) {
7093
                    $row['category'] = 0;
7094
                }
7095
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
7096
            }
7097
        }
7098
    }
7099
7100
    $result = api_get_settings(null, 'list', 1);
7101