Bitrix Site Manager

CMain::AddPanelButton

CMain::AddPanelButton(
 array button
)

The method AddPanelButton adds a button to the control toolbar.

Parameters

ParameterDescription
button Array describing a button. The array has the following keys:
  • HREF - hyperlink assigned to a button;
  • SRC - path to an image file from the site root;
  • ALT - tooltip text to be assigned to a button;
  • MAIN_SORT - sort index for a single group of buttons. The standard groups have the following indices:
    • 100 - Site Explorer buttons;
    • 200 - Workflow buttons;
    • 300 - Information Blocks buttons.
  • SORT - button sort index within a group.
If you want to display a button even if a user has not enough permissions for an operation, leave the HREF field empty. The button will be displayed desaturated without a link assigned.

See Also

Example



<?
// obtain the current access permissions to the Web Forms module
$FORM_RIGHT = $APPLICATION->GetUserRight("form");
// if we can access - 
if($FORM_RIGHT>"D"):
    // add a button that opens a list of web forms
    $APPLICATION->AddPanelButton(array(
        "HREF"      => "/bitrix/admin/form_list.php", 
        "SRC"       => "/bitrix/images/fileman/panel/web_form.gif", 
        "ALT"       => "Edit web form", 
        "MAIN_SORT" => 400, 
        "SORT"      => 100
    ));
endif;
?>