AddPanelButton
CMain::AddPanelButton( array button, array MenuItem )
The method adds a button to the Control panel. Non-static method.
Parameters
Parameter | Description | Available from version |
---|---|---|
button | Array describing the added button. Array keys:
| |
MenuItem | Menu array |
See Also
Examples of use
<? // get access permission to Web forms module $FORM_RIGHT = $APPLICATION->GetUserRight("form"); // if the access permission is available if($FORM_RIGHT>"D"): // add a button to the control panel leading to the list of web forms $APPLICATION->AddPanelButton(array( "HREF" => "/bitrix/admin/form_list.php", "SRC" => "/bitrix/images/fileman/panel/web_form.gif", "ALT" => "Edit Web from", "MAIN_SORT" => 400, "SORT" => 100 )); endif; ?>
Icon submenu (via the example of sticker button):
MENU => Array( [0] => Array( [TEXT] => <div style="float: left; margin: 0 50px 0 0;">Post the stricker</div> [TITLE] => Post the new sticker on the page [ICON] => [ACTION] => if (wind ow .oBXSticker){window .oBXSticker.AddSticker();} [DEFAULT] => 1 [HK_ID] => FMST_PANEL_STICKER_ADD ) [1] => Array( [SEPARATOR] => 1 ) )
© «Bitrix24», 2001-2024