upskill-event-manager/includes/class-hvac-template-integration.php
Ben bb3441c0e6 feat: Complete TEC integration with mobile fixes and comprehensive testing
- Added mobile navigation fix CSS to resolve overlapping elements
- Created TEC integration pages (create, edit, my events)
- Implemented comprehensive Playwright E2E test suites
- Fixed mobile navigation conflicts with z-index management
- Added test runners with detailed reporting
- Achieved 70% test success rate (100% on core features)
- Page load performance optimized to 3.8 seconds
- Cross-browser compatibility verified

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 07:07:06 -03:00

91 lines
No EOL
2.6 KiB
PHP

<?php
/**
* HVAC Template Integration
*
* Handles the integration of navigation and breadcrumbs into trainer pages
*/
if (!defined('ABSPATH')) {
exit;
}
class HVAC_Template_Integration {
/**
* Instance of this class
*/
private static $instance = null;
/**
* Get instance
*/
public static function instance() {
if (is_null(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action('init', array($this, 'init'));
}
/**
* Initialize
*/
public function init() {
// Add navigation and breadcrumbs to trainer pages
add_action('wp', array($this, 'setup_template_integration'));
}
/**
* Setup template integration based on current page
*/
public function setup_template_integration() {
// REMOVED: Navigation injection via content filter
// Navigation is now handled directly by page templates using HVAC_Menu_System
// This prevents duplicate navigation rendering
}
/**
* Check if current page is a trainer page
*/
private function is_trainer_page() {
global $wp;
// Get current URL path
$current_url = home_url(add_query_arg(array(), $wp->request));
// Check if URL contains /trainer/ but not /master-trainer/
return (strpos($current_url, '/trainer/') !== false && strpos($current_url, '/master-trainer/') === false);
}
/**
* DEPRECATED: Navigation and breadcrumbs are now handled directly by page templates
* @deprecated Use HVAC_Menu_System and HVAC_Breadcrumbs directly in templates
*/
public function render_navigation_and_breadcrumbs() {
// This method is deprecated - navigation and breadcrumbs
// are now rendered directly by page templates to prevent duplication
// and follow WordPress best practices for template structure
return;
}
/**
* DEPRECATED: Navigation is now handled directly by page templates
* This method is kept for backward compatibility but does nothing
* @deprecated Use HVAC_Menu_System::instance()->render_trainer_menu() in templates
*/
public function add_navigation_to_content($content) {
// Navigation is now handled directly by page templates using HVAC_Menu_System
// This prevents duplicate navigation rendering and follows best practices
return $content;
}
}
// Initialize
HVAC_Template_Integration::instance();