Code Duplication    Length = 9-9 lines in 2 locations

main/inc/lib/api.lib.php 2 locations

@@ 2317-2325 (lines=9) @@
2314
function api_get_setting($variable, $key = null)
2315
{
2316
    global $_setting;
2317
    if ($variable == 'header_extra_content') {
2318
        $filename = api_get_path(SYS_PATH).api_get_home_path().'header_extra_content.txt';
2319
        if (file_exists($filename)) {
2320
            $value = file_get_contents($filename);
2321
            return $value ;
2322
        } else {
2323
            return '';
2324
        }
2325
    }
2326
    if ($variable == 'footer_extra_content') {
2327
        $filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
2328
        if (file_exists($filename)) {
@@ 2326-2334 (lines=9) @@
2323
            return '';
2324
        }
2325
    }
2326
    if ($variable == 'footer_extra_content') {
2327
        $filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
2328
        if (file_exists($filename)) {
2329
            $value = file_get_contents($filename);
2330
            return $value ;
2331
        } else {
2332
            return '';
2333
        }
2334
    }
2335
    $value = null;
2336
    if (is_null($key)) {
2337
        $value = ((isset($_setting[$variable]) && $_setting[$variable] != '') ? $_setting[$variable] : null);