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

namespace Kufer\Web\KuferTools\Basis\Kursdetails\Detailsreiter\Teilnehmer\SammelEinzelBearbeitung;

class TeilnehmerDescriptionView extends \Kufer\Web\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'basis/kursdetails/detailsreiter/teilnehmer_sammelbearbeiten_description.sgt';
  }

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

  protected function getBodyExportAdapter()
  {
    return new \ExpColumn(
      $this->viewModel->toolSection,
      $this->viewModel->toolSettings,
      $this->viewModel->belegung,
      false,
      'desc' . $this->viewModel->index
    );
  }

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

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

  public function show()
  {
    $result = '';
    $bodyDataModulAry = $this->getBodyDataModulArray();
    if (!empty($bodyDataModulAry)) {
      $result .= $this->getHeader();
      $result .= $this->getBody($bodyDataModulAry);
      $result .= $this->getFooter();
    } else {
      $result .= $this->getHeader();
      $result .= $this->getFooter();
    }

    return $result;
    
    
  }
}

class TeilnehmerDescriptionViewModel
{
  public $toolSection;
  public $toolSettings;
  public $belegung;
  public $columns;
  public $index;
}