- Create authoritative DEPRECATED-FILES.md documenting 27+ deprecated files - Add deprecation notices to legacy templates (page-create-event.php, page-manage-event.php, page-edit-event.php) - Mark deprecated JavaScript files (hvac-event-form-templates.js) with migration paths - Add deprecation notices to 8 legacy test files with comprehensive explanations - Update Status.md to reflect completion of comprehensive event creation system v3.2.0 - Automated deprecation script for consistent messaging across files All deprecated functionality has been replaced by: - page-tec-create-event.php with AI assistance and native TEC integration - Comprehensive E2E testing framework with Page Object Model - Integrated template system with enhanced user experience - Modern responsive design with role-based permissions Scheduled for removal in v3.3 after transition period 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
65 lines
No EOL
1.8 KiB
PHP
65 lines
No EOL
1.8 KiB
PHP
<?php
|
|
/**
|
|
* HVAC Profile Template
|
|
*
|
|
* Unified template for profile viewing and editing
|
|
*
|
|
* @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();
|
|
|
|
// Determine if this is edit mode
|
|
$page_slug = get_post_field('post_name', get_queried_object_id());
|
|
$is_edit_mode = (strpos($page_slug, 'edit') !== false);
|
|
|
|
// Security check
|
|
if (!is_user_logged_in()) {
|
|
wp_safe_redirect(home_url('/community-login/'));
|
|
exit;
|
|
}
|
|
|
|
$user = wp_get_current_user();
|
|
if (!array_intersect(['hvac_trainer', 'hvac_master_trainer'], $user->roles) && !current_user_can('manage_options')) {
|
|
wp_die(__('Access denied. Trainer role required.', 'hvac-community-events'));
|
|
}
|
|
?>
|
|
|
|
<div class="hvac-page-wrapper hvac-profile-page <?php echo $is_edit_mode ? 'hvac-profile-edit' : 'hvac-profile-view'; ?>">
|
|
<?php
|
|
// Load page header (navigation, breadcrumbs)
|
|
get_template_part('templates/parts/hvac-page-header', null, [
|
|
'show_navigation' => true,
|
|
'show_breadcrumbs' => !$is_edit_mode, // Hide breadcrumbs in edit mode for cleaner UI
|
|
'page_config' => [
|
|
'menu_type' => in_array('hvac_master_trainer', $user->roles) ? 'master_trainer' : 'trainer'
|
|
]
|
|
]);
|
|
?>
|
|
|
|
<div class="container">
|
|
<?php
|
|
// Load status messages
|
|
get_template_part('templates/parts/hvac-status-messages');
|
|
|
|
if ($is_edit_mode) {
|
|
// Profile edit content
|
|
echo do_shortcode('[hvac_trainer_profile_edit]');
|
|
} else {
|
|
// Profile view content - use existing template content
|
|
get_template_part('templates/views/trainer-profile-view');
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php get_footer(); ?>
|