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

namespace Kufer\KuferTools\Basis\KursDetails\Feedback;

class SendFeedbackPresenter 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 SendFeedbackView($this->getViewModel());
  }

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

    return $viewModel;
  }

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