Code Duplication    Length = 18-18 lines in 2 locations

main/inc/global.inc.php 1 location

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

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

@@ 7123-7140 (lines=18) @@
7120
    // access_url == 1 is the default chamilo location
7121
    $settings_by_access_list = array();
7122
    $access_url_id = api_get_current_access_url_id();
7123
    if ($access_url_id != 1) {
7124
        $url_info = api_get_access_url($_configuration['access_url']);
7125
        if ($url_info['active'] == 1) {
7126
            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
7127
            foreach ($settings_by_access as & $row) {
7128
                if (empty($row['variable'])) {
7129
                    $row['variable'] = 0;
7130
                }
7131
                if (empty($row['subkey'])) {
7132
                    $row['subkey'] = 0;
7133
                }
7134
                if (empty($row['category'])) {
7135
                    $row['category'] = 0;
7136
                }
7137
                $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']] = $row;
7138
            }
7139
        }
7140
    }
7141
7142
    $result = api_get_settings(null, 'list', 1);
7143