Documentation

OnAdminListDisplay

void
Handler(
 object &list
);

The event OnAdminListDisplay is fired in the function CAdminList::Display() when list of elements is displayed in the administrative section. The event allows to modify a list object, specifically, to add custom group actions for the list elements, add commands to the action menu of list elements and etc.

Function parameters

Parameter Description
list Link to the CAdminList class object.

Return

Returned value is not used.

See Also

Example

<?
AddEventHandler("main", "OnAdminListDisplay", "MyOnAdminListDisplay");
public static function MyOnAdminListDisplay(&$list)
{
//add custom group action
if($list->table_id == "tbl_posting")
$list->arActions["status_draft"] = "Status: Draft";
}
//process custom action
AddEventHandler("main", "OnBeforeProlog", "MyOnBeforeProlog");
public static function MyOnBeforeProlog()
{
if($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "status_draft" && is_array($_POST["ID"]) && $GLOBALS["APPLICATION"]->GetCurPage() == "/bitrix/admin/posting_admin.php")
{
a if($GLOBALS["APPLICATION"]->GetGroupRight("subscribe") == "W" && check_bitrix_sessid())
{
if(CModule::IncludeModule("subscribe"))
{
$cPosting = new CPosting;
foreach($_POST["ID"] as $ID)
if(($ID = intval($ID)) > 0)
$cPosting->ChangeStatus($ID, "D");
}
}
}
}
?>


© «Bitrix24», 2001-2024
Up