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

@@ 7185-7202 (lines=18) @@
7182
    // access_url == 1 is the default chamilo location
7183
    $settings_by_access_list = array();
7184
    $access_url_id = api_get_current_access_url_id();
7185
    if ($access_url_id != 1) {
7186
        $url_info = api_get_access_url($_configuration['access_url']);
7187
        if ($url_info['active'] == 1) {
7188
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
7189
            foreach ($settings_by_access as & $row) {
7190
                if (empty($row['variable'])) {
7191
                    $row['variable'] = 0;
7192
                }
7193
                if (empty($row['subkey'])) {
7194
                    $row['subkey'] = 0;
7195
                }
7196
                if (empty($row['category'])) {
7197
                    $row['category'] = 0;
7198
                }
7199
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
7200
            }
7201
        }
7202
    }
7203
7204
    $result = api_get_settings(null, 'list', 1);
7205