<?php 

class PutButton {
  private $scope;
  private $position;
  private $label;
  private $idProp;
  private $disabled;

  public function __construct ($entry) {
    if (isset($entry)) {
      $this->scope    = $entry->scope;
      $this->disabled = $entry->disabled;
      $this->iterator = $entry->iterator;
      $this->idProp   = $entry->idProp;
      $this->label    = $entry->label;
      $this->defLab   = explode ("_", $entry->label)[0];

      if (isset($entry->position) && $entry->position == "left")
        $this->position = "left";
      else
        $this->position = "right";
    }
  }
  
  public function outputLayout() {
  
    $html = "
<button id='$this->idProp' class='btn btn-inverse' onclick='$this->idProp();' 
  $this->disabled value='$this->label'
  style='float:$this->position;'>$this->defLab</button>
    ";
  	return $html;
  }
  
  public function outputScript() {
		
    $script = " 	 
    ";
    return $script;
  }
}

?>
