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

 


class MenuPunkt4Link extends MenuPunkt
{
  public $link = '';
  
  
  function __construct($pLink, $pBeschriftung = '', $pAccessKey = '')
  {
    $this->link = $pLink;
    $this->beschriftung = $pBeschriftung;
    $this->accesskey = $pAccessKey;
  } 
  
  
  function getBeschriftung()
  {
    if($this->beschriftung != '')
      return $this->beschriftung;
    else
      return 'Eigener Link';
  }
  
  
  function getLink()
  {
    if($this->link != '')
      return $this->link;
    else
      return 'Ihr Link';
  }
  
  
  function createButton($buttonWidth = 150)
  {
    $buttonWidth = ($buttonWidth < 150)?150:$buttonWidth;
    if (defined('ISWEBADMIN') && ISWEBADMIN) {
      $result = ' <span class="backgroundButton text_left_menu glass" style="width: 230px;">'.CleanOperations::cleanStringForHtml($this->getBeschriftung()).'</span>';
      
    } else {
      $result = '<img alt="" style="width: '.CleanOperations::cleanInt($buttonWidth, 150).'px;" src="layout/button_background.gif">';
      $result .= '<span class="text_left_menu" style="width:'.CleanOperations::cleanInt($buttonWidth, 150).'px">'.CleanOperations::cleanStringForHtml($this->getBeschriftung()).'</span>';
    }
    return $result;
  }
  
  
  function getType()
  {
    return 'link';
  }
  
}
?>