/** * Arguments: * - cmd * - label * - ^ (optional) * * @param array $args The tokenized definition, only split at spaces */ public function initialize($args) { parent::initialize($args); $attr = array('class' => 'timefield edit', 'maxlength' => '8'); if (!isset($this->opt['optional'])) { $attr['required'] = 'required'; $attr['class'] .= ' required'; } $this->tpl = form_makeTextField('@@NAME@@', '@@VALUE@@', '@@DISPLAY@@', '@@ID@@', '@@CLASS@@', $attr); }
/** * Arguments: * - cmd * - label * - ++ (optional) * - 0000 (optional) * - ^ (optional) * * @param array $args The tokenized definition, only split at spaces */ public function initialize($args) { $pp = array_search('++', $args, true); if ($pp !== false) { unset($args[$pp]); $this->autoinc = true; } parent::initialize($args); if ($this->autoinc) { global $ID; $key = $this->get_key(); $c_val = p_get_metadata($ID, 'bureaucracy ' . $key); if (is_null($c_val)) { if (!isset($this->opt['value'])) { $this->opt['value'] = 0; } p_set_metadata($ID, array('bureaucracy' => array($key => $this->opt['value']))); } else { $this->opt['value'] = $c_val; } } $this->opt['value'] = $this->addLeadingzeros($this->opt['value']); }
/** * Arguments: * - cmd * - label * - ^ (optional) * * @param array $args The tokenized definition, only split at spaces */ public function initialize($args) { parent::initialize($args); $this->tpl['class'] .= ' userspicker'; }