ACP Dashboard Boxes#
ACP Dashboard Boxes are displayed on the landing page of the admin panel and can provide the user with useful information. A box consists of an internal identifier, a name and the content of the box. The content can contain HTML code.
Create a Custom Box#
A custom box can be created with a custom PHP class that needs to implement the wcf\system\acp\dashboard\box\IAcpDashboardBox
interface.
It is recommended to extend the class wcf\system\acp\dashboard\box\AbstractAcpDashboardBox
, which already provides a basic implementation of the interface.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Register a Custom Box#
You can attach an event listener to the wcf\event\acp\dashboard\box\BoxCollecting
event inside a bootstrap script to lazily register custom boxes.
The class name of the box is registered using the event’s register()
method:
files/lib/bootstrap/com.example.bar.php | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|