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

namespace Kufer\KuferTools\Basis\KursDetails\Feedback;

class SendFeedbackView extends \Kufer\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'basis/feedback/feedbackversendet.sgt';
  }

  protected function getDefaultDataModulArray()
  {
    $result = $this->viewModel->kurs;
    $result->isRefresh = $this->viewModel->isRefresh;
    $result->action = $this->viewModel->action;
    $result->toolId = $this->viewModel->toolId;
    $result->emailInfoStatusHtml = \implode(
      '<br>',
      \array_map(array('\\CleanOperations', 'cleanStringForHtml'), $this->viewModel->emailStatus->getSuccess())
    );
    $result->emailWarningStatusHtml = \implode(
      '<br>',
      \array_map(array('\\CleanOperations', 'cleanStringForHtml'), $this->viewModel->emailStatus->getWarnings())
    );
    $result->emailErrorStatusHtml = \implode(
      '<br>',
      \array_map(array('\\CleanOperations', 'cleanStringForHtml'), $this->viewModel->emailStatus->getErrors())
    );

    return array($result);
  }

  protected function getDefaultExportAdaper()
  {
    return new \ExpKurse();
  }
}

class SendFeedbackViewModel
{
  public $kurs;
  public $emailStatus;
  public $isRefresh;
  public $action;
  public $toolId;
}