<?php

require_once 'rover-templates.php';


class Rover_IDX_ADMINSETUP
	{
	private Rover_IDX $rover_idx;

	public function __construct(Rover_IDX $rover_idx)
		{
		$this->rover_idx						= $rover_idx;
		}

	public function roveridx_panel_setup_form() {

		if (!is_array($theme_options = get_option(roverOPTIONS::THEME)))
			$theme_options						= array();

		$rover_content							= $this->rover_idx->CONTENT->rover_content(
																						'ROVER_COMPONENT_SETUP_PANEL',
																						array_merge(
																							$theme_options,
																							array(
																								'region'				=> $this->rover_idx->get_first_region(),
																								'regions'				=> implode(',', array_keys($this->rover_idx->all_selected_regions)),
																								)
																							)
																						);

		$TEMPLATES								= new Rover_IDX_ADMINTEMPLATES($this->rover_idx);
		?>
		<div class="wrap" data-page="rover_idx">

		<?php echo $TEMPLATES->roveridx_panel_header();	?>

		<?php echo $rover_content['the_html'];	?>

		<?php echo $TEMPLATES->roveridx_panel_footer($panel = 'setup');	?>

		<?php

			$force_wp_update							= true;

		?>
			<input type="hidden" id="wp_force_update" name="wp_force_update" value="'<?php echo $force_wp_update; ?>'" />
		</div><!-- wrap -->
		<?php
		}

	}

?>