Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

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

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

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