| 1 |
<?php if (!defined('ABSPATH')) { exit;} // Exit if accessed directly ?> |
| 2 |
<?php |
| 3 |
/** |
| 4 |
* @var string $title |
| 5 |
* @var string $description |
| 6 |
* @var string $url |
| 7 |
* @var string $og_title |
| 8 |
* @var string $featured_image |
| 9 |
* @var array $css_files |
| 10 |
* @var array $js_files |
| 11 |
* @var array $js_vars |
| 12 |
* @var string $scope |
| 13 |
* @var string $layout |
| 14 |
* @var array $portal |
| 15 |
*/ |
| 16 |
$fluentCommunityTitle = $title ?? ''; |
| 17 |
$fluentCommunityDescription = $description ?? ''; |
| 18 |
$fluentCommunityUrl = $url ?? ''; |
| 19 |
$fluentCommunityOgTitle = $og_title ?? ''; |
| 20 |
$fluentCommunityFeaturedImage = $featured_image ?? ''; |
| 21 |
$fluentCommunityCssFiles = $css_files ?? []; |
| 22 |
$fluentCommunityJsFiles = $js_files ?? []; |
| 23 |
$fluentCommunityJsVars = $js_vars ?? []; |
| 24 |
$fluentCommunityScope = $scope ?? ''; |
| 25 |
$fluentCommunityLayout = $layout ?? ''; |
| 26 |
$fluentCommunityPortal = $portal ?? []; |
| 27 |
?> |
| 28 |
<!DOCTYPE html> |
| 29 |
<html <?php language_attributes(); ?>> |
| 30 |
<head> |
| 31 |
<title><?php echo esc_attr($fluentCommunityTitle); ?></title> |
| 32 |
<meta charset="<?php bloginfo('charset'); ?>"> |
| 33 |
<meta name="description" content="<?php echo esc_attr($fluentCommunityDescription); ?>"> |
| 34 |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover,interactive-widget=resizes-content"/> |
| 35 |
<?php |
| 36 |
if (!empty($load_wp)) : |
| 37 |
wp_head(); |
| 38 |
else: |
| 39 |
?> |
| 40 |
<meta name="mobile-web-app-capable" content="yes"> |
| 41 |
<meta name="robots" content="noindex"> |
| 42 |
<link rel="icon" type="image/x-icon" href="<?php echo esc_url(get_site_icon_url()); ?>"/> |
| 43 |
<meta property="og:type" content="website"> |
| 44 |
<meta property="og:url" content="<?php echo esc_url($fluentCommunityUrl); ?>"> |
| 45 |
<meta property="og:site_name" content="<?php bloginfo('name'); ?>"> |
| 46 |
<meta property="og:title" content="<?php echo esc_attr($fluentCommunityOgTitle); ?>"> |
| 47 |
<meta property="og:description" content="<?php echo esc_attr($fluentCommunityDescription); ?>"> |
| 48 |
<?php endif; ?> |
| 49 |
|
| 50 |
<?php if ($fluentCommunityFeaturedImage): ?> |
| 51 |
<meta property="og:image" content="<?php echo esc_url($fluentCommunityFeaturedImage); ?>"/> |
| 52 |
<?php endif; ?> |
| 53 |
|
| 54 |
<style> |
| 55 |
.fluent_com, .fcom_full_layout { |
| 56 |
display: block; |
| 57 |
width: 100%; |
| 58 |
} |
| 59 |
</style> |
| 60 |
|
| 61 |
<?php do_action('fluent_community/headless/head_early', $fluentCommunityScope); ?> |
| 62 |
|
| 63 |
<?php foreach ($fluentCommunityCssFiles as $fluentCommunityCssFile): ?> |
| 64 |
<link rel="stylesheet" href="<?php echo esc_url($fluentCommunityCssFile); ?>?version=<?php echo esc_attr(FLUENT_COMMUNITY_PLUGIN_VERSION); ?>" media="screen"/> <?php // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet ?> |
| 65 |
<?php endforeach; ?> |
| 66 |
<?php do_action('fluent_community/headless/head', $fluentCommunityScope); ?> |
| 67 |
</head> |
| 68 |
<body class="fcom_headless_page fcom_headless_scope_<?php echo esc_attr($fluentCommunityScope); ?>"> |
| 69 |
|
| 70 |
<?php if ($fluentCommunityLayout == 'signup'): ?> |
| 71 |
<div class="fcom_full_layout fluent_com_auth <?php echo $fluentCommunityPortal['position'] == 'right' ? ' fcom_auth_page_row_reverse' : ' fcom_auth_page'; ?>"> |
| 72 |
<div class="fcom_layout_side" |
| 73 |
style="<?php if (!empty($fluentCommunityPortal['background_image'])) { echo 'background-image: url(' . esc_url($fluentCommunityPortal['background_image']) . ');';} ?> |
| 74 |
<?php if (!empty($fluentCommunityPortal['background_color'])) { echo 'background-color: ' . esc_attr($fluentCommunityPortal['background_color']) . ';';} ?> |
| 75 |
display: <?php echo $fluentCommunityPortal['hidden'] ? 'none' : 'flex'; ?>"> |
| 76 |
<div class="fcom_welcome"> |
| 77 |
<?php if (!empty($fluentCommunityPortal['logo'])): ?> |
| 78 |
<div class="fcom_logo"> |
| 79 |
<a href="<?php echo esc_url(\FluentCommunity\App\Services\Helper::baseUrl()); ?>"> |
| 80 |
<img src="<?php echo esc_url($fluentCommunityPortal['logo']); ?>" alt="<?php echo esc_attr__('Site logo', 'fluent-community'); ?>"> |
| 81 |
</a> |
| 82 |
</div> |
| 83 |
<?php endif; ?> |
| 84 |
<h2 class="fcom_title" style="color: <?php echo esc_attr(!empty($fluentCommunityPortal['title_color']) ? $fluentCommunityPortal['title_color'] : 'var(--fcom_text_color, #606266)'); ?>"> |
| 85 |
<?php echo wp_kses_post($fluentCommunityPortal['title']); ?> |
| 86 |
</h2> |
| 87 |
<div class="fcom_sub_title" style="color: <?php echo esc_attr(!empty($fluentCommunityPortal['text_color']) ? $fluentCommunityPortal['text_color'] : 'var(--fcom_text_color, #606266)'); ?>"> |
| 88 |
<p><?php echo wp_kses_post($fluentCommunityPortal['description']); ?></p> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
<div class="fcom_layout_main" style="<?php if (!empty($fluentCommunityPortal['form']['background_image'])): ?>background-image: url(<?php echo esc_url($fluentCommunityPortal['form']['background_image']); ?>);<?php endif; ?>"> |
| 93 |
<div class="fluent_com fluent_com_auth"> |
| 94 |
<?php do_action('fluent_community/headless/content', $fluentCommunityScope); ?> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<?php else: ?> |
| 99 |
<div class="fluent_com"> |
| 100 |
<?php do_action('fluent_community/headless/content', $fluentCommunityScope); ?> |
| 101 |
</div> |
| 102 |
<?php endif; ?> |
| 103 |
|
| 104 |
<script> |
| 105 |
<?php foreach ($fluentCommunityJsVars as $fluentCommunityVarKey => $fluentCommunityValues): ?> |
| 106 |
var <?php echo esc_attr($fluentCommunityVarKey); ?> = <?php echo wp_json_encode($fluentCommunityValues); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; |
| 107 |
<?php endforeach; ?> |
| 108 |
</script> |
| 109 |
|
| 110 |
<?php do_action('fluent_community/headless/before_js_loaded', $fluentCommunityScope); ?> |
| 111 |
|
| 112 |
<?php foreach ($fluentCommunityJsFiles as $fluentCommunityFile): ?> |
| 113 |
<script type="module" src="<?php echo esc_url(\FluentCommunity\App\Vite::versionedUrl($fluentCommunityFile)); ?>" defer="defer"></script> <?php // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript ?> |
| 114 |
<?php endforeach; ?> |
| 115 |
|
| 116 |
<?php if (!empty($load_wp)) { wp_footer(); } ?> |
| 117 |
|
| 118 |
<?php do_action('fluent_community/headless/footer', $fluentCommunityScope); ?> |
| 119 |
</body> |
| 120 |
</html> |
| 121 |
|