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

class View_Utils_AddCalculation extends \App\Mvc\View_Utils_FormAbstract
{

	/**
	 * The class name which generates the form for the current action.
	 * @var String
	 */
	protected $formClassName='View_Utils_AddCalculation';

	/**
	 * The rendering Smarty template file.
	 * @var String
	 */
	protected $renderingTemplate = 'addCalculation.tpl';

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

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

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

		// name
		$fldName = new \Engine\Form\Input\Text($this->lang['addCalculation']['formFields']['name'], 'name', $this->values['name']);
		$fldName->setMandatory(true);
		$fieldset->addElement($fldName);

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

		return $form;
	}

}