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

namespace Kufer\Web\KuferTools\Teilnehmer\Visitenkarten\VisitenkartenDetails;

class VisitenkartenDetailsView extends \Kufer\Web\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'teilnehmer/visitenkarten/visitenkartendetails.sgt';
  }

  protected function getDefaultDataModulArray()
  {
    $datamodul = new class() extends \Datamodul {
      public $ueberschrift;
      public $buttons;
      public $visitenkarteId;
      public $successMeldung;
      public $infoMeldung;
    };
    $datamodul->ueberschrift = $this->viewModel->ueberschrift;
    $datamodul->buttons = $this->viewModel->buttons;
    $datamodul->visitenkarteId = $this->viewModel->visitenkarte->id;
    $datamodul->successMeldung = $this->viewModel->successMeldung;
    $datamodul->infoMeldung = $this->viewModel->infoMeldung;

    return array($datamodul);
  }

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

  protected function getBodyExportAdapter()
  {
    return new \ExpColumn(
      $this->viewModel->toolSection,
      $this->viewModel->toolSettings,
      $this->viewModel->visitenkarte,
      true
    );
  }
}

class VisitenkartenDetailsViewModel
{
  public $ueberschrift;
  public $visitenkarte;
  public $columns;
  public $buttons;
  public $successMeldung;
  public $infoMeldung;
  public $toolSection;
  public $toolSettings;
}