<?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("image", array("required"));
		$this->addElement("image_name", array("required"));
		$this->addElement("header", array("required"));
		$this->addElement("options", array("required"));
		$this->addElement("reactions", array("required"), array("1", "2", "3", "4", "5", "6", "7"));
	}

	public function startData($currentData) {
		$data = array();
		
		$data["config"] = array(
			"image" => "",
			"image_name" => "",
			"header" => ""
			);
		$data["options"] = false;

		return $data;
	}

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

		$name = "";
		$image = "";
		$video = "";
		$image = $this->getElement("image")->getValue();
		$image_name = $this->getElement("image_name")->getValue();
		$header = $this->getElement("header")->getValue();
		$options = $this->getElement("options")->getValue();
		$reactions = $this->getElement("reactions")->getValue();

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