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

namespace Kufer\Web\KuferTools\Basis\Anmeldung\TnUebersichtDialog;

abstract class TnUebersichtDialogView extends \Kufer\Web\KuferTools\Basis\View\ViewSight
{
  protected function getDefaultDataModulArray()
  {
    $dm = new class() extends \Datamodul {
      public $className;
      public $columnsCount;
      public $showAdvancedFilter;
    };
    $dm->className = $this->viewModel->className;
    $dm->columnsCount = \count($this->viewModel->columns);
    $dm->showAdvancedFilter = $this->viewModel->showAdvancedFilter;

    return array($dm);
  }

  protected function getBodyDataModulArray()
  {
    return $this->viewModel->columns;
  }

  protected function getBodyExportAdapter()
  {
    return new \ExpColumn(
      $this->viewModel->toolSection,
      $this->viewModel->toolSettings,
      null,
      true
    );
  }
}

class TnUebersichtDialogViewModel extends \Kufer\Web\KuferTools\Basis\View\BasisViewModel
{
  public $toolSection;
  public $toolSettings;
  public $className;
  public $columns;
  public $showAdvancedFilter;
}