Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

@@ 212-229 (lines=18) @@
209
}
210
211
// access_url == 1 is the default chamilo location
212
if ($_configuration['access_url'] != 1) {
213
    $url_info = api_get_access_url($_configuration['access_url']);
214
    if ($url_info['active'] == 1) {
215
        $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
216
        foreach ($settings_by_access as & $row) {
217
            if (empty($row['variable'])) {
218
                $row['variable'] = 0;
219
            }
220
            if (empty($row['subkey'])) {
221
                $row['subkey'] = 0;
222
            }
223
            if (empty($row['category'])) {
224
                $row['category'] = 0;
225
            }
226
            $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
227
        }
228
    }
229
}
230
231
$result = & api_get_settings(null, 'list', 1);
232
foreach ($result as & $row) {

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

@@ 7199-7216 (lines=18) @@
7196
    // access_url == 1 is the default chamilo location
7197
    $settings_by_access_list = array();
7198
    $access_url_id = api_get_current_access_url_id();
7199
    if ($access_url_id != 1) {
7200
        $url_info = api_get_access_url($_configuration['access_url']);
7201
        if ($url_info['active'] == 1) {
7202
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
7203
            foreach ($settings_by_access as & $row) {
7204
                if (empty($row['variable'])) {
7205
                    $row['variable'] = 0;
7206
                }
7207
                if (empty($row['subkey'])) {
7208
                    $row['subkey'] = 0;
7209
                }
7210
                if (empty($row['category'])) {
7211
                    $row['category'] = 0;
7212
                }
7213
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
7214
            }
7215
        }
7216
    }
7217
7218
    $result = api_get_settings(null, 'list', 1);
7219