<?php

namespace Planaday\Utility\FormBuilder\Structures;

use Planaday\Utility\FormBuilder\Structure;

class FullScreenPopup implements Structure{
	use BasicStructure;

	protected ?string $index = null;
	protected string $buttonTitle = "Open in popup";
	protected string $closeButtonText = "Close";

	public function setIndex( ?string $index ): self {
		$this->index = $index;
		return $this;
	}

	public function setButtonTitle(string $buttonTitle): self {
		$this->buttonTitle = $buttonTitle;
		return $this;
	}

	public function setCloseButtonText(string $closeButtonText): self {
		$this->closeButtonText = $closeButtonText;
		return $this;
	}

	public function getIndex(): ?string {
		return $this->index;
	}

	public function getImplJson(): array {
		return [
			"type" => 'fullScreenPopup',
			"buttonTitle" => $this->buttonTitle,
			"closeButtonText" => $this->closeButtonText,
		];
	}
}