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


class DataMenuKursorteGruppiert extends DataMenuMain
{
  
  public $dbworkkursorte;

  public function __construct($urlParam)
  {
    parent::__construct($urlParam);

    $this->exportadapter = new ExpGruppiert();
    $this->dbworkkursorte = new DBWorkKursorteWB();
    $this->dbworkkursorte->newSearch();
    $this->dbworkkursorte->fromobject->eigenerraum = $this->toolsettings->nurEigeneRaeumeAnzeigen;
  }

  public function _getClickPath($pName = 'Kursortübersicht')
  {
    
    DataMenuMain::_getClickPath();
    
    if ($this->toolsettings->titleKursBereich != '') {
      $this->clickpfad = "<span class='clickadresse'>" . ' ' . CleanOperations::cleanStringForHtml(stripslashes($this->toolsettings->titleKursBereich)) . ' ' . "</span>\n";
      $this->clickpfad .= "<span class='trennzeichen'>" . ' ' . CleanOperations::cleanStringContainingHtml($this->toolsettings->trennzeichenKategorie) . ' ' . '</span>';
    }
    $tmp = $pName;
    if ($this->toolsettings->clickKortGruppiertText != '') {
      $tmp = $this->toolsettings->clickKortGruppiertText;
    }

    $this->clickpfad .= "<span class='clickadrbold'> " . CleanOperations::cleanStringForHtml($tmp) . "</span>\n";
    
    return $this->clickpfad;
  }

  public function getsight($sightid = 386)
  {
    parent::getsight($sightid);
  }

  public function getdataarraybody()
  {
    $initialLetter = array();
    
    if ($this->toolsettings->kortgruppiertNurS) {
      $initialLetter['Sch'] = 0;
      $initialLetter['St'] = 0;
    }
    
    $letterAry = $this->dbworkkursorte->getGetLetterList($initialLetter, $this->toolsettings->semlist);
    if ($this->urlparameter->letter != '') {
      $letter = '';
      foreach ($letterAry as $l) {
        if ($l->buchstabe == $this->urlparameter->letter) {
          $letter = $l;
          break;
        }
      }
      $letterAry = array($letter);
    }

    $this->dataarraybody = $letterAry;
  }
}