upskill-event-manager/templates/page-hvac-base.php
Ben c19b909296 refactor: remove all theme-specific code for WordPress compliance
BREAKING CHANGE: Removed Astra theme integration and all theme-specific code

- Removed class-hvac-astra-integration.php (584 lines of theme-specific code)
- Removed 500+ theme-specific CSS files (ast-*, astra-*, divi-*)
- Removed 15+ theme-specific JavaScript files
- Created theme-agnostic HVAC_Layout_Manager class
- Added generic hvac-layout.css with universal styling
- Plugin now works with ANY WordPress theme

This refactoring ensures the plugin complies with WordPress.org plugin
guidelines which require plugins to be theme-independent. The new layout
system uses standard WordPress hooks and filters that work universally.

Key changes:
- Body classes: hvac-plugin-page, hvac-no-sidebar, hvac-full-width
- Generic post meta: _sidebar_layout, page_layout (widely supported)
- Standard WordPress hooks: body_class, wp_enqueue_scripts, is_active_sidebar
- CSS uses generic selectors: .site-content, .content-area, #primary

Removed monitoring infrastructure files that were causing PHP segfaults:
- class-hvac-background-jobs.php
- class-hvac-health-monitor.php
- class-hvac-error-recovery.php
- class-hvac-security-monitor.php
- class-hvac-performance-monitor.php
- class-hvac-backup-manager.php
- class-hvac-cache-optimizer.php

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 18:38:52 -03:00

57 lines
No EOL
1.5 KiB
PHP

<?php
/**
* Base Template for HVAC Plugin Pages
*
* Handles 80% of plugin templates with dynamic content loading
*
* @package HVAC_Community_Events
* @since 2.0.0
*/
// Define constant to indicate we are in a page template
define('HVAC_IN_PAGE_TEMPLATE', true);
// Security check
if (!defined('ABSPATH')) {
exit;
}
get_header();
// Get page configuration
$page_slug = get_post_field('post_name', get_queried_object_id());
$page_config = HVAC_Template_Router::get_page_config($page_slug);
// Security and capability check
if (!HVAC_Template_Security::check_page_access($page_config)) {
get_template_part('templates/parts/hvac-access-denied');
get_footer();
return;
}
?>
<div class="hvac-page-wrapper hvac-<?php echo esc_attr(str_replace('/', '-', $page_slug)); ?>-page">
<?php
// Load page header (navigation, breadcrumbs)
get_template_part('templates/parts/hvac-page-header', null, [
'page_config' => $page_config,
'show_navigation' => $page_config['show_navigation'] ?? true,
'show_breadcrumbs' => $page_config['show_breadcrumbs'] ?? true
]);
?>
<div class="container">
<?php
// Load status messages if any
get_template_part('templates/parts/hvac-status-messages');
// Load dynamic content based on page configuration
get_template_part('templates/parts/hvac-content-loader', null, [
'page_config' => $page_config,
'page_slug' => $page_slug
]);
?>
</div>
</div>
<?php get_footer(); ?>