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

namespace Kufer\KuferTools\Allgemein\VhsNachricht;

class SendVhsNachrichtPresenter extends \Kufer\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()
  {
    return array(
      $this->getJsFileFromSys('kontaktformular.js')
    );
  }
}