/home/coolpkct/www/websites/cake3.cool.rocks/admin/classes/numberfield.php
<?php
/**
 * Part of Showkase web site management package
 *
 * @package Showkase
 * @author Jack Hardie {@link http://www.jhardie.com}
 * @copyright Copyright (c) 2012, SimpleViewer Inc.
 */
defined('SK_ACCESS')||die('<h1>403: Forbidden</h1>');
$ds = DIRECTORY_SEPARATOR;
require_once "classes{$ds}formfield.php";

 /**
 * Html form input
 *
 * @package Showkase
 */
class NumberField extends FormField
{

  /**
   * @var string minimum
   */
  private $max = '';
  
  /**
   * @var string minimum
   */
  private $min = '';
  
  /**
   * @var step
   */
  private $step = '';
   
  
 /**
  * constructor
  */
  public function __construct($iniVars)
  {
    parent::__construct($iniVars);
    if (isset($iniVars['min'])) $this->min = 'min="'.$iniVars['min'].'"';
    if (isset($iniVars['max'])) $this->max = 'max="'.$iniVars['max'].'"';
    if (isset($iniVars['step'])) $this->step = 'step="'.$iniVars['step'].'"';
  }
  
 /**
  * Formats html string
  * Used outside the print/echo context
  *
  * @return string
  */
  public function getHtml(&$tab)
  {
      $tab++;
      $label = $this->getLabel();
      $value = htmlspecialchars($this->value, ENT_QUOTES, 'UTF-8');
      $html = <<<EOD
<div class="control-group">
  {$label}
  <div class="input">
    <input type="number" class="number" name="{$this->name}" id="{$this->id}" tabindex="{$tab}" value="{$value}"  {$this->min} {$this->max} {$this->step}>
  </div>
</div>
EOD;
      return $html;
  }
}