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

class DataMenuKategorienListe extends DataMenuMain
{
  
  public $dbwCat;

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

    $this->dbwCat = new DBWorkCategories();
  }

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

  public function getbody($pSgtVars = array())
  {
    $kapi = new KategorienAPI();

    return $kapi->getCategoryList();
  }

  public function _getClickPath($pName = 'Kategorienliste')
  {
    
    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->clickKategorienListeText != '') {
      $tmp = $this->toolsettings->clickKategorienListeText;
    }

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

  public function getAnzahlBodyElements()
  {
    return $this->dbwCat->getCountKategorienByType(1);
  }
}