Code Duplication    Length = 18-18 lines in 2 locations

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

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

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) {