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

class TabPageSightBuilderUebersichtFlexibel extends TabPageDefault
{
  private $_buttons;
  private $_sightBuilder;

  
  public function __construct($pTabName, $pData, $pSightBuilder, $pButtons)
  {
    parent::__construct($pTabName, $pData);
    $this->_buttons = $pButtons;
    $this->_sightBuilder = $pSightBuilder;
  }

  
  public function _getContent()
  {
    $result = $this->_sightBuilder->buildSight();
    $result .= $this->_getButtons($this->_buttons);

    return $result;
  }

  
  private function _getButtons($pButtons)
  {
    $result = '';
    if (count($pButtons) > 0) {
      $result .= '<div class="tab_buttonleiste tab_sightbuilder_buttonleiste">';
      foreach ($pButtons as $button) {
        $result .= '<div class="tab_button">' . $button . '</div>';
      }
      $result .= '</div>';
    }

    return $result;
  }

  public function getSpecialCss()
  {
    return array('css/tabpagesightbuilder.css');
  }
}