Code Duplication    Length = 9-9 lines in 2 locations

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

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