Documentation

GetShowIncludeAreas

bool
CMain::GetShowIncludeAreas()

The method returns true if the 'Show included areas' button is checked on the control toolbar, or false otherwise. Non-static method.

Parameters


No parameters.

See Also

Examples of use

<?
$text = "Some HTML";

// if the "Show included areas" is clicked...
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 a frame,
    // 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 
// 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;
}
?>


© «Bitrix24», 2001-2024
Up