<?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 DataMenuTagcloudStichwort extends DataMenuTagcloud
{
  
  public $dbwStichwort;

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

    $this->dbwStichwort = new DBWorkHLStichwort();
  }

  public function _getdataarraybody()
  {
    $hlStichw = $this->dbwStichwort->getStichworteHLCloud();

    $dataarray = array();
    $urlparameter = new URLParameterHauptmenue();
    $urlparameter->kathaupt = 18;
    $urlparameter->suchesetzen = 'false';

    foreach ($hlStichw as $stichw) {
      $dmTc = new Tagcloud();
      $dmTc->text = nl2br($stichw->getVarValue(StringOperations::strtolower('stichwort')));
      $dmTc->title = str_replace('"', '\'', $stichw->getVarValue(StringOperations::strtolower('info')));
      $dmTc->groesse = $stichw->getVarValue(StringOperations::strtolower('cloud_groesse'));
      $dmTc->prio = $stichw->getVarValue(StringOperations::strtolower('cloud_prio'));
      $dmTc->id = $stichw->getVarValue(StringOperations::strtolower('id'));

      $urlparameter->kfs_schlagwort = urlencode($stichw->getVarValue(StringOperations::strtolower('stichwort')));
      $urlparameter->implodeSettings();
      $dmTc->link = INDEXSCRIPT . '?urlparameter=' . $urlparameter->stream;
      $dataarray[] = $dmTc;
    }

    return $dataarray;
  }
}