<?php

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

if (!defined('BASEDIR')) {
  include_once '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'constants.php';
}


class DataMenuTagcloud extends DataMenuMain
{
  
  public $exportadapter;

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

    $this->settings = ToolSettingsAPI::getToolSettings(4);

    $this->exportadapter = new ExpTagcloud();
  }

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

  public function getdataarraybody()
  {
    $this->dataarraybody = $this->_getdataarraybody();
    $this->nrOfMainBodyElements = count($this->dataarraybody);
  }

  public function _getdataarraybody()
  {
    return array();
  }

  public function prepareMainmenu()
  {
    $this->getsight();
    $this->getdataarrayheader();
    $this->getdataarraybody();
    $this->getdataarrayfooter();
    $this->getdataarraynodata();
    $this->getdataarraynocolumn();
  }

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

  public static function getDataMenu($pUrlParameter)
  {
    switch ($pUrlParameter->tc_type) {
      case 1:
      default:
        return new DataMenuTagcloudStichwort($pUrlParameter);
      case 2:
        return new DataMenuTagcloudKategorie($pUrlParameter);
      
    }
  }
}