Bitrix Site Manager

CMain::GetShowIncludeAreas

bool
CMain::GetShowIncludeAreas()

The method GetShowIncludeAreas returns true if the button Show include areas is checked on the control toolbar, or false otherwise.

Parameters

No parameters.

See Also

Example



<?
$text = "Some HTML";

// if Show include areas is on...
if ($APPLICATION->GetShowIncludeAreas())
{
    $arIcons = Array();
    $arIcons[] =
            Array(
                "URL" => "/bitrix/admin/my_script1.php",
                "SRC" => "/images/my_icon1.gif",
                "ALT" => "tooltip text"
            );
    $arIcons[] =
            Array(
                "URL" => "/bitrix/admin/my_script2.php",
                "SRC" => "/images/my_icon2.gif",
                "ALT" => "tooltip text"
            );

    // print text "Some HTML" in border,
    // with images my_icon1.gif and my_icon2.gif in the top right corner
    // with links to scripts my_script1.php and my_script2.php

    echo $APPLICATION->IncludeString($text, $arIcons);
}
else 
{
    // otherwise, just print "Some HTML"
    echo $text;
}
?>
<?
// file /bitrix/modules/advertising/classes/general/advertising.php 
// class CAdvBanner

// returns HTML code of a banner by type
function Show($TYPE_SID, $HTML_BEFORE="", $HTML_AFTER="")
{
    global $APPLICATION, $USER;
    $arBanner = CAdvBanner::GetRandom($TYPE_SID);
    $strReturn = CAdvBanner::GetHTML($arBanner);
    if (strlen($strReturn)>0)
    {
        CAdvBanner::FixShow($arBanner);
        if ($APPLICATION->GetShowIncludeAreas())
        {
            $isDemo = CAdvContract::IsDemo();
            $arrPERM = CAdvContract::GetUserPermissions($arBanner["CONTRACT_ID"]);
            if (($isDemo || 
                (is_array($arrPERM) && 
                count($arrPERM)>0)) && 
                $USER->IsAuthorized())
            {
                $arIcons = Array();
                $arIcons[] =
                        Array(
                            "URL" => "/bitrix/admin/adv_banner_edit.php?lang=".
                                     LANGUAGE_ID."&ID=".$arBanner["ID"]. 
                                     "&CONTRACT_ID=".$arBanner["CONTRACT_ID"],
                            "SRC" => "/bitrix/images/advertising/panel/edit_ad.gif",
                            "ALT" => GetMessage("AD_PUBLIC_ICON_EDIT_BANNER")
                        );
                $arIcons[] =
                        Array(
                            "URL" => "/bitrix/admin/adv_banner_list.php?lang=".
                                     LANGUAGE_ID."&find_id=".$arBanner["ID"]. 
                                     "&find_id_exact_match=Y&find_contract_id[]=".
                                     $arBanner["CONTRACT_ID"]. 
                                     "&find_type_sid[]=".
                                     $arBanner["TYPE_SID"]."&set_filter=Y",
                            "SRC" => "/bitrix/images/advertising/panel/edit_ad_list.gif",
                            "ALT" => GetMessage("AD_PUBLIC_ICON_BANNER_LIST")
                        );
                $strReturn = $APPLICATION->IncludeString($strReturn, $arIcons);
            }
        }
        $strReturn = $HTML_BEFORE.$strReturn.$HTML_AFTER;
        return $strReturn;
    }
    else return false;
}
?>