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


class DataMenuHausUebersicht extends DataMenuSelfBlaettern
{
  
  public function __construct($pUrlParameter)
  {
    parent::__construct($pUrlParameter);
    $this->dbwork = new DBWorkGebaeude();
    $this->exportadapter = new ExpGebaeude();
    $this->datensaetzeProSeite = $this->settings->gebaeudeproseite;
    if ($this->datensaetzeProSeite == '') {
      $this->datensaetzeProSeite = \webbasys\includee\api\SeitenwahlAPI::ANZPROSEITE;
    }
  }

  public function getsight($pSigthID = 221)
  {
    parent::getsight($pSigthID);
  }

  public function _getClickPath($pName = 'Geb&auml;ude&uuml;bersicht', $pPHP53DummyParam = '')
  {
    
    DataMenuMain::_getClickPath();
    $tmp = $pName;
    if ($this->toolsettings->clickHausUebersichtText != '') {
      $tmp = $this->toolsettings->clickHausUebersichtText;
    }
    
    return parent::_getClickPath($tmp);
  }

  
  public function getdataarraybody($pZeitBereich = 'noRestrict')
  {
    $this->urlparameter->explodeSettingStream();
    $starthaus = new Gebaeude();
    $starthaus->id = $this->addfstring->getfilledStr($this->urlparameter->blid, '');
    $settings = ToolSettingsAPI::getToolSettings(4);

    $forward = $this->addfstring->getfilledStr($this->urlparameter->browse, 'forward') == 'forward';
    if ($settings->nurgebaeudeinaktsemester) {
      $this->dataarraybody = $this->dbwork->getGebaeudeLimitAktSemester(
        $starthaus->id,
        $settings->semlist,
        $this->datensaetzeProSeite,
        $forward
      );
    } else {
      $this->dataarraybody = $this->dbwork->getGebaeudeLimit($starthaus->id, $this->datensaetzeProSeite, $forward);
    }
    $this->setCountVars();
    
    $this->setStatusMessage();
  }

  
  public function getAnzahlBodyElements()
  {
    return $this->dbwork->getCountGebaeude();
  }

  
  public function getSeitenwahlAnz()
  {
    return $this->settings->gebseitenwahlanz;
  }

  public function get2ndColumn()
  {
    $tmp = $this->sight;
    $this->getsight();
    $this->getdataarraynocolumn();
    $retour = $this->getnocolumn();
    $this->sight = $tmp;

    return $retour;
  }
}