Ejemplo n.º 1
0
 public function __construct($name = null, $options = array())
 {
     if (is_string($options)) {
         $options = array('whitelist' => $options);
     }
     return parent::__construct($name, $options);
 }
Ejemplo n.º 2
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('numeric', function ($value) {
         return preg_replace('/[^\\d]/', '', $value) == $value;
     });
 }
Ejemplo n.º 3
0
 /**
  * @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;
 }
Ejemplo n.º 4
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('valid', function ($value) {
         return strtotime($value);
     });
 }
Ejemplo n.º 5
0
 /**
  * __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);
 }
Ejemplo n.º 6
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('valid', function ($value) {
         return filter_var($value, FILTER_VALIDATE_EMAIL) && preg_match("/.*@.*\\..*/", $value);
     });
 }
Ejemplo n.º 7
0
 /**
  * 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);
     }
 }
Ejemplo n.º 8
0
 /**
  * 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';
 }
Ejemplo n.º 9
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->attributes['placeholder'] = 'http://';
     $this->addTest('url', function ($value) {
         return filter_var($value, FILTER_VALIDATE_URL);
     });
 }
Ejemplo n.º 10
0
 /**
  * @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);
 }
Ejemplo n.º 11
0
 /**
  * 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);
 }
Ejemplo n.º 12
0
 public function __construct($label, $attributes)
 {
     parent::__construct($label, $attributes);
     if (!isset($attributes['rows'])) {
         $attributes['rows'] = 6;
     }
     if (!isset($attributes['cols'])) {
         $attributes['cols'] = 60;
     }
 }
Ejemplo n.º 13
0
 /**
  * __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));
     }
 }
Ejemplo n.º 14
0
 /**
  * __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');
 }
Ejemplo n.º 15
0
 /**
  * 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();
 }
Ejemplo n.º 16
0
 public function __construct()
 {
     parent::__construct('-');
 }
Ejemplo n.º 17
0
 public function __construct($exists = false)
 {
     parent::__construct($exists);
     $this->setLocal(true);
 }
 public function __construct($name)
 {
     parent::__construct($name);
     $this->service = Injector::inst()->get('AtRestCryptoService');
 }
Ejemplo n.º 19
0
 public function __construct($text = null, $type = 'text', $src = null)
 {
     parent::__construct($text, $type);
     $this->_src = $src;
 }
Ejemplo n.º 20
0
 public function __construct($name, $label, $options = null)
 {
     parent::__construct($name, $label, $options);
     $this->setView('administr/form::text');
     $this->options['type'] = 'range';
 }
Ejemplo n.º 21
0
 public function __construct($name = null, $value = null)
 {
     $this->name('password');
     parent::__construct($name, $value);
 }
Ejemplo n.º 22
0
 public function __construct($node, $text = null)
 {
     parent::__construct($text);
     $this->node = $node;
 }
Ejemplo n.º 23
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('numeric', 'is_numeric');
     $this->setStep(1);
 }
Ejemplo n.º 24
0
 public function __construct($text = null)
 {
     parent::__construct();
     $this->_text = $text;
 }
Ejemplo n.º 25
0
 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;
 }
Ejemplo n.º 26
0
 public function __construct($_message, $_planmarkup)
 {
     parent::__construct('plantext', "Plan Text");
     $this->message = $_message;
     $this->planmarkup = $_planmarkup;
 }
Ejemplo n.º 27
0
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes + ['size' => 16, 'class' => 'date']);
 }
Ejemplo n.º 28
0
 public function __construct($name = null, $value = null)
 {
     $this->name('email');
     $this->rule(new Rule\Email());
     parent::__construct($name, $value);
 }
Ejemplo n.º 29
0
 function __construct($aTxt = '', $aSuper = '', $aXAbsPos = 0, $aYAbsPos = 0)
 {
     parent::__construct($aTxt, $aXAbsPos, $aYAbsPos);
     $this->iSuper = $aSuper;
 }
Ejemplo n.º 30
0
 /**
  * Implements __construct().
  *
  * @param mixed $text
  *   Text.
  * @param mixed $identifier
  *   Identifier.
  */
 public function __construct($text, $identifier = NULL)
 {
     return parent::__construct('body', $text, $identifier);
 }