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


class DataMenuMain extends DataMenuMainTopLeft
{
  
  public $dbwcategories;
  public $categories;
  public $parentcategory;

  
  public function __construct($urlparameter)
  {
    parent::__construct($urlparameter);
    
    $this->dbwcategories = new DBWorkCategories();
  }

  
  public function _showCategoryDescription($pUnten = '')
  {
    if ($this->urlparameter->katid > 0) {
      $katid = $this->urlparameter->katid;

      $dbwcategories = new DBWorkCategories();
      $category = $dbwcategories->getCategory($katid);

      if ($category->beschreibung != '') {
        if ($this->toolsettings->catDescOhneBR) {
          echo
            "<div class='hauptseite_categorydescription " . $pUnten . "'>\n"
            . "<!-- DataMenuMain::_showCategoryDescription() -->\n"
            . CleanOperations::cleanStringContainingHtml($category->beschreibungorig)
            . "</div>\n";
        } else {
          $categoryDescriptionCleaned = str_replace(
            '<li><br /></li>',
            '',
            "<div class='hauptseite_categorydescription " . $pUnten . "'>\n"
            . "<!-- DataMenuMain::_showCategoryDescription() -->\n"
            . CleanOperations::cleanStringContainingHtml($category->beschreibung)
            . "</div>\n"
          );
          echo $categoryDescriptionCleaned;
        }
      }
    }
  }

  public function showheader()
  {
    echo " <div class='hauptseite_kurse'>\n";
    DataMenu::showheader();
  }

