<?php 

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

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

      if (isset($field->position) && $field->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;
  }
}

?>
