<?php
/*
 * Copyright (c) 2013, webvariants GbR, http://www.webvariants.de
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

class _WV_Datatype_Repeat_FakeForm extends sly_Form {
	protected $widget;

	public function __construct(WV_Form_Repeat $widget) {
		parent::__construct('', 'post', '');
		$this->widget = $widget;
	}

	public function add(sly_Form_IElement $element) {
		$this->widget->add($element);
	}

	public function addHiddenValue($name, $value, $id = null) {
		$this->widget->add($hidden = new sly_Form_Input_Text($name, null, $value, $id));
		$hidden->setAttribute('type', 'hidden');
	}
}
