'revisions-pro', // unique identifier * 'plugin' => 'revisions-pro', // owning plugin slug * 'label' => 'Revision History', // tooltip / display name * 'icon' => 'history', // Lucide icon name * 'contexts' => ['pages'], // where trigger button appears * 'priority' => 10, // sort order (higher = earlier) * 'width' => 900, // panel width in pixels * 'badgeEndpoint' => '/my-plugin/badge', // optional: returns { count: N } * ] */ class ContextPanelController extends AbstractApiController { /** * GET /context-panels — Collect context panel registrations from plugins. */ public function items(ServerRequestInterface $request): ResponseInterface { $this->requirePermission($request, 'api.access'); $event = new Event(['panels' => [], 'user' => $this->getUser($request)]); $this->grav->fireEvent('onApiContextPanels', $event); return ApiResponse::create($event['panels']); } }