Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 2510-2518 (lines=9) @@
2507
function api_get_setting($variable, $key = null)
2508
{
2509
    global $_setting;
2510
    if ($variable == 'header_extra_content') {
2511
        $filename = api_get_path(SYS_PATH).api_get_home_path().'header_extra_content.txt';
2512
        if (file_exists($filename)) {
2513
            $value = file_get_contents($filename);
2514
            return $value ;
2515
        } else {
2516
            return '';
2517
        }
2518
    }
2519
    if ($variable == 'footer_extra_content') {
2520
        $filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
2521
        if (file_exists($filename)) {
@@ 2519-2527 (lines=9) @@
2516
            return '';
2517
        }
2518
    }
2519
    if ($variable == 'footer_extra_content') {
2520
        $filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
2521
        if (file_exists($filename)) {
2522
            $value = file_get_contents($filename);
2523
            return $value ;
2524
        } else {
2525
            return '';
2526
        }
2527
    }
2528
    $value = null;
2529
    if (is_null($key)) {
2530
        $value = ((isset($_setting[$variable]) && $_setting[$variable] != '') ? $_setting[$variable] : null);