<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

namespace Kufer\KuferTools\Basis\View;


class WssFormular2View extends \Kufer\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'basis/wss/formular_2.sgt';
  }

  protected function getBodyDataModulArray()
  {
    return $this->viewModel->selectOptionen;
  }

  protected function getBodyExportAdapter()
  {
    return parent::getDefaultExportAdaper();
  }

  protected function getDefaultDataModulArray()
  {
    return array($this->viewModel->column);
  }

  protected function getDefaultExportAdaper()
  {
    return new \ExpColumn($this->viewModel->datamodul, true, $this->viewModel->requestPrefix);
  }

  public function setSelectOptionen($selectOptionen)
  {
    $this->viewModel->selectOptionen = $selectOptionen;
  }

  public function show()
  {
    $result = $this->getHeader();
    $result .= $this->getBody();
    $result .= $this->getFooter();

    return $result;
  }
}

class WssFormular2ViewModel
{
  public $datamodul;
  public $column;
  public $requestPrefix;
  public $selectOptionen = array();
}