Create a text input field.

@param string $name
@param string $value
@param array  $attributes
@param array  $extra

@return string
169915
public function text($name, $value = null, array $attributes = array(), array $extra = array())
    {
        return $this->build('text', $name, $value, $attributes, $extra);
    }
1361113
protected function makeAttribute($name, array $values)
    {
        $attr = $name . '="';

        switch (true)
        {
            case $values === [true]:
                $attr = $name;
                return $attr;
                break;
            case $name === 'style':
            case strpos($name, 'on') === 0:
                $attr .= htmlspecialchars(join(';', $values));
                break;
            default:
                $attr .= htmlspecialchars(join(' ', $values));
                break;
        }

        $attr .= '"';
        return $attr;
    }
135998
public function button($name, $value = null, $attributes = null)
    {
        return '<input type="button" name="'.$name.'" '.(($attributes !== null) ? $this->attributes($attributes) : "").' value="'.$this->getValue($name, $value).'" />';
    }
514904
public static function form_checkbox($data = '', $value = '', $checked = false, $extra = '')
    {
        $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);

        if (is_array($data) && array_key_exists('checked', $data)) {
            $checked = $data['checked'];

            if ($checked == false) {
                unset($data['checked']);
            } else {
                $data['checked'] = 'checked';
            }
        }

        if ($checked == true) {
            $defaults['checked'] = 'checked';
        } else {
            unset($defaults['checked']);
        }

        return "<input ".self::_parse_form_attributes($data, $defaults).$extra." />\n";
    }
453743
public static function date($name, $value, array $attributes = array())
    {
        $node = new Node\Date();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
847025
public function input($type, $name, $value = null, array $attributes = [])
    {
        $tag = new Tag('input', $attributes);
        $tag->type = $type;
        $tag->name = $name;
        $tag->value = $value;
        return $tag;
    }
165233
public static function password(string $name, string $value = '', array $attributes = null) : string
    {
        // Set the input type
        $attributes['type'] = 'password';

        return Form::input($name, $value, $attributes);
    }
269797
public static function textarea($name, $text, array $attributes = array())
    {
        if ($name !== null) {
            $attributes['name'] = $name;
        }

        $node = new Node\Textarea($text);
        return $node->render($attributes);
    }
365706
private static function setAttr(array $attributes, $field, $name, $type)
    {
        $attrs = '';

        if (in_array($type, array_keys(self::$preAttrs))) {
            $attributes = self::$preAttrs[$type] + $attributes;
        }

        if ($name !== null) {
            $attributes = array( 'name' => $name ) + $attributes;
        }

        if ($type !== 'select' && $type !== 'textarea' && $type !== 'form') {
            $attributes = array( 'type' => $type ) + $attributes;
        }

        foreach ($attributes as $key => $val) {
            $attrs .= ' ' . $key . '="' . self::entities($val) . '"';
        }

        return str_replace('{{attr}}', $attrs, $field);
    }
1133585
public function textarea($name, $value = null, array $attributes = [])
    {
        $tag = new Tag('textarea', $attributes);
        $tag->name = $name;
        $tag->setText($this->getDefaultValue($name, $value));
        return $tag;
    }
883052
public function textarea($name, $attributes = []) {
		list($attributes, $value)	= $this->_prepare($name, $attributes);
		$attributes					= $this->_arrayToAttributesString($attributes);
		$value						= $this->_escape($value);
		return "<textarea{$attributes}>{$value}</textarea>";
	}
740554
public static function checkbox($name, $value, $attributes = array())
    {
        $attributes['value'] = $value;
        return self::input('checkbox', $name, $attributes);
    }
1351927
public static function combo($name, array $options, $value = null, array $attributes = array())
    {
        $input = self::setAttr($attributes, '<select{{attr}}>', $name, 'select');

        foreach ($options as $key => $val) {
            $input .= '<option value="' . self::entities($val) . '"';

            if ($value === $val) {
                $input .= ' selected';
            }

            $input .= '>' . $key . '</option>';
        }

        return $input . '</select>';
    }
876867
public static function input(
        string $name, 
        string $type = "text", 
        string $value = null, 
        array $attributes = []
    ) : string 
    {
        $preAttributesInput = [
            "name" => $name,
            "type" => $type,
        ];
        if (!is_null($value)) {
            $preAttributesInput["value"] = $value;
        }
        $attributesInput = array_merge($preAttributesInput, $attributes);
        return self::tag("input", "", $attributesInput);
    }
295054
public static function radio($name, $value, $attributes = array())
    {
        $attributes['value'] = $value;
        return self::input('radio', $name, $attributes);
    }
702480
static function text($name, $value, $attr = array())
    {
        $attr = array_merge(
            array(
                "type" => "text"
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
747742
public static function inputTimestamp(string $name = '', $value = 0, array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'time-controll' => true];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $timeControll = $userAttributes['time-controll'];
        $isEnabled = !isset($userAttributes['disabled']);
        $userAttributes = static::clearAttributes($userAttributes, ['time-controll']);
        $timezone = \date_default_timezone_get();

        $nameDate = \sprintf('%s_date', $name);
        $nameTime = \sprintf('%s_time', $name);
        $valDate = $valTime = '';

        if (\is_array($value)) {
            $valDate = $value['date'];
            $valTime = $value['time'];
        } elseif ($value != 0) {
            $valDate = (new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('Y-m-d');
            $valTime = (new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('H:i:s');
        }

        $userAttributes['id'] = $nameDate;
        $userAttributes['class'] = 'date';
        $inputDate = Text::inputText($nameDate, $valDate, $userAttributes);

        $userAttributes['id'] = $nameTime;
        $userAttributes['class'] = 'time';
        $inputTime = Text::inputHidden($nameTime, '00:00:00', $userAttributes);

        if ($timeControll === true) {
            $inputTime = Text::inputText($nameTime, $valTime, $userAttributes);
        }

        $btnTitle = static::getConstant(
            'TXT_PANEL_DATA_FORM_TIMESTAMP_CONTROLL_RESET',
            'TXT_PANEL_DATA_FORM_TIMESTAMP_CONTROLL_RESET'
        );
        $resetBtn = $isEnabled ? Tags::span('', ['class' => 'timestamp-reset', 'title' => $btnTitle]) : '';
        $controll = $inputDate.$inputTime.$resetBtn;

        return Tags::div($controll, ['class' => 'timestamp-controll cf']);
    }