  public function showfooter()
  {
    DataMenu::showfooter();
    echo " </div>\n\n";
  }

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

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

  
  public function demnaechstmenu($katid = -1)
  {
    if ($katid == -1) {
      $katid = $this->addfstring->getfilledStr($this->urlparameter->katid, '0');
    }

    if ($this->urlparameter->katid == $katid || ($katid == 0 && $this->urlparameter->katid == '')) {
      $cssClass = 'menue_unterauswahl active';
    } else {
      $cssClass = 'menue_unterauswahl';
    }

    $echoString = '';
    
    
    
    if ($this->toolsettings->demnaechst_style == DMN_STANDARD) { 
      
      $this->urlparameter->implodeSettingsbyType(new URLParameterHauptmenue());
      if (!isset($this->addfdatetime)) {
        $this->addfdatetime = new DateTimeOperations();
      }
      $menutitel = $this->toolsettings->captionZeitraum;
      $cleanedIndexScript = CleanOperations::cleanStringForHtml(INDEXSCRIPT);
      $echoString .= "  <ul class='menue_unterauswahl'>\n";
      $echoString .= "   <li class='menue_unterauswahl'><a class='menue_unterauswahl' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('von', 'bis', 'demnaechstname'), array($this->addfdatetime->getDateByParam(0), $this->addfdatetime->getDateByParam(0), 'Heute'))) . "' title='Veranstaltungsübersicht für heute öffnen'>Heute</a></li>\n";
      $echoString .= "   <li class='menue_unterauswahl'><a class='menue_unterauswahl' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('von', 'bis', 'demnaechstname'), array($this->addfdatetime->getDateByParam(1), $this->addfdatetime->getDateByParam(1), 'Morgen'))) . "' title='Veranstaltungsübersicht für morgen öffnen'>Morgen</a></li>\n";
      $echoString .= "   <li class='menue_unterauswahl'><a class='menue_unterauswahl' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('von', 'bis', 'demnaechstname'), array($this->addfdatetime->getDateByParam(2), $this->addfdatetime->getDateByParam(3), 'Diese Woche'))) . "' title='Veranstaltungsübersicht für diese Woche öffnen'>Diese Woche</a> (" . $this->addfdatetime->getDateByParam(2) . ' - ' . $this->addfdatetime->getDateByParam(3) . ")</li>\n";
      if (!CodingOperations::areInternalAndExternalEncodingEqual()) {
        $echoString .= "   <li class='menue_unterauswahl'><a class='menue_unterauswahl' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('von', 'bis', 'demnaechstname'), array($this->addfdatetime->getDateByParam(4), $this->addfdatetime->getDateByParam(5), urldecode('N%C3%A4chste Woche')))) . "' title='Veranstaltungsübersicht für nächste Woche öffnen'>Nächste Woche</a> (" . $this->addfdatetime->getDateByParam(4) . ' - ' . $this->addfdatetime->getDateByParam(5) . ")</li>\n";
      } else {
        $echoString .= "   <li class='menue_unterauswahl'><a class='menue_unterauswahl' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('von', 'bis', 'demnaechstname'), array($this->addfdatetime->getDateByParam(4), $this->addfdatetime->getDateByParam(5), 'N%C3%A4chste Woche'))) . "' title='Veranstaltungsübersicht für nächste Woche öffnen'>Nächste Woche</a> (" . $this->addfdatetime->getDateByParam(4) . ' - ' . $this->addfdatetime->getDateByParam(5) . ")</li>\n";
      }
      $echoString .= "  </ul>\n";
      
      
      if ($this->urlparameter->von != '') {
        $echoString .= '<br /> Keine Kurse gefunden.';
      }
      $echoString .= BR;
      echo
        " <div class='$cssClass' style='float: left;'>\n" 
        . "  <h1 class='$cssClass' title='Kategorie'>" . CleanOperations::cleanStringForHtml($menutitel) . "</h1>\n"
        . $echoString
        . " </div>\n\n";
    } else {
      
      $dmDemnaechstMenu = new DataMenuBasis($this->urlparameter);
      if ($this->urlparameter->von == '') {
        
        
        $dmDemnaechstMenu->dataarrayheader = array(new Datamodul());
        $dmDemnaechstMenu->dataarraybody = array(new Datamodul());
        $dmDemnaechstMenu->dataarrayfooter = array(new Datamodul());
        $dmDemnaechstMenu->showsightcomplete(206, new ExpKurse());
      } else {
        
        
        
        $dmDemnaechstMenu->dataarraynocolumn = array(new Datamodul());
        $dmDemnaechstMenu->getsight(206);
        $dmDemnaechstMenu->exportadapter = new ExpKurse();
        $dmDemnaechstMenu->exportadapter->export->initiate();
        $dmDemnaechstMenu->shownocolumn();
      }
    }
  }

  
  public function menukategorie($katid = -1, $count = 0, $pKatType = 0)
  {
    if ($pKatType === 0) {
      $pKatType = $this->urlparameter->kathaupt;
    }

    if ($this->urlparameter->kathaupt == 4) {
      return;
    }

    if ($this->urlparameter->katid == '' && $this->urlparameter->kathaupt != 3 && $this->toolsettings->catDescPosition == CATDESCOBEN) {
      $this->_showCategoryTopText($this->urlparameter->kathaupt == '2');
    }

    if ($katid == -1) {
      $katid = $this->addfstring->getfilledStr($this->urlparameter->katid, '0');
    }

    if ($this->toolsettings->showCatDescOnCatOverview && ($this->urlparameter->kathaupt == 1 || $this->urlparameter->kathaupt == 2)
        && $this->toolsettings->catDescPosition == CATDESCOBEN) {
      $this->_showCategoryDescription();
    }

    if (($this->urlparameter->kathaupt < 3) || ($this->urlparameter->kathaupt > 199)) {
      if ($this->toolsettings->categoryType == CATEGORYTREE) {
        $cssClass = 'menue_unterauswahl';
        $cat = $this->dbwcategories->getCategory($katid);
        $menutitle = $cat->text;
        if ($menutitle == '') {
          if ($this->urlparameter->kathaupt == 1) {
            $menutitle = $this->toolsettings->captionHauptkategorie;
          } else { 
            $menutitle = $this->toolsettings->captionSonderrubrik;
          }
        }
        
        if (!empty($menutitle)) {
          $menutitle .= ':';
        }
        echo
          " <div class='$cssClass' style='float: left;'>\n"; 
        echo "  <h1 class='$cssClass' title='Kategorie'>" . CleanOperations::cleanStringForHtml($menutitle) . "</h1>\n";
        echo '  <div class="menue_unterauswahlliste">';
        echo $this->_getTreeCategories($katid, $this->addfstring->getfilledStr($pKatType, '0'), '', '');
        echo  "  </div><!-- /menue_unterauswahlliste-->\n </div>\n\n";
      } else {
        $this->_showOldCategories($katid, $count, $pKatType);
      }
      
      if ($this->toolsettings->showCatDescOnCatOverview && ($this->urlparameter->kathaupt == 1 || $this->urlparameter->kathaupt == 2)
          && $this->toolsettings->catDescPosition == CATDESCUNTEN) {
        $this->_showCategoryDescription('unten');
      }
      if ($this->urlparameter->katid == '' && $this->urlparameter->kathaupt != 3 && $this->toolsettings->catDescPosition == CATDESCUNTEN) {
        $this->_showCategoryTopText($this->urlparameter->kathaupt == '2');
      }
    }
  }

  
  public function menukategorie2()
  {
    $dm = new DataMenuKategorien(new URLParameterWarenkorb(true));
    $dm->mainmenu();
  }

  public function menukategorie3()
  {
    $dm = new DataMenuKategorienM28Style(new URLParameterWarenkorb(true));
    $dm->mainmenu();
  }

  
  public function _showCategoryTopText($pSonderrubrik)
  {
    $unten = '';
    $dbwtexte = new DBWorkTexte();
    if ($pSonderrubrik) { 
      $text = $dbwtexte->getTextById(TEXTE_TOPSONDERCATEGORY);
    } else {
      $text = $dbwtexte->getTextById(TEXTE_TOPCATEGORY);
    }

    if ($this->toolsettings->catDescPosition == CATDESCUNTEN) {
      $unten = '_unten';
    }

    if ($text->wert != '') { 
      if ($this->toolsettings->catDescOhneBR) {
        echo
          "<p class='topCategoryText" . $unten . "'>"
            . (CleanOperations::cleanStringContainingHtml($text->wert))
          . '</p>';
      } else {
        echo
          "<p class='topCategoryText" . $unten . "'>"
            . nl2br(CleanOperations::cleanStringContainingHtml($text->wert))
          . '</p>';
      }
    }
  }

  
  public function _showOldCategories($katid = -1, $count = 0, $pKatType = 0)
  {
    if ($pKatType === 0) {
      $pKatType = $this->urlparameter->kathaupt;
    }

    if (!$this->settings->showEmptyCategories) {
      
      
      $filter = '';
      if ($this->settings->semlist != '') {
        $filter = ' AND kurs.semester in ('
                  . $this->addfstring->convertCommaSeparatedList2InList($this->settings->semlist) . ') ';
      }

      $aussenstfiltersql = SQLOperations::BuildAussenstFilterSqlFromSession('kurs');
      if ($aussenstfiltersql != '') {
        $filter .= $aussenstfiltersql;
      }
      $this->categories = $this->dbwcategories->getChildCategoriesByTypeNotEmpty($katid, $this->addfstring->getfilledStr($pKatType, '0'), $filter);
      $this->parentcategory = $this->dbwcategories->getCategory($katid);
    } else {
      
      $this->categories = $this->dbwcategories->getChildCategoriesByType($katid, $this->addfstring->getfilledStr($pKatType, '0'));
      $this->parentcategory = $this->dbwcategories->getCategory($katid);
    }

    
    if ($this->urlparameter->kathaupt == '1') {
      $katTitle = $this->toolsettings->captionHauptkategorie;
    } else {
      $katTitle = $this->toolsettings->captionSonderrubrik;
    }
    $menutitel = $this->addfstring->getfilledStr($this->parentcategory->text, $katTitle);

    $this->urlparameter->implodeSettingsbyType(new URLParameterHauptmenue());

    $echoString = '';
    
    if ($this->urlparameter->katid == $katid || ($katid == 0 && $this->urlparameter->katid == '')) {
      $cssClass = 'menue_unterauswahl active';
    } else {
      $cssClass = 'menue_unterauswahl';
    }

    if (count($this->categories) > 0) {
      $echoString .= "  <ul class='$cssClass'>\n";
    }
    for ($i = 0; $i < count($this->categories); $i++) {
      $echoString .= "   <li class='$cssClass'><a class='$cssClass' href='" . CleanOperations::cleanStringForHtml(INDEXSCRIPT) . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('katid', 'katvaterid', 'katname'), array($this->categories[$i]->id, $this->categories[$i]->owner, StringOperations::cleanStringForUrl($this->categories[$i]->text)))) . "' title='Veranstaltungsübersicht " . CleanOperations::cleanStringForHtml($this->categories[$i]->text) . " öffnen'>";
      $isBold = $this->categories[$i]->id == $this->urlparameter->katid;
      if ($isBold) {
        $echoString .= '<b>';
      }
      $echoString .= $this->categories[$i]->text;
      if ($isBold) {
        $echoString .= '</b>';
      }
      $echoString .= "</a></li>\n";
    }
    if (count($this->categories) > 0) {
      $echoString .= "  </ul>\n";
    } else {
      
      
      $s = 'Derzeit nicht verfügbar.';
      
      $s = $this->settings->emptyCatText == '' ? $s : $this->settings->emptyCatText;
      
      $textobj = $this->dbwtexte->getTextById(TEXTE_LEEREKATEGORIE);
      $s = trim($textobj->wert) == '' ? $s : trim($textobj->wert);
      $echoString .= "<p class='menue_unterauswahl'>" . CleanOperations::cleanStringForHtml($s) . '</p>' . BR;
    }

    $result = 0;
    if (!($this->toolsettings->noObersteKategorie && $this->parentcategory->owner == 0)) {
      if ($this->parentcategory->id > 0 && $count < $this->toolsettings->anzahlSpalten - 1) {
        $result = $this->_showOldCategories($this->parentcategory->owner, $count + 1, $pKatType);
      }
    }
    if ($result == 0) {
      $result = $count;
    }
    if (($result - $count + 1) % $this->toolsettings->anzahlSpalten == 0) {
      $float = " style='clear: left;'";
    } else {
      $float = ' ';
    }

    echo
      " <div class='$cssClass' style='float: left;'>\n" 
      . "  <h1 class='$cssClass' title='Kategorie'>" . CleanOperations::cleanStringForHtml($menutitel) . "</h1>\n"
      . $echoString
      . " </div>\n\n";
    if ($float != ' ') { 
      echo '<div ' . $float . '></div>';
    }
    if ($count == 0) {
      return count($this->categories);
    } else {
      return $result;
    }
  }

  
  public function _getTreeCategories($pKatid, $pKattype, $pLastChild, $pChildString)
  {
    $cats = array();
    if ($pKatid == 0) {
      
      if (!$this->toolsettings->noObersteKategorie || $pChildString == '') {
        $cats = $this->dbwcategories->getCategoriesByTypeStructured($pKattype, $this->toolsettings->showEmptyCategories);
      } else {
        return $pChildString;
      }
    } else {
      
      if (!$this->settings->showEmptyCategories) {
        
        
        $filter = '';
        if ($this->settings->semlist != '') {
          $filter = ' AND kurs.semester in ('
                    . $this->addfstring->convertCommaSeparatedList2InList($this->settings->semlist) . ') ';
        }
        $aussenstfiltersql = SQLOperations::BuildAussenstFilterSqlFromSession('kurs');
        if ($aussenstfiltersql != '') {
          $filter .= $aussenstfiltersql;
        }
        $cats = $this->dbwcategories->getChildCategoriesByTypeNotEmpty($pKatid, $pKattype, $filter);
      } else {
        
        $cats = $this->dbwcategories->getChildCategoriesByType($pKatid, $pKattype);
      }
    }
    $retour = '';
    if (count($cats) > 0) {
      
      $mastercategories = $this->dbwcategories->getMasterCategoriesIDsByType($pKattype);
      $retour = "\n " . '<ul class="menu_unterauswahl">' . "\n";
      $this->urlparameter->implodeSettingsbyType(new URLParameterHauptmenue());
      foreach ($cats as $category) {
        $cssClass = 'menue_unterauswahl';

        if ($pKatid == 0) {
          $cssClass = 'menue_unterauswahl top';
        }
        elseif ($this->toolsettings->noObersteKategorie
                  && in_array($category->owner, $mastercategories)) {
          $cssClass = 'menue_unterauswahl level2';
          if ($pChildString == '') {
            $cssClass = 'menue_unterauswahl level2 mitBullet';
          }
        }
        if ($category->id == $pLastChild) {
          $cssClass = 'menue_unterauswahl pfad';
        }

        if ($this->urlparameter->katid == $category->id) {
          $cssClass = 'menue_unterauswahl active';

          
          $retour .= "<li class='$cssClass' ";
          if (!$this->toolsettings->noJavaScript) {
            $retour .= "onmouseover=\"this.className='$cssClass';\" onmouseout=\"this.className='$cssClass';\"";
          }
          $retour .= "><a class='$cssClass' href='" . CleanOperations::cleanStringForHtml(INDEXSCRIPT) . '?urlparameter='
                      . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(
                        array('katid', 'katvaterid', 'katname'),
                        array($category->id, $category->owner, StringOperations::cleanStringForUrl($category->text))
                      ))
                      . "' title='Veranstaltungsübersicht " . CleanOperations::cleanStringForHtml($category->text)
                      . " öffnen' >";
        } else {
          $retour .= "<li class='$cssClass' ";
          if (!$this->toolsettings->noJavaScript) {
            $retour .= "onmouseover=\"this.className='$cssClass highlight_ein';\" onmouseout=\"this.className='$cssClass';\"";
          }
          $retour .= "><a class='$cssClass' href='" . CleanOperations::cleanStringForHtml(INDEXSCRIPT) . '?urlparameter='
                      . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(
                        array('katid', 'katvaterid', 'katname'),
                        array($category->id, $category->owner, StringOperations::cleanStringForUrl($category->text))
                      ))
                      . "' title='Veranstaltungsübersicht " . CleanOperations::cleanStringForHtml($category->text)
                      . " öffnen' >";
        }

        $retour .= CleanOperations::cleanStringForHtml($category->text) . '</a>';

        if ($category->id == $pLastChild) { 
          $retour .= $pChildString;
        }
        $retour .= "</li>\n";
      }
      $retour .= '</ul>';
    } else {
      
      $s = 'Derzeit nicht verfügbar.';
      
      $s = $this->settings->emptyCatText == '' ? $s : $this->settings->emptyCatText;
      
      $textobj = $this->dbwtexte->getTextById(TEXTE_LEEREKATEGORIE);
      $s = trim($textobj->wert) == '' ? $s : trim($textobj->wert);
      $retour .= "<p class='menue_unterauswahl'>" . CleanOperations::cleanStringForHtml($s) . '</p>' . BR;
    }
    $cat = $this->dbwcategories->getCategory($pKatid);
    if ($pKatid != 0) {
      return $this->_getTreeCategories($cat->owner, $pKattype, $pKatid, $retour);
    } else {
      return $retour;
    }
  }

  
  
  
  public function getCategoryPath($p_vaterid, $p_path, $p_trennbeg)
  {
    $path = '';
    $category = $this->dbwcategories->getCategory($p_vaterid);
    $this->urlparameter->implodeSettingsbyType(new URLParameterHauptmenue());
    
    
    if ($category->id != '') {
      
      
      
      
      
      

      if ($this->toolsettings->showClickpfad == true) {
        $trennzeichen = "<span class='trennzeichen'>" . ' ' . CleanOperations::cleanStringContainingHtml($this->toolsettings->trennzeichenKategorie) . ' ' . '</span>';
      } else {
        $trennzeichen = '  ' . CleanOperations::cleanStringContainingHtml($this->toolsettings->trennzeichenKategorie);
      }
      if ((!$p_trennbeg) && ($category->owner == 0)) {
        $trennzeichen = ' ';
      }
      if ($p_path != '') {
        
        
        
        if ($this->toolsettings->showClickpfad == true) {
          $partpath = " <a class='clickadresse ku_click_kategorie ku_click_katebene" . CleanOperations::cleanInt($category->owner)
                      . ($p_path == '' ? ' ku_click_unterste_ebene' : '') . "' href='" . CleanOperations::cleanStringForHtml(INDEXSCRIPT) . '?urlparameter='
                      . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(
                        array('katid', 'katvaterid', 'katname'),
                        array($category->id, $category->owner, StringOperations::cleanStringForUrl($category->text))
                      ))
                      . "' title='Veranstaltungsübersicht " . CleanOperations::cleanStringForHtml($category->text) . " öffnen'>" . ' '
                      . CleanOperations::cleanStringForHtml($category->text) . '</a>';
        } else {
          $partpath = " <a class='statusadresse' href='" . CleanOperations::cleanStringForHtml(INDEXSCRIPT) . '?urlparameter='
                      . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(
                        array('katid', 'katvaterid', 'katname'),
                        array($category->id, $category->owner, StringOperations::cleanStringForUrl($category->text))
                      ))
                      . "' title='Veranstaltungsübersicht " . CleanOperations::cleanStringForHtml($category->text) . " öffnen'>" . ' '
                      . CleanOperations::cleanStringForHtml($category->text) . '</a>';
        }
        $path = ' ' . $trennzeichen . $partpath . $p_path;
      } else {
        if ($this->toolsettings->showClickpfad == true) {
          $partpath = "<span class='clickadrbold ku_click_kategorie ku_click_katebene" . CleanOperations::cleanInt($category->owner)
                      . ($p_path == '' ? ' ku_click_unterste_ebene' : '') . "'>" . ' ' . CleanOperations::cleanStringForHtml($category->text) . '</span>';
        } else {
          $partpath = ' ' . CleanOperations::cleanStringForHtml($category->text);
        }
        $path = ' ' . $trennzeichen . $partpath;
      }
      
      
      return $this->getCategoryPath($category->owner, $path, $p_trennbeg);
    } else {
      return $p_path;
    }
  }

  
  public function statusmenu($pTrennbeg = false)
  {
    
    
    $this->urlparameter->implodeSettingsbyType(new URLParameterBasis());
    
    $trenn_beg = $pTrennbeg;
    $cleanedIndexScript = CleanOperations::cleanStringForHtml(INDEXSCRIPT);
    if ($this->toolsettings->showClickpfad == false) {
      if (($this->urlparameter->kathaupt == 1) && ($this->toolsettings->captionHauptkategorie != '')) {
        $this->status1 = " <a class='statusadresse' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('kathaupt', 'kathauptname'), array('1', $this->toolsettings->captionHauptkategorie))) . "' title='Veranstaltungsübersicht für " . CleanOperations::cleanStringForHtml($this->toolsettings->captionHauptkategorie) . " öffnen'>" . CleanOperations::cleanStringForHtml($this->toolsettings->captionHauptkategorie) . "</a>\n";
        $trenn_beg = true;
      }
      if ($this->urlparameter->kathaupt == 2 && ($this->toolsettings->captionSonderrubrik != '')) {
        $this->status1 = " <a class='statusadresse' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('kathaupt', 'kathauptname'), array('2', $this->toolsettings->captionSonderrubrik))) . "' title='Veranstaltungsübersicht für " . CleanOperations::cleanStringForHtml($this->toolsettings->captionSonderrubrik) . " öffnen'>" . CleanOperations::cleanStringForHtml($this->toolsettings->captionSonderrubrik) . "</a>\n";
        $trenn_beg = true;
      }
      if ($this->urlparameter->kathaupt == 3 && ($this->toolsettings->captionZeitraum != '')) {
        $coding = new EncodeCharsetFromTo(UTF_8, CodingOperations::getExternalEncoding());
        $demnaechstname = $coding->encode($this->urlparameter->demnaechstname);
        $this->status1 = " <a class='statusadresse' href='" . $cleanedIndexScript . '?urlparameter=' . CleanOperations::cleanStringForHtml($this->urlparameter->getStreamWith(array('kathaupt', 'kathauptname'), array('3', $this->toolsettings->captionZeitraum))) . "' title='Veranstaltungsübersicht für " . CleanOperations::cleanStringForHtml($this->toolsettings->captionZeitraum) . " öffnen'>" . CleanOperations::cleanStringForHtml($this->toolsettings->captionZeitraum) . '</a>&nbsp;' . ($this->urlparameter->demnaechstname == '' ? '' : CleanOperations::cleanStringContainingHtml($this->toolsettings->trennzeichenKategorie) . '&nbsp;') . CleanOperations::cleanStringForHtml($demnaechstname) . "\n";
        $trenn_beg = true;
      }
      
      $this->status1 .= $this->getCategoryPath($this->addfstring->getfilledStr($this->urlparameter->katid, '0'), '', $trenn_beg);
      echo "  <div class='hauptseite_status'>\n";
      echo "   <h2 class='statusadresse'>" . $this->status1 . "</h2>\n";
    } else {
      $this->status1 = '';
      echo "  <div class='hauptseite_status'>\n";
    }

    
    $urlp = new URLParameterWarenkorb();
    $knr = '';
    if (isset($urlp->knradd)) {
      $knr = $urlp->knradd;
    } elseif (isset($urlp->knrdel)) {
      $knr = $urlp->knrdel;
    }
    if ($knr != '') {
      $exp = new ExpKurse();
      $exp->export->initiate();
      $exp->export->add($knr);
      $exp->export->export();
      $exp->filestream = $this->status2;
      $exp->replaceVarNames(); 
      $this->status2 = $exp->resultlist[0];
    }

    if ($this->status2 != '') {
      $tagnameFuerStatusmeldung = $this->getTagnameFuerStatusmeldung();

      $beginTag = '';
      $endTag = '';
      if ($tagnameFuerStatusmeldung != '') {
        $beginTag = "   <$tagnameFuerStatusmeldung class='statusmeldung'>";
        $endTag = "</$tagnameFuerStatusmeldung>";
      }
      
      if ($this->toolsettings->showClickpfad == false) {
        echo $beginTag . (trim(CleanOperations::cleanStringContainingHtml($this->status2))) . $endTag . "\n";
      } else {
        if (trim($this->status2) != '') {
          echo $beginTag . CleanOperations::cleanStringContainingHtml($this->status2) . $endTag . "\n";
        }
      }
    }
    echo "  </div>\n\n";
  }

  
  protected function setSichtvariablenPwVoraussetzungen()
  {
    $this->setSichtvariablenPwVoraussetzungenInitial();
    $pw = PostOperations::getVarValue('wbpasswort');
    $pwdop = new PasswordOperations();
    if ($pw != '') {
      $this->exportadapter->setSightInfo('pwvorgaben_pw_angegeben', true);
      $this->exportadapter->setSightInfo('pwvorgaben_laenge_erfuellt', $pwdop->validSize($pw));
      $this->exportadapter->setSightInfo('pwvorgaben_sonderzeichen_erfuellt', $pwdop->validSpecialChars($pw));
      $this->exportadapter->setSightInfo('pwvorgaben_nummern_erfuellt', $pwdop->validNumbers($pw));
      $this->exportadapter->setSightInfo('pwvorgaben_kleinbuchstabe_erfuellt', $pwdop->validLowerCaseChar($pw));
      $this->exportadapter->setSightInfo('pwvorgaben_grossbuchstabe_erfuellt', $pwdop->validUpperCaseChar($pw));
    }
    if ($pw != '' && !$pwdop->isValid($pw)) {
      $this->exportadapter->setSightInfo('pwvorgaben_alles_erfuellt', false);
    }
  }

  
  protected function setSichtvariablenPwVoraussetzungenInitial()
  {
    $this->exportadapter->setSightInfo('pwvorgaben_alles_erfuellt', true);
    $this->exportadapter->setSightInfo('pwvorgaben_pw_angegeben', false);
    $this->exportadapter->setSightInfo('pwvorgaben_laenge_erfuellt', true);
    $this->exportadapter->setSightInfo('pwvorgaben_sonderzeichen_erfuellt', true);
    $this->exportadapter->setSightInfo('pwvorgaben_nummern_erfuellt', true);
    $this->exportadapter->setSightInfo('pwvorgaben_kleinbuchstabe_erfuellt', true);
    $this->exportadapter->setSightInfo('pwvorgaben_grossbuchstabe_erfuellt', true);
  }
}