<?php
/**
 * class presentation_edit_form
 *
 * Description for class presentation_edit_form
 *
 * @author:
*/
namespace form;

use form\slide_form;

class slide_extend_form extends slide_form {
	public function init() {
		$this->addElement("background", array("required"));
		$this->addElement("background_name", array("required"));
		$this->addElement("header", array("required"));
		$this->addElement("text", array("required"));
		$this->addElement("reactions", array("required"), array("1", "2", "3", "4", "5", "6", "7"));
	}

	public function startData($currentData) {
		$data = array();
		
		$data["config"] = array(
			"background" => "",
			"background_name" => "",
			"header" => "",
			"text" => ""
			);
		$data["options"] = true;

		return $data;
	}

	public function save($board_id) {
		global $__database;

		$name = "";
		$image = "";
		$video = "";
		$background = $this->getElement("background")->getValue();
		$background_name = $this->getElement("background_name")->getValue();
		$header = $this->getElement("header")->getValue();
		$text = $this->getElement("text")->getValue();
		$reactions = $this->getElement("reactions")->getValue();

		$config = array(
			"background" => $background,
			"background_name" => $background_name,
			"header" => $header,
			"text" => $text
			);
		
		return $this->__save($board_id, $name, $image, $video, $config, $reactions);
	}
}