<?php
namespace Modules\Admin\Config\Services\Advanced\Export;

class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract
{

	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\View_Utils_FormAbstract::getForm()
	 */
	public function getForm()
	{
		// global cfgs
		$CFG 	= \Engine\Loader_Cfg::getInstance()->getGlobal();
		$_LANG 	= \App\Loader_Lang::getInstance()->getAll();

		$form 	= \Engine\Form\General::create();

		// fieldset
		$fieldset = \Engine\Form\Container\Fieldset::create();
		$form->addContainer($fieldset);

		// service
		$service = new \App\Form\Input\Select_Service($this->lang['index']['formFields']['service'], 'service', $this->values['service']);
		$service->setDefaultOptionText($this->lang['index']['titles']['allServices']);
		$fieldset->addElement($service);


		// location
		$location = new \Engine\Form\Input\Select($this->lang['index']['formFields']['location'], 'location', $this->values['location']);
		$locationArr = [''=>$this->lang['index']['titles']['allLocations']];
		foreach ($CFG['countriesCriteria'] as $loc) {
			$locationArr[$loc] = $_LANG['locations']['countriesCriteria']['long'][$loc];
		}
		$location->setPossibleValues($locationArr);
		$fieldset->addElement($location);



		$form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1));

		return $form;
	}

}