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




class DefaultMobilePagePart implements IMobilePagePart {
  
  public $attr;

  
  public $content;

  public function __construct($pRole, $pContent, $pDataTheme=DEFAULT_MOBILE_THEME) {
    $this->attr = array();
    $this->attr['data-role'] = $pRole;
    $this->attr['data-theme'] = $pDataTheme;
    $this->content = $pContent;
  }

  public function addAttr($pName, $pValue){
    $this->attr[$pName] = $pValue;
  }

  public function toHTML() {
    $retour = '<div';
    foreach ($this->attr as $key=>$value) {
      $retour .= ' ' . $key . '="' . $value . '"';
    }
    $retour .= ">\n";
    $retour .= $this->content . "\n</div>\n";
    return $retour;
  }

  public function getContent(){
    return $this->content;
  }

  public function setContent($pContent){
    $this->content = $pContent;
  }
}
?>