loadContextMenuAssets(); // define the default events if (!isset($events) || !is_array($events)) { $events = []; } $events['filter_status'] = $events['filter_status'] ?? 'vbo-tm-apply-filters'; // get current filters $filters = (array) ($filters ?? []); // access the task manager $taskManager = VBOFactory::getTaskManager(); // make TASK_MANAGER_STATUSES var global JHtml::fetch('vbohtml.tmscripts.statuses'); // find the active status, if any $activeStatus = []; foreach ($taskManager->getStatusGroupElements() as $groupId => $group) { // iterate over the statuses of this group foreach ($group['elements'] as $statusType) { // check if it's the active one if ($statusType['id'] == ($filters['statusId'] ?? null)) { // active status found $activeStatus = $statusType; } } } ?>