- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/admin_notify.php
- Класс: CAdminNotify
- Вызов: CAdminNotify::GetHtml
static function GetHtml()
{
global $CACHE_MANAGER;
$arNotify = false;
if ($CACHE_MANAGER->Read(86400, "admin_notify_list_" . LANGUAGE_ID))
{
$arNotify = $CACHE_MANAGER->Get("admin_notify_list_" . LANGUAGE_ID);
}
if ($arNotify === false)
{
$arNotify = [];
$CBXSanitizer = new CBXSanitizer;
$CBXSanitizer->AddTags([
'a' => ['href', 'style'],
'b' => [],
'u' => [],
'i' => [],
'br' => [],
'span' => ['style'],
]);
$dbRes = self::GetList();
while ($ar = $dbRes->Fetch())
{
$ar["MESSAGE"] = $CBXSanitizer->SanitizeHtml(('' != $ar['MESSAGE_LANG'] ? $ar['MESSAGE_LANG'] : $ar['MESSAGE']));
$arNotify[] = $ar;
}
$CACHE_MANAGER->Set("admin_notify_list_" . LANGUAGE_ID, $arNotify);
}
$html = "";
foreach ($arNotify as $value)
{
$className = ($value['NOTIFY_TYPE'] == self::TYPE_ERROR ? 'adm-warning-block adm-warning-block-red' : 'adm-warning-block');
$html .= '' . $value['MESSAGE'] . '' . ($value['ENABLE_CLOSE'] == 'Y' ? '' : '') . '
';
}
return $html;
}