Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 6983-7000 (lines=18) @@
6980
    // access_url == 1 is the default chamilo location
6981
    $settings_by_access_list = array();
6982
    $access_url_id = api_get_current_access_url_id();
6983
    if ($access_url_id != 1) {
6984
        $url_info = api_get_access_url($_configuration['access_url']);
6985
        if ($url_info['active'] == 1) {
6986
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
6987
            foreach ($settings_by_access as & $row) {
6988
                if (empty($row['variable'])) {
6989
                    $row['variable'] = 0;
6990
                }
6991
                if (empty($row['subkey'])) {
6992
                    $row['subkey'] = 0;
6993
                }
6994
                if (empty($row['category'])) {
6995
                    $row['category'] = 0;
6996
                }
6997
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
6998
            }
6999
        }
7000
    }
7001
7002
    $result = api_get_settings(null, 'list', 1);
7003

main/inc/global.inc.php 1 location

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