<?php
namespace Modules\Admin\UserProfile\Notification;

class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract
{
	public function getForm()
	{
		// global cfgs
		$CFG = \Engine\Loader_Cfg::getInstance()->getGlobal();

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

		$fieldset = new \Engine\Form\Container\Fieldset($this->lang['index']['formFields']['fieldset']);
		$fieldset->setTooltip($this->lang['index']['formFields']['tooltipFieldset']);
		$form->addContainer($fieldset);

		$possibleArr = [
			"fadd" => $this->lang['index']['system']['fadd'],
			"conf" => $this->lang['index']['system']['conf'],
			"uncf" => $this->lang['index']['system']['uncf'],
			"cncl" => $this->lang['index']['system']['cncl'],
			"rfnd" => $this->lang['index']['system']['rfnd'],
		];

		foreach ($this->values['systemsList'] as $id=>$det) {
			if (!$det['active']) {
				$display = sprintf("<i>%s [%s]</i>", $det['name'], $this->lang['index']['formFields']['inactive']);
			} else {
				$display = $det['name'];
			}
			$checkbox = new \Engine\Form\Input\Checkboxes($display, "sys[$id]", $this->values['sys'][$id]);
			$checkbox->setPossibleValues($possibleArr);
			$form->addElement($checkbox);
		}

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

		return $form;

	}

}