<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Basis\Uebersicht;

use Kufer\Web\Classes\ExportAdapter\ExpAdditionalVariables;
use Kufer\Web\KuferTools\Basis\Panel\Panel;
use Kufer\Web\KuferTools\Basis\UseCaseBuilder\ToolSection;


class UebersichtTabelleMitWssView extends \Kufer\Web\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'basis/tabelle.sgt';
  }

  protected function getDefaultDataModulArray()
  {
    return array($this->viewModel->index => $this->viewModel->panel);
  }

  protected function getDefaultExportAdapter()
  {
    return new ExpAdditionalVariables(new \ExportBasis(), array(
      'is_header' => $this->viewModel->isHeader
    ));
  }

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

  protected function getBodyExportAdapter()
  {
    return new ExpAdditionalVariables(
      new \ExportColumn(
        $this->viewModel->toolSection,
        $this->viewModel->toolSettings,
        $this->viewModel->datamodul
      ),
      array(
        'is_header' => $this->viewModel->isHeader
      )
    );
  }
}

class UebersichtTabelleMitWssViewModel extends \Kufer\Web\KuferTools\Basis\View\BasisViewModel
{
  
  public $panel;
  
  public $columns;
  public $index;
  
  public $datamodul;
  
  public $toolSection;
  
  public $toolSettings;
  
  public $isHeader;
}