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

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

class TeilnehmerDescriptionView extends \Kufer\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->belegung, false, 'desc' . $this->viewModel->index);
  }

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

  protected function getDefaultExportAdaper()
  {
    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 $belegung;
  public $columns;
  public $index;
}