Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 2501-2509 (lines=9) @@
2498
function api_get_setting($variable, $key = null)
2499
{
2500
    global $_setting;
2501
    if ($variable == 'header_extra_content') {
2502
        $filename = api_get_path(SYS_PATH).api_get_home_path().'header_extra_content.txt';
2503
        if (file_exists($filename)) {
2504
            $value = file_get_contents($filename);
2505
            return $value ;
2506
        } else {
2507
            return '';
2508
        }
2509
    }
2510
    if ($variable == 'footer_extra_content') {
2511
        $filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
2512
        if (file_exists($filename)) {
@@ 2510-2518 (lines=9) @@
2507
            return '';
2508
        }
2509
    }
2510
    if ($variable == 'footer_extra_content') {
2511
        $filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
2512
        if (file_exists($filename)) {
2513
            $value = file_get_contents($filename);
2514
            return $value ;
2515
        } else {
2516
            return '';
2517
        }
2518
    }
2519
    $value = null;
2520
    if (is_null($key)) {
2521
        $value = ((isset($_setting[$variable]) && $_setting[$variable] != '') ? $_setting[$variable] : null);