Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AdminLTE renderer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
AdminLTE renderer
Commits
27bf6226
Commit
27bf6226
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add textarea
parent
4d3512a5
No related branches found
No related tags found
1 merge request
!9
Add textarea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/classes/render-adminlte.class.php
+71
-18
71 additions, 18 deletions
public_html/classes/render-adminlte.class.php
with
71 additions
and
18 deletions
public_html/classes/render-adminlte.class.php
+
71
−
18
View file @
27bf6226
...
...
@@ -418,6 +418,8 @@ class renderadminlte {
'values'
=>
[
'text'
=>
'text'
,
'password'
=>
'password'
,
'email'
=>
'email'
,
'hidden'
=>
'hidden'
,
'button'
=>
'button'
,
'checkbox'
=>
'checkbox'
,
...
...
@@ -430,12 +432,14 @@ class renderadminlte {
'image'
=>
'image'
,
'month'
=>
'month'
,
'number'
=>
'number'
,
'password'
=>
'password'
,
'radio'
=>
'radio'
,
'range'
=>
'range'
,
'reset'
=>
'reset'
,
'search'
=>
'search'
,
'submit'
=>
'submit'
,
'tel'
=>
'tel'
,
'text'
=>
'text'
,
'time'
=>
'time'
,
'url'
=>
'url'
,
'week'
=>
'week'
,
...
...
@@ -1183,6 +1187,15 @@ class renderadminlte {
}
public
function
getHorizontalFormElement
(
$sInput
,
$sLabel
=
false
,
$sId
=
false
){
return
'<div class="form-group row">'
.
'<label for="'
.
$sId
.
'" class="col-sm-2 col-form-label">'
.
$sLabel
.
'</label>'
.
'<div class="col-sm-10">'
.
$sInput
.
'</div>'
.
'</div>'
;
}
/**
* return a text input field:
* https://adminlte.io/themes/v3/pages/forms/general.html
...
...
@@ -1193,32 +1206,25 @@ class renderadminlte {
* content
* - label - label tag
* - name - name attribute for sending form
* - value - value in
* - value - value in
field
* @return string
*/
public
function
GetInput
(
$aOptions
){
$aOptions
=
$this
->
_ensureOptions
(
'input'
,
$aOptions
);
public
function
Get
Form
Input
(
$aOptions
){
//
$aOptions=$this->_ensureOptions('input', $aOptions);
$aElement
=
$aOptions
;
$aElement
[
'class'
]
=
''
.
$this
->
_addClassValue
(
$aOptions
[
'class'
],
''
)
.
'form-control '
.
(
isset
(
$aOptions
[
'class'
])
?
$aOptions
[
'class'
]
:
''
)
;
$sFormid
=
(
isset
(
$aOptions
[
'id'
])
?
$aOptions
[
'id'
]
:
(
isset
(
$aOptions
[
'name'
])
?
$aOptions
[
'name'
]
:
'field'
)
.
'-'
.
md5
(
microtime
(
true
))
);
$sLabel
=
''
;
$sLabel
=
isset
(
$aOptions
[
'label'
])
?
$aOptions
[
'label'
]
:
''
;
$sPrepend
=
''
;
$sAppend
=
''
;
$sLabel
.
=
isset
(
$aOptions
[
'label'
])
&&
$aOptions
[
'label'
]
?
$this
->
_tag
(
'label'
,
[
'for'
=>
$sFormid
],
$aOptions
[
'label'
])
:
''
;
$aElement
[
'id'
]
=
$sFormid
;
foreach
([
'_infos'
,
'label'
]
as
$sDeleteKey
){
unset
(
$aElement
[
$sDeleteKey
]);
}
$sWrapperclass
=
'form-group'
;
if
(
isset
(
$aOptions
[
'prepend'
])
&&
$aOptions
[
'prepend'
]){
$sWrapperclass
=
'input-group'
;
...
...
@@ -1232,12 +1238,59 @@ class renderadminlte {
$this
->
_tag
(
'span'
,
[
'class'
=>
'input-group-text'
]
,
$aOptions
[
'append'
])
);
}
return
$this
->
_tag
(
'div'
,
[
'class'
=>
$sWrapperclass
],
$sLabel
.
$sPrepend
.
$this
->
_tag
(
'input'
,
$aElement
,
''
,
false
)
.
$sAppend
$aElement
[
'id'
]
=
$sFormid
;
foreach
([
'_infos'
,
'label'
,
'append'
,
'prepend'
,
'debug'
]
as
$sDeleteKey
){
if
(
isset
(
$aElement
[
$sDeleteKey
])){
unset
(
$aElement
[
$sDeleteKey
]);
}
}
return
$this
->
getHorizontalFormElement
(
$sPrepend
.
$this
->
_tag
(
'input'
,
$aElement
,
''
,
false
)
.
$sAppend
,
$sLabel
,
$sFormid
);
}
/**
* return a textare field .. or html editor using summernote
* @param type $aOptions hash with keys for all options
* styling:
* - type - field type: [none]|html
* content
* - label - label tag
* - name - name attribute for sending form
* - value - value in
* @return string
*/
public
function
getFormTextarea
(
$aOptions
){
// $aOptions=$this->_ensureOptions('textarea', $aOptions);
$aElement
=
$aOptions
;
$aElement
[
'class'
]
=
''
.
'form-control '
.
((
isset
(
$aOptions
[
'type'
])
&&
$aOptions
[
'type'
]
==
'html'
)
?
'summernote '
:
''
)
.
(
isset
(
$aOptions
[
'class'
])
?
$aOptions
[
'class'
]
:
''
)
;
$sLabel
=
isset
(
$aOptions
[
'label'
])
?
$aOptions
[
'label'
]
:
''
;
$sFormid
=
(
isset
(
$aOptions
[
'id'
])
?
$aOptions
[
'id'
]
:
(
isset
(
$aOptions
[
'name'
])
?
$aOptions
[
'name'
]
:
'field'
)
.
'-'
.
md5
(
microtime
(
true
))
);
$value
=
isset
(
$aOptions
[
'value'
])
?
$aOptions
[
'value'
]
:
''
;
foreach
([
'_infos'
,
'label'
,
'debug'
,
'type'
,
'value'
]
as
$sDeleteKey
){
if
(
isset
(
$aElement
[
$sDeleteKey
])){
unset
(
$aElement
[
$sDeleteKey
]);
}
}
return
$this
->
getHorizontalFormElement
(
$this
->
_tag
(
'textarea'
,
$aElement
,
$value
),
$sLabel
,
$sFormid
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment