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

namespace Kufer\Web\KuferTools\Allgemein\VhsNachricht;

class SendVhsNachrichtPresenter extends \Kufer\Web\KuferTools\Basis\Presenter\MitRahmenPresenter
{
  protected function getContent()
  {
    if (!$this->useCaseResponse->emailStatus->hasErrors() && !$this->useCaseResponse->isRefresh) {
      return parent::getContent();
    } else {
      $view = $this->getView();

      return $view->getNoColumn();
    }
  }

  protected function getView()
  {
    return new SendVhsNachrichtView($this->getViewModel());
  }

  protected function getViewModel()
  {
    $viewModel = new SendVhsNachrichtViewModel();
    $viewModel->emailStatus = $this->useCaseResponse->emailStatus;
    $viewModel->isRefresh = $this->useCaseResponse->isRefresh;
    $viewModel->toolId = $this->useCaseResponse->toolId;

    return $viewModel;
  }

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

  protected function getSeitenTitel(): string
  {
    return 'Nachricht an Einrichtung';
  }
}