function getInput() { $s = $this->name . '_slider'; $this->js(true)->_selector('#' . $s)->slider(array('min' => $this->min, 'max' => $this->max, 'step' => $this->step, 'range' => true, 'values' => array($this->selected_min, $this->selected_max), 'change' => $this->js()->_enclose()->val($this->js()->_selector('#' . $s)->slider('values'))->change())); $this->setAttr('style', 'display: none'); return '<div class="atk-cells"><div class="atk-cell atk-align-left">' . $this->left . '</div>' . '<div class="atk-cell atk-align-right">' . $this->right . '</div>' . '</div>' . '' . parent::getInput() . '<div id="' . $s . '"></div>' . ''; }
function get() { $value = parent::get(); // date cannot be empty string if ($value == '') { return null; } return $value; }
function validate() { // we must regenerate code if validation fails $result = parent::validate(); if (!$result) { unset($_SESSION['S_IMAGE_DECODED']); $this->generateCode(); } return $result; }
function validate() { // empty value is allowed if ($this->value != '') { if (!is_numeric($this->value)) { $this->displayFieldError('Not a valid number'); } if ($this->min !== null && $this->value < $this->min || $this->max !== null && $this->value > $this->max) { $this->displayFieldError('Number not in valid range'); } } return parent::validate(); }
function init() { parent::init(); // Calculate URL for the map lookup callback $this->addr_url = $this->add('VirtualPage', 'getaddr')->set(function ($p) { echo json_encode($p->add('rvadym\\gmap\\Form_WithMap')->getCoordByAddr($_GET['addr'])); exit; })->getURL(); $this->button = $this->afterField()->add('Button')->setLabel('Map'); $this->flyout = $this->owner->add('View_Flyout', 'mapframe'); $this->page_Map($this->flyout); $this->button->js('click', array($this->flyout->showJS($this->button, array('width' => 500, 'my' => 'right top')), $this->map->js()->trigger('redraw'), $this->flyout->js()->gm_field('lookup'))); }
function render() { $this->js(true)->_load('bootstrap-timepicker.min')->timepicker($this->options)->focus($this->js()->next()->trigger('click')); parent::render(); }
function getInput($attr = array()) { return parent::getInput(array_merge(array('value' => number_format($this->value, 2)), $attr)); }
public function performValidation() { parent::performValidation(); $this->validate('number'); }
function setForm($form) { parent::setForm($form); $this->validate('number'); }
function getInput() { return parent::getInput() . $this->getButton(); }
function init() { parent::init(); $btn = $this->afterField()->add('Button')->set("Select " . $this->short_name); $btn->js('click')->_load('elimage')->univ()->myelimage($this); }
function getInput($attr = array()) { return parent::getInput(array_merge(array('class' => 'hindi'), $attr)); }