<?php

namespace CarDealerPress\Templates\Admin\Shortcode;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use CarDealerPress\includes\helpers\helpers as helpers;
use CarDealerPress\Templates\Admin as templates;

function inventory_slider() {
	// @codingStandardsIgnoreStart
	$safe = helpers::sanitize_get( $_GET );
	// @codingStandardsIgnoreEnd
	$tab     = $safe['tab'] ?? 'inventory_slider';
	$section = $safe['section'] ?? 'slider_parameters';

	$content = '<div id="cdp-advanced-wrapper" class="settings-wrapper display">';
	$content .= '<div class="wrap">';
	$content .= '<nav class="nav-tab-wrapper">';
	$content .= '<a href="?page=cardealerpress_shortcodes&tab=inventory_slider&section=slider_parameters" class="nav-tab ' . ( 'slider_parameters' === $section ? 'nav-tab-active' : '' ) . '">Paramaters</a>';
	$content .= '<a href="?page=cardealerpress_shortcodes&tab=inventory_slider&section=vehicle_attributes" class="nav-tab ' . ( 'vehicle_attributes' === $section ? 'nav-tab-active' : '' ) . '">Vehicle Attributes</a>';
	$content .= '</nav>';
	$content .= '<div class="tab-content">';
	switch ( $section ) :
		case 'slider_parameters':
			$content .= slider_parameters();
			break;
		case 'vehicle_attributes':
			$content .= templates\Theme\Inventory_Display\vehicle_attributes( array( 'page'   => 'inventory_slider',
			                                                                         'option' => 'cdp_shortcode_options',
			                                                                         'name'   => 'cdp_shortcode_options'
			) );
			break;
	endswitch;
	$content .= '</div>';

	return $content;
}
