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

@@ 6928-6945 (lines=18) @@
6925
    // access_url == 1 is the default chamilo location
6926
    $settings_by_access_list = array();
6927
    $access_url_id = api_get_current_access_url_id();
6928
    if ($access_url_id != 1) {
6929
        $url_info = api_get_access_url($_configuration['access_url']);
6930
        if ($url_info['active'] == 1) {
6931
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
6932
            foreach ($settings_by_access as & $row) {
6933
                if (empty($row['variable'])) {
6934
                    $row['variable'] = 0;
6935
                }
6936
                if (empty($row['subkey'])) {
6937
                    $row['subkey'] = 0;
6938
                }
6939
                if (empty($row['category'])) {
6940
                    $row['category'] = 0;
6941
                }
6942
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
6943
            }
6944
        }
6945
    }
6946
6947
    $result = api_get_settings(null, 'list', 1);
6948