Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

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

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

@@ 6943-6960 (lines=18) @@
6940
    // access_url == 1 is the default chamilo location
6941
    $settings_by_access_list = array();
6942
    $access_url_id = api_get_current_access_url_id();
6943
    if ($access_url_id != 1) {
6944
        $url_info = api_get_access_url($_configuration['access_url']);
6945
        if ($url_info['active'] == 1) {
6946
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
6947
            foreach ($settings_by_access as & $row) {
6948
                if (empty($row['variable'])) {
6949
                    $row['variable'] = 0;
6950
                }
6951
                if (empty($row['subkey'])) {
6952
                    $row['subkey'] = 0;
6953
                }
6954
                if (empty($row['category'])) {
6955
                    $row['category'] = 0;
6956
                }
6957
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
6958
            }
6959
        }
6960
    }
6961
6962
    $result = api_get_settings(null, 'list', 1);
6963