<?php 

class RerunButton {
  private $field;
  private $form;
  private $position;
  private $label;

  public function __construct ($field) {
    if (isset($field)) {
      $this->field    = $field->field;
      $this->form     = $field->form;
      $this->label    = $field->label;

      if (isset($field->label))
        $this->label = $field->label;
      else
        $this->label = "Rerun";

      if (isset($field->position) && $field->position == "left")
        $this->position = "left";
      else
        $this->position = "right";
    }
  }
  
  public function outputLayout() {
  
    $html = "
<button id='$this->field' class='btn btn-default' onclick='rer$this->form();' 
  style='float:$this->position;'>$this->label</button>
    ";
  	return $html;
  }
  
  public function outputScript() {
		
    $script = " 
    
    
    ";
    return $script;
  }
}

?>
