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

namespace Kufer\KuferTools\Veranstalter\KursUebersichtDerMitarbeiter\KursUebersicht\Detailsreiter\InfoAnDoz;

class InfoAnDozPresenter extends \Kufer\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->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()
  {
    $result = parent::getJSDeclarations();
    $result .= \JsOperations::getDeclarationString('KuferTools.Kontakt.Art', 'Nachricht');

    return $result;
  }

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