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

namespace Kufer\KuferTools\Allgemein\VhsNachricht;

class SendVhsNachrichtView extends \Kufer\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'allgemein/vhs_nachricht/nachrichtversendet.sgt';
  }

  protected function getDefaultDataModulArray()
  {
    $result = new class() extends \Datamodul {
      public $isRefresh;
      public $toolId;
      public $emailInfoStatusHtml;
      public $emailWarningStatusHtml;
      public $emailErrorStatusHtml;
    };

    $result->isRefresh = $this->viewModel->isRefresh;
    $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);
  }
}

class SendVhsNachrichtViewModel
{
  public $emailStatus;
  public $isRefresh;
  public $toolId;
}