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

namespace Kufer\Web\KuferTools\Teilnehmer\KursUebersicht\Detailsreiter\InfoAnDoz;

class InfoAnDozPresenter extends \Kufer\Web\KuferTools\Basis\Presenter\MitRahmenPresenter
{
  protected function getView()
  {
    return new InfoAnDozView($this->getViewModel());
  }

  protected function getViewModel()
  {
    $viewModel = new InfoAnDozViewModel();
    $viewModel->kurs = $this->useCaseResponse->kurs;
    
    $viewModel->kurs->toolId = $this->useCaseResponse->toolId;
    $viewModel->kurs->belegId = $this->useCaseResponse->belegId;
    $viewModel->kurs->name = $this->useCaseResponse->user->getVarValue('name');
    $viewModel->kurs->vorname = $this->useCaseResponse->user->getVarValue('vorname');
    $viewModel->kurs->countDozenten = $this->useCaseResponse->countDozenten;

    $viewModel->dozenten = $this->useCaseResponse->dozenten;
    $viewModel->titleSingular = $this->useCaseResponse->sprachSettings->Dozent['Singular_mit_Artikel']['Akkusativ'];
    $viewModel->titlePlural = $this->useCaseResponse->sprachSettings->Dozent['Plural_mit_Artikel']['Nominativ'];

    return $viewModel;
  }

  protected function getJSDeclarations(): string
  {
    $result = parent::getJSDeclarations();
    $result .= \JsOperations::getDeclarationString('KuferTools.Kontakt.Art', 'Nachricht');

    return $result;
  }

  protected function getJsFilesSrcAryWeitere(): array
  {
    return array(
      $this->getJsFileFromOldTools('Formulare/kontakte.js'),
      $this->getJsFileFromSys('kontaktformular.js')
    );
  }

  protected function getSeitenTitel(): string
  {
    return 'Information an den/die Dozenten/in ';
  }
}