Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

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

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

@@ 7119-7136 (lines=18) @@
7116
    // access_url == 1 is the default chamilo location
7117
    $settings_by_access_list = array();
7118
    $access_url_id = api_get_current_access_url_id();
7119
    if ($access_url_id != 1) {
7120
        $url_info = api_get_access_url($_configuration['access_url']);
7121
        if ($url_info['active'] == 1) {
7122
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
7123
            foreach ($settings_by_access as & $row) {
7124
                if (empty($row['variable'])) {
7125
                    $row['variable'] = 0;
7126
                }
7127
                if (empty($row['subkey'])) {
7128
                    $row['subkey'] = 0;
7129
                }
7130
                if (empty($row['category'])) {
7131
                    $row['category'] = 0;
7132
                }
7133
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
7134
            }
7135
        }
7136
    }
7137
7138
    $result = api_get_settings(null, 'list', 1);
7139