Documentation

Add

CAdminNotify::Add(
 MESSAGE,
 TAG,
 MODULE_ID,
 ENABLE_CLOSE,
);

The method adds notification. Non-static method.

Array keys

Keys Description
MESSAGE Free text that supports the following tags BR, B, U, I, SPAN A (The last two can support style).
TAG Notification tag for quick deletion (optional field).

Note: If two notifications with the same tag are added (empty tag is not considered) only the last notification is kept.

MODULE_ID Module that sent notification (optional field).
ENABLE_CLOSE Enables for administrator to close notification via UI (optional; enabled by default). Otherwise, deleting via API is required .
LANG Array of localizations. Optional.
"LANG" => array(  
   "language_code" => "message"
)
NOTIFY_TYPE Optional. By default, prints a green color notification. When array contains this parameter with the value E, the notification will be a warning red.

Returned value

ID of created notification is required.

Example

$ar = Array(
   "MESSAGE" => 'You have updated Web Messenger module. To work with messages you must <a href="#">convert the data</a>.',
   "TAG" => "IM_CONVERT",
   "MODULE_ID" => "IM",
   "ENABLE_CLOSE" => "N"
);
$ID = CAdminNotify::Add($ar);


© «Bitrix24», 2001-2024
Up