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
d9b8c394
Commit
d9b8c394
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
WIP getInput
parent
953720ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/classes/render-adminlte.class.php
+106
-37
106 additions, 37 deletions
public_html/classes/render-adminlte.class.php
with
106 additions
and
37 deletions
public_html/classes/render-adminlte.class.php
+
106
−
37
View file @
d9b8c394
...
@@ -400,18 +400,71 @@ class renderadminlte {
...
@@ -400,18 +400,71 @@ class renderadminlte {
'linktext'
=>
[
'group'
=>
'content'
,
'description'
=>
'used if a url was given: linked text'
,
'example_value'
=>
'More info'
]
'linktext'
=>
[
'group'
=>
'content'
,
'description'
=>
'used if a url was given: linked text'
,
'example_value'
=>
'More info'
]
]
]
],
],
// ------------------------------------------------------------
'input'
=>
[
'label'
=>
'Form: input'
,
'description'
=>
'Input form fiels'
,
'method'
=>
'getInput'
,
'params'
=>
[
'label'
=>
[
'group'
=>
'styling'
,
'description'
=>
'label for the input field'
,
'example_value'
=>
'Enter your firstname'
],
'type'
=>
[
'select'
=>
[
'description'
=>
'type or input field'
,
'group'
=>
'styling'
,
'values'
=>
[
'text'
=>
'text'
,
'password'
=>
'password'
,
'email'
=>
'email'
,
'hidden'
=>
'hidden'
,
]
],
'example_value'
=>
'text'
],
'class'
=>
[
'group'
=>
'styling'
,
'description'
=>
'optional: css classes'
,
'example_value'
=>
'myclass'
],
'prepend'
=>
[
'group'
=>
'styling'
,
'description'
=>
'optional: content on input start'
,
'example_value'
=>
'+'
],
'append'
=>
[
'group'
=>
'styling'
,
'description'
=>
'optional: content on input end'
,
'example_value'
=>
':-)'
],
'name'
=>
[
'group'
=>
'content'
,
'description'
=>
'name attribute'
,
'example_value'
=>
'firstname'
],
'value'
=>
[
'group'
=>
'content'
,
'description'
=>
'Value'
,
'example_value'
=>
'Jack'
],
]
],
];
];
}
}
/**
/**
* helper function: a shortcut for $this->_oHtml->getTag
* helper function: a shortcut for $this->_oHtml->getTag
* @param string $sTag name of html tag
* @param string $sTag name of html tag
* @param array $aAttributes array of its attributes
* @param array $aAttributes array of its attributes
* @param string $sContent content between opening and closing tag
* @param bool $bClosetag flag: write a closing tag or not? default: true
*/
*/
protected
function
_tag
(
$sTag
,
$aAttributes
,
$sContent
=
false
){
protected
function
_tag
(
$sTag
,
$aAttributes
,
$sContent
=
false
,
$bClosetag
=
true
){
if
(
$sContent
){
if
(
$sContent
){
$aAttributes
[
'label'
]
=
(
isset
(
$aAttributes
[
'label'
])
?
$aAttributes
[
'label'
]
:
''
)
.
$sContent
;
$aAttributes
[
'label'
]
=
(
isset
(
$aAttributes
[
'label'
])
?
$aAttributes
[
'label'
]
:
''
)
.
$sContent
;
}
}
return
$this
->
_oHtml
->
getTag
(
$sTag
,
$aAttributes
);
return
$this
->
_oHtml
->
getTag
(
$sTag
,
$aAttributes
,
$bClosetag
);
}
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
//
//
...
@@ -1111,45 +1164,61 @@ class renderadminlte {
...
@@ -1111,45 +1164,61 @@ class renderadminlte {
}
}
/*
/**
* return a text input field:
<div class="info-box">
* https://adminlte.io/themes/v3/pages/forms/general.html
<span class="info-box-icon bg-info"><i class="far fa-bookmark"></i></span>
*
<div class="info-box-content">
* @param type $aOptions hash with keys for all options
<span class="info-box-text">Bookmarks</span>
* styling:
<span class="info-box-number">41,410</span>
* - type - field type: text, email, password, hidden
<div class="progress">
* content
<div class="progress-bar bg-info" style="width: 70%"></div>
* - label - label tag
</div>
* - name - name attribute for sending form
<span class="progress-description">
* - value - value in
70% Increase in 30 Days
* @return string
</span>
</div>
</div>
<div class="info-box bg-success">
<span class="info-box-icon"><i class="far fa-thumbs-up"></i></span>
<div class="info-box-content">
<span class="info-box-text">Likes</span>
<span class="info-box-number">41,410</span>
<div class="progress">
<div class="progress-bar" style="width: 70%"></div>
</div>
<span class="progress-description">
70% Increase in 30 Days
</span>
</div>
</div>
*/
*/
public
function
GetInput
(
$aOptions
){
$aOptions
=
$this
->
_ensureOptions
(
'input'
,
$aOptions
);
$aElement
=
$aOptions
;
$aElement
[
'class'
]
=
''
.
$this
->
_addClassValue
(
$aOptions
[
'class'
],
''
)
;
$sFormid
=
(
isset
(
$aOptions
[
'id'
])
?
$aOptions
[
'id'
]
:
(
isset
(
$aOptions
[
'name'
])
?
$aOptions
[
'name'
]
:
'field'
)
.
'-'
.
md5
(
microtime
(
true
))
);
$sLabel
=
''
;
$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'
;
$sPrepend
=
$this
->
_tag
(
'div'
,[
'class'
=>
'input-group-prepend'
],
$this
->
_tag
(
'span'
,
[
'class'
=>
'input-group-text'
]
,
$aOptions
[
'prepend'
])
);
}
if
(
isset
(
$aOptions
[
'append'
])
&&
$aOptions
[
'append'
]){
$sWrapperclass
=
'input-group'
;
$sAppend
=
$this
->
_tag
(
'div'
,[
'class'
=>
'input-group-append'
],
$this
->
_tag
(
'span'
,
[
'class'
=>
'input-group-text'
]
,
$aOptions
[
'append'
])
);
}
return
$this
->
_tag
(
'div'
,
[
'class'
=>
$sWrapperclass
],
$sLabel
.
$sPrepend
.
$this
->
_tag
(
'input'
,
$aElement
,
''
,
false
)
.
$sAppend
);
}
}
}
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