public function __construct($name = null, $options = array()) { if (is_string($options)) { $options = array('whitelist' => $options); } return parent::__construct($name, $options); }
public function __construct($name = null) { parent::__construct($name); $this->addTest('numeric', function ($value) { return preg_replace('/[^\\d]/', '', $value) == $value; }); }
/** * @param bool $name * @param string $label * @param string $desc * @param bool $required * @param int $width * @param string $default * @param int $height * @param int $rows * @param int $cols * @param int $lengthMax * @param int $lengthMin */ public function __construct($label = null, $name = null, $desc = null, $required = false, $width = 280, $default = '', $height = 100, $rows = 4, $cols = 30, $lengthMax = false, $lengthMin = false) { parent::__construct($label, $name, $desc, $required, $width, $default, $lengthMax, $lengthMin); $this->_height = intval($height); $this->_rows = $rows; $this->_cols = $cols; }
public function __construct($name = null) { parent::__construct($name); $this->addTest('valid', function ($value) { return strtotime($value); }); }
/** * __construct * * @param string $caption caption * @param string $name name * @param integer $size field size * @param integer $value date as unix timestamp */ public function __construct($caption, $name, $size = 2, $value = 0) { if ($value !== '') { $value = $value === 0 ? time() : (int) $value; } parent::__construct($caption, $name, $size, 2, $value); }
public function __construct($name = null) { parent::__construct($name); $this->addTest('valid', function ($value) { return filter_var($value, FILTER_VALIDATE_EMAIL) && preg_match("/.*@.*\\..*/", $value); }); }
/** * Overload the constdcteur * * BooleanSwitch constructor. * @param $name * @param string $label * @param null $function */ public function __construct($name, $label = '', $function = null) { parent::__construct($name, $label); if (!is_null($function)) { $this->setRemoteProcess($function); } }
/** * Create instance * * @param string $name The name of the field * @param array $data The data to construct the field */ public function __construct($name, array $data) { parent::__construct($name, $data); if (array_key_exists('placeholder', $data)) { $this->placeholder = $data['placeholder']; } $this->type = 'password'; }
public function __construct($name = null) { parent::__construct($name); $this->attributes['placeholder'] = 'http://'; $this->addTest('url', function ($value) { return filter_var($value, FILTER_VALIDATE_URL); }); }
/** * @param $filePath string Name of the conf file (or full path). * @throws Exception */ public function __construct($filePath) { $this->inFilePath = $filePath; $contents = @file_get_contents($this->inFilePath); if (false === $contents) { throw new Exception('Cannot read file "' . $this->inFilePath . '".'); } parent::__construct($contents); }
/** * Constructror * * @param $name * @param string $label * @param array $attr */ public function __construct($name, $label = '', $format = null, $attr = []) { parent::__construct($name, $label, $attr); $this->center(); if (is_null($format)) { $format = configurator()->get('table.column.date.format'); } $this->addFilter('dateFormat', 'dateFormat', $format); }
public function __construct($label, $attributes) { parent::__construct($label, $attributes); if (!isset($attributes['rows'])) { $attributes['rows'] = 6; } if (!isset($attributes['cols'])) { $attributes['cols'] = 60; } }
/** * __construct * * @param string|array $caption caption or array of all attributes * @param string $name name * @param integer|\DateTime $value unix timestamp or DateTime object */ public function __construct($caption, $name = null, $value = null) { if (is_array($caption)) { parent::__construct($caption); $this->setIfNotSet('size', 15); $this->setIfNotSet('value', 0); $this->set('value', \Xoops\Core\Locale\Time::cleanTime($this->get('value', null))); } else { parent::__construct([]); $this->setCaption($caption); $this->setName($name); $this->set('size', 15); $this->setValue(\Xoops\Core\Locale\Time::cleanTime($value)); } }
/** * __construct * * @param string|array $caption field caption or array of all attributes * @param string $name field name * @param string $value field value */ public function __construct($caption, $name = null, $value = '#FFFFFF') { if (is_array($caption)) { parent::__construct($caption); $value = $this->get('value', ''); if (empty($value)) { $this->set('value', '#FFFFFF'); } $this->setIfNotSet('size', 10); $this->setIfNotSet('maxlength', 16); } else { parent::__construct([]); $this->set('caption', $caption); $this->setWithDefaults('name', $name, 'name_error'); $this->set('size', 10); $this->set('maxlength', 16); $this->set('value', $value); } $this->setIfNotSet('type', 'text'); }
/** * Constructor * * Instantiate the captcha input form element * * @param string $name * @param string $value * @param string $indent * @param int $expire * @param string $captcha * @return Captcha */ public function __construct($name, $value = null, $indent = null, $expire = 300, $captcha = null) { // Start a session. if (session_id() == '') { session_start(); } // If token does not exist, create one if (!isset($_SESSION['pop_captcha'])) { if (null === $captcha) { $captcha = $this->generateEquation(); } else { if (stripos($captcha, '<img') === false) { $captcha = strtoupper($captcha); } } $this->token = ['captcha' => $captcha, 'value' => null, 'expire' => (int) $expire, 'start' => time()]; $_SESSION['pop_captcha'] = serialize($this->token); // Else, retrieve existing token } else { $this->token = unserialize($_SESSION['pop_captcha']); // Check to see if the token has expired if ($this->token['expire'] > 0) { if ($this->token['expire'] + $this->token['start'] < time()) { if (null === $captcha) { $captcha = $this->generateEquation(); } else { if (stripos($captcha, '<img') === false) { $captcha = strtoupper($captcha); } } $this->token = ['captcha' => $captcha, 'value' => null, 'expire' => (int) $expire, 'start' => time()]; $_SESSION['pop_captcha'] = serialize($this->token); } } } parent::__construct($name, strtoupper($value), $indent); $this->setRequired(true); $this->setValidator(); }
public function __construct() { parent::__construct('-'); }
public function __construct($exists = false) { parent::__construct($exists); $this->setLocal(true); }
public function __construct($name) { parent::__construct($name); $this->service = Injector::inst()->get('AtRestCryptoService'); }
public function __construct($text = null, $type = 'text', $src = null) { parent::__construct($text, $type); $this->_src = $src; }
public function __construct($name, $label, $options = null) { parent::__construct($name, $label, $options); $this->setView('administr/form::text'); $this->options['type'] = 'range'; }
public function __construct($name = null, $value = null) { $this->name('password'); parent::__construct($name, $value); }
public function __construct($node, $text = null) { parent::__construct($text); $this->node = $node; }
public function __construct($name = null) { parent::__construct($name); $this->addTest('numeric', 'is_numeric'); $this->setStep(1); }
public function __construct($text = null) { parent::__construct(); $this->_text = $text; }
public function __construct($label, $class = '', $required = true, $rows = 10, $cols = 60, $content = '/.*/') { parent::__construct($label, $required, false, $content); $this->class = $class; $this->rows = $rows; $this->cols = $cols; }
public function __construct($_message, $_planmarkup) { parent::__construct('plantext', "Plan Text"); $this->message = $_message; $this->planmarkup = $_planmarkup; }
public function __construct(array $attributes = []) { parent::__construct($attributes + ['size' => 16, 'class' => 'date']); }
public function __construct($name = null, $value = null) { $this->name('email'); $this->rule(new Rule\Email()); parent::__construct($name, $value); }
function __construct($aTxt = '', $aSuper = '', $aXAbsPos = 0, $aYAbsPos = 0) { parent::__construct($aTxt, $aXAbsPos, $aYAbsPos); $this->iSuper = $aSuper; }
/** * Implements __construct(). * * @param mixed $text * Text. * @param mixed $identifier * Identifier. */ public function __construct($text, $identifier = NULL) { return parent::__construct('body', $text, $identifier); }