Skip to content
Snippets Groups Projects
Commit 7df9cd6d authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

handle checkboxes, radios, hidden

parent 27bf6226
No related branches found
No related tags found
1 merge request!9Add textarea
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
...@@ -404,13 +404,13 @@ class renderadminlte { ...@@ -404,13 +404,13 @@ class renderadminlte {
'input'=>[ 'input'=>[
'label'=>'Form: input', 'label'=>'Form: input',
'description'=>'Input form fiels', 'description'=>'Input form fiels',
'method'=>'getInput', 'method'=>'getFormInput',
'params'=>[ 'params'=>[
'label' => [ 'label' => [
'group'=>'styling', 'group'=>'styling',
'description'=>'label for the input field', 'description'=>'label for the input field',
'example_value'=>'Enter your firstname' 'example_value'=>'Enter something'
], ],
'type'=>['select'=> [ 'type'=>['select'=> [
'description'=>'type or input field', 'description'=>'type or input field',
...@@ -455,12 +455,12 @@ class renderadminlte { ...@@ -455,12 +455,12 @@ class renderadminlte {
'prepend' => [ 'prepend' => [
'group'=>'styling', 'group'=>'styling',
'description'=>'optional: content on input start', 'description'=>'optional: content on input start',
'example_value'=>'+' 'example_value'=>''
], ],
'append' => [ 'append' => [
'group'=>'styling', 'group'=>'styling',
'description'=>'optional: content on input end', 'description'=>'optional: content on input end',
'example_value'=>':-)' 'example_value'=>''
], ],
'name' => [ 'name' => [
'group'=>'content', 'group'=>'content',
...@@ -474,6 +474,44 @@ class renderadminlte { ...@@ -474,6 +474,44 @@ class renderadminlte {
], ],
] ]
], ],
// ------------------------------------------------------------
'textarea'=>[
'label'=>'Form: textarea',
'description'=>'textarea or html editor',
'method'=>'getFormTextarea',
'params'=>[
'label' => [
'group'=>'styling',
'description'=>'label for the input field',
'example_value'=>'Enter text'
],
'type'=>['select'=> [
'description'=>'type or input field',
'group'=>'styling',
'values'=>[
''=>'text',
'html'=>'html editor',
]
],
],
'class' => [
'group'=>'styling',
'description'=>'optional: css classes',
'example_value'=>'myclass'
],
'name' => [
'group'=>'content',
'description'=>'name attribute',
'example_value'=>'textdata'
],
'value' => [
'group'=>'content',
'description'=>'Value',
'example_value'=>'Here is some text...'
],
]
],
]; ];
} }
/** /**
...@@ -1246,12 +1284,26 @@ class renderadminlte { ...@@ -1246,12 +1284,26 @@ class renderadminlte {
} }
} }
return $this->getHorizontalFormElement( // return data
switch($aElement['type']){
case 'checkbox':
case 'radio':
$aElement['class']=str_replace('form-control ', 'form-check-input', $aElement['class']);
return $this->_tag('div' , ['class'=>'form-check'],
$this->_tag('input', $aElement, '', false).$this->_tag('label', ['for'=>$sFormid, 'label'=>$sLabel ], '')
);
break;
case 'hidden':
return $this->_tag('input', $aElement, '', false);
break;
default: return $this->getHorizontalFormElement(
$sPrepend.$this->_tag('input', $aElement, '', false).$sAppend, $sPrepend.$this->_tag('input', $aElement, '', false).$sAppend,
$sLabel, $sLabel,
$sFormid $sFormid
); );
} }
}
/** /**
* return a textare field .. or html editor using summernote * return a textare field .. or html editor using summernote
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment