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


class DataMenuKatOverview extends DataMenuKurse
{
  
  public function getSightID()
  {
    return 108;
  }

  
  public function __construct($urlparameter)
  {
    parent::__construct($urlparameter);
    $this->exportadapter = new ExpKurse();
    $this->getsight($this->getSightID());
  }

  
  public function shownodata()
  {
    echo " <div class='hauptseite_kategorie'>\n";
    DataMenu::shownodata();
    echo " </div>\n\n";
  }

  
  public function _getClickPath()
  {
    parent::_getClickPath();
    $trennBeg = false;
    $titlekursbereich = '';
    if ($this->toolsettings->titleKursBereich != '') {
      $trennBeg = true;
      $titlekursbereich = "<span class='clickadresse'>" . ' ' . CleanOperations::cleanStringForHtml(stripslashes($this->toolsettings->titleKursBereich)) . ' ' . '</span>';
    }

    return $titlekursbereich . $this->getCategoryPath($this->addfstring->getfilledStr($this->urlparameter->katid, '0'), '', $trennBeg);
  }

  
  public function mainmenu()
  {
    $this->getdataarrayheader();
    $this->getdataarraybody();
    
    if (isset($this->dbwkurse) && $this->nrOfMainBodyElements == -1) {
      $this->nrOfMainBodyElements = $this->getAnzahlBodyElements();
    }
    
    
    $this->blaetternAry = $this->getBlaettern();
    $this->getdataarrayfooter();
    $this->getdataarraynodata();
    $this->getdataarraynocolumn();

    if ($this->toolsettings->showClickpfad) {
      
      echo $this->getClickPath();
    }
    echo "<div class='hauptseite'>\n" . $this->getContentAnker();
    
    if (count($this->dataarraybody) > 0) {
      $this->getsight(12);
      
      if ($this->toolsettings->showCatDescOnKursOverview && ($this->urlparameter->kathaupt == 1 || $this->urlparameter->kathaupt == 2)) {
        $this->_showCategoryDescription();
      }

      $this->showheader();
      $this->showbody();
      $this->showfooter();
    }
    
    else {
      $this->shownodata();
    }
    echo '</div>';
  }

  
  public function get2ndColumn()
  {
    $tmpexpadapter = $this->exportadapter;
    $this->exportadapter = new ExpKategorien();
    $this->getdataarraynocolumn();
    $retour = $this->getnocolumn();
    $this->exportadapter = $tmpexpadapter;

    return $retour;
  }
}