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

class PagePortrait extends PageBaseWT
{
  private $_data;
  private $_uploadMessage;
  
  
  public function __construct($pPageTitle, $pPageId, $pTool, $pData, $pStatusMessages)
  {
    parent::__construct($pPageTitle, $pPageId, $pTool);
    $this->_data = $pData;
    $this->_uploadMessage = $pStatusMessages['uploadMessage'];
  }
  
  
  public function getContentHeader()
  {
    return 'Ihr ' . $this->pageTitle;
  }
  
  
  public function getContent()
  {
    $builder = new SightBuilderUebersicht($this->tool->getToolId(), 457, $this->_data, true);
    
    $result = $this->getHinweis();
    $result .= '<div id="main_content">';
    $result .= $builder->buildSight();
    $result .= '</div>';
    $result .= $this->_getMainButtons();
    
    return $result;
  }
  
  
  private function _getMainButtons()
  {
    $result = '<div class="main_buttons portrait">';
    
    
    if ( !SessionOperations::isReplikat() || SessionOperations::isDmzBetrieb() ) {
      $result .= HTMLOperations::createButtonSpan('Bearbeiten', 'Portrait bearbeiten', 'portrait_bearbeiten', '', "images/dozlist.gif" );
    }
    
    $result .= '</div>';
    
    return $result;
  }
  
  
  protected function getHinweis()
  {
    return $this->_uploadMessage;
  }
  
  public function getSpecialJS()
  {
    $fileAry = parent::getSpecialJS();
    $fileAry[] = 'js/DozTool/portrait.js';
    
    return $fileAry;
  }
  
  
  public function getJSDeclarations() {
    $ret = parent::getJSDeclarations();
    $ret .= JsOperations::getDeclarationInt('KuferTools.ToolSectionId', $this->id);
    return $ret;
  }
}
?>