<?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;

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

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

  protected function getDefaultExportAdapter()
  {
    return new \ExpBasis(true);
  }

  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(
        'panel_unique_id' => $this->viewModel->panel->getVarValue('unique_id')
      )
    );
  }
}

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