Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

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

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

@@ 6876-6893 (lines=18) @@
6873
    // access_url == 1 is the default chamilo location
6874
    $settings_by_access_list = array();
6875
    $access_url_id = api_get_current_access_url_id();
6876
    if ($access_url_id != 1) {
6877
        $url_info = api_get_access_url($_configuration['access_url']);
6878
        if ($url_info['active'] == 1) {
6879
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
6880
            foreach ($settings_by_access as & $row) {
6881
                if (empty($row['variable'])) {
6882
                    $row['variable'] = 0;
6883
                }
6884
                if (empty($row['subkey'])) {
6885
                    $row['subkey'] = 0;
6886
                }
6887
                if (empty($row['category'])) {
6888
                    $row['category'] = 0;
6889
                }
6890
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
6891
            }
6892
        }
6893
    }
6894
6895
    $result = api_get_settings(null, 'list', 1);
6896