ActivitiesNavigationProvider
in package
Activities Navigation Provider Service
Purpose: Provides navigation items for the Activities plugin with dynamic badge support, permission-based visibility, and comprehensive workflow integration.
Core Responsibilities:
- Navigation Item Generation - Complete Activities plugin navigation structure
- Dynamic Badge Support - Real-time approval queue counts and notifications
- Permission Integration - Role-based navigation visibility
- Plugin State Management - Conditional navigation based on plugin availability
- Workflow Integration - Navigation items aligned with approval workflows
Architecture: This service replaces the event-driven navigation system (CallForNavHandler) with a more efficient and maintainable static provider pattern. It generates navigation items dynamically based on user permissions and current workflow state.
Navigation Categories:
- Personal Workflows: My Auth Queue with real-time badge counts
- Administrative Tools: Auth Queues management and oversight
- Configuration Management: Activity Groups and Activities administration
- Reporting Tools: Authorization analytics and compliance reports
Dynamic Features:
- Real-time approval queue badge counts
- Permission-based item visibility
- Active path highlighting for current context
- Icon-based visual navigation
- Hierarchical menu organization
Badge System Integration: Navigation items include dynamic badge support that displays real-time counts of pending approvals, providing immediate workflow status visibility to users with approval authority.
Permission Integration: Navigation items are filtered based on user permissions and plugin availability, ensuring users only see functionality they can access and use.
Performance Considerations:
- Static method design for efficient navigation generation
- Plugin availability checking to avoid unnecessary processing
- Lazy loading of badge counts through table method callbacks
- Efficient navigation structure for fast rendering
Usage Examples:
// Get navigation items for current user
$user = $this->Authentication->getIdentity();
$navigationItems = ActivitiesNavigationProvider::getNavigationItems($user);
// Navigation items include:
// - My Auth Queue (with real-time badge count)
// - Auth Queues (administrative oversight)
// - Activity Groups (configuration management)
// - Activities (activity management)
// - Activity Authorizations (reporting)
Integration Points:
- StaticHelpers::pluginEnabled() - Plugin availability checking
- AuthorizationApprovalsTable::memberAuthQueueCount() - Badge count calculation
- KMP Navigation System - Navigation item registration and rendering
- Bootstrap Icons - Icon-based visual navigation
Troubleshooting:
- Verify plugin is enabled in configuration
- Check user permissions for navigation item visibility
- Validate badge count methods are accessible
- Monitor navigation rendering performance
Tags
Table of Contents
Methods
- getNavigationItems() : array<string|int, mixed>
- Build the Activities plugin navigation structure with dynamic badges and permission-aware visibility.
Methods
getNavigationItems()
Build the Activities plugin navigation structure with dynamic badges and permission-aware visibility.
public
static getNavigationItems(Member $user[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
When the Activities plugin is disabled this returns an empty array. Otherwise it returns an array of associative navigation item definitions (labels, urls, icons, order, optional badge configuration and active path hints) suitable for rendering the Activities menu.
Parameters
- $user : Member
-
The current authenticated member used for personalization and badge calculations.
- $params : array<string|int, mixed> = []
-
Optional context parameters (currently unused).
Return values
array<string|int, mixed> —An array of navigation item definitions for the Activities plugin.