<?php

/**
 * Render template for Sitemap block
 * 
 * @var array $attributes Block attributes
 * @var string $content Block content
 * @var WP_Block $block Block instance
 */

// Détecte si on est dans l'éditeur Gutenberg
$is_editor = defined('REST_REQUEST') && REST_REQUEST;
?>

<section class="sitemap content-section">
	<div class="sitemap__inner">
		<h1 class="sitemap__title"><?php echo __('Plan du site', "carhop"); ?></h1>

		<div class="carhop-menus website-menu-list">
			<?php switch_to_blog(1); ?>

			<h2 class="website-title title-small">Carhop</h2>
			<h3 class="menu-title sitemap__title"><?php echo __('Menu Principal', "carhop"); ?></h3>
			<?php
			wp_nav_menu(
				array(
					'container'       => 'false',
					'theme_location'  => 'primary',
					'li_class'        => 'menu-navlink',
					'fallback_cb'     => false,
					"menu_class"      => "sitemap__carhop-primary-menu",
				)
			); ?>

			<h3 class="menu-title sitemap__title"><?php echo __('Menu Secondaire', "carhop"); ?></h3>
			<?php
			wp_nav_menu(
				array(
					'container'       => 'false',
					'theme_location'  => 'secondary',
					'li_class'        => 'menu-navlink',
					'fallback_cb'     => false,
					"menu_class"      => "sitemap__carhop-secondary-menu",
				)
			); ?>

		</div>

		<div class="dynamiques-menus website-menu-list">
			<?php switch_to_blog(2); ?>
			<h2 class="website-title title-small">Dynamiques</h2>
			<h3 class="menu-title sitemap__title"><?php echo __('Menu Principal ', "carhop"); ?></h3>
			<?php
			wp_nav_menu(
				array(
					'container'       => 'false',
					'theme_location'  => 'primary',
					'li_class'        => 'menu-navlink',
					'fallback_cb'     => false,
					"menu_class"      => "sitemap__dynamiques-primary-menu",
				)
			); ?>


			<h3 class="menu-title sitemap__title"><?php echo __('Menu secondaire', "carhop"); ?></h3>
			<?php
			wp_nav_menu(
				array(
					'container'       => 'false',
					'theme_location'  => 'secondary',
					'li_class'        => 'menu-navlink',
					'fallback_cb'     => false,
					"menu_class"      => "sitemap__dynamiques-secondary-menu",
				)
			); ?>
		</div>



		<?php restore_current_blog(); ?>

	</div>
</section>