first commit
This commit is contained in:
59
templates/html/input.php
Normal file
59
templates/html/input.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?
|
||||
if ( $this -> params['label'] )
|
||||
{
|
||||
$out .= '<div class="form-group row">';
|
||||
$out .= '<label class="';
|
||||
if ( !$this -> params['inline'] )
|
||||
$out .= 'col-md-12 text-left ';
|
||||
else
|
||||
$out .= 'col-md-3 ';
|
||||
$out .= 'col-form-label">' . $this -> params['label'] . ':</label>';
|
||||
$out .= '<div class="';
|
||||
if ( !$this -> params['inline'] )
|
||||
$out .= 'col-md-12';
|
||||
else
|
||||
$out .= 'col-md-9';
|
||||
$out .= '">';
|
||||
}
|
||||
|
||||
$out .= '<input ';
|
||||
$out .= 'type="' . $this -> params['type'] . '" ';
|
||||
|
||||
if ( $this -> params['id'] )
|
||||
$out .= 'id="' . $this -> params['id'] . '" ';
|
||||
|
||||
if ( $this -> params['class'] or $this -> params['label'] )
|
||||
{
|
||||
if ( $this -> params['label'] )
|
||||
$out .= 'class="' . $this -> params['class'] . ' form-control" ';
|
||||
else if ( $this -> params['class'] )
|
||||
$out .= 'class="' . $this -> params['class'] . '" ';
|
||||
}
|
||||
|
||||
$out .= 'name="' . $this -> params['name'] . '" ';
|
||||
$out .= 'value="' . $this -> secureHTML( $this -> params['value'] ) . '" ';
|
||||
|
||||
if ( $this -> params['style'] )
|
||||
$out .= 'style="' . $this -> params['style'] . '" ';
|
||||
|
||||
if ( $this -> params['readonly'] )
|
||||
$out .= 'readonly="readonly" ';
|
||||
|
||||
if ( $this -> params['required'] )
|
||||
$out .= 'required ';
|
||||
|
||||
if ( $this -> params['autocomplete'] == 'off' )
|
||||
$out .= 'autocomplete="off" ';
|
||||
|
||||
if ( $this -> params['placeholder'] )
|
||||
$out .= 'placeholder="' . $this -> params['placeholder'] . '" ';
|
||||
|
||||
$out .= ' />';
|
||||
|
||||
if ( $this -> params['label'] )
|
||||
{
|
||||
$out .= '</div>';
|
||||
$out .= '</div>';
|
||||
}
|
||||
|
||||
echo $out;
|
||||
Reference in New Issue
Block a user