konratnox
4/25/2017 - 10:19 AM

Функции буферизации

Функции буферизации

function openGraph()
{
    global $APPLICATION;

    if ($_SERVER['HTTPS'])
        $protocol = 'https';
    else
        $protocol = 'http';

    $title = $APPLICATION->GetTitle();


    $url = $protocol.'://' . SITE_SERVER_NAME.$APPLICATION->GetCurPage(false);
    if (!$ogImage = $APPLICATION->GetProperty("ogImage"))
        $ogImage = $protocol.'://' . SITE_SERVER_NAME . '/bitrix/templates/narhozstroy/img/logo.png';

    $output = "<meta property=\"og:title\" content=\"" . $title . "\" />\n";
    $output .= "<meta property=\"og:type\" content=\"website\" />\n";
    $output .= "<meta property=\"og:url\" content=\"" . $url . "\" />\n";
    $output .= "<meta property=\"og:image\" content=\"" . $ogImage . "\" />\n";

    return $output;
}

function contentWidth() {
    global $APPLICATION;
    if(strlen($APPLICATION->GetProperty('fullWidth')) > 0 || $APPLICATION->GetCurPage(true)==SITE_DIR."index.php" ) {
        return 'content';
    } else {
        return 'container';
    }
}

function showH1() {
    global $APPLICATION;
    if(strlen($APPLICATION->GetProperty('dontSHowH1')) > 0) {
        return false;
    } else {
        return '<h1 class="rbl">'.$APPLICATION->GetTitle(false).'</h1>';
    }
}