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

@@ 7104-7121 (lines=18) @@
7101
    // access_url == 1 is the default chamilo location
7102
    $settings_by_access_list = array();
7103
    $access_url_id = api_get_current_access_url_id();
7104
    if ($access_url_id != 1) {
7105
        $url_info = api_get_access_url($_configuration['access_url']);
7106
        if ($url_info['active'] == 1) {
7107
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
7108
            foreach ($settings_by_access as & $row) {
7109
                if (empty($row['variable'])) {
7110
                    $row['variable'] = 0;
7111
                }
7112
                if (empty($row['subkey'])) {
7113
                    $row['subkey'] = 0;
7114
                }
7115
                if (empty($row['category'])) {
7116
                    $row['category'] = 0;
7117
                }
7118
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
7119
            }
7120
        }
7121
    }
7122
7123
    $result = api_get_settings(null, 'list', 1);
7124