Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-forms
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
wpdesk
wp-forms
Commits
ee85f8e6
Commit
ee85f8e6
authored
5 years ago
by
Marcin Kolanko
Browse files
Options
Downloads
Patches
Plain Diff
refactored input template
parent
90183c87
No related branches found
No related tags found
No related merge requests found
Pipeline
#4962
passed
5 years ago
Stage: prepare
Stage: tools
Stage: tests
Stage: pre-deploy
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/input.php
+34
-92
34 additions, 92 deletions
templates/input.php
with
34 additions
and
92 deletions
templates/input.php
+
34
−
92
View file @
ee85f8e6
...
@@ -7,100 +7,42 @@
...
@@ -7,100 +7,42 @@
*/
*/
?>
?>
<?php
<?php
if
(
!
\in_array
(
$field
->
get_type
(),
[
'number'
,
'text'
,
'hidden'
]))
:
?>
if
(
!
\in_array
(
$field
->
get_type
(),
[
'number'
,
'text'
,
'hidden'
]))
{
<input
type=
"hidden"
name=
"
<?php
echo
$name_prefix
.
'['
.
$field
->
get_name
()
.
']'
;
?>
"
value=
"no"
/>
?>
<?php
endif
;
?>
<input
type=
"hidden"
name=
"
<?php
echo
$name_prefix
;
?>
[
<?php
echo
$field
->
get_name
();
?>
]"
value=
"no"
/>
<?php
}
?>
<?php
<?php
if
(
$field
->
get_type
()
===
'checkbox'
&&
$field
->
has_sublabel
())
:
?>
<label>
<?php
endif
;
?>
if
(
$field
->
get_type
()
===
'checkbox'
&&
$field
->
has_sublabel
())
{
?>
<label>
<?php
}
?>
<input
<input
type=
"
<?php
type=
"
<?php
echo
\esc_attr
(
$field
->
get_type
());
?>
"
echo
\esc_attr
(
$field
->
get_type
());
name=
"
<?php
echo
\esc_attr
(
$name_prefix
)
.
'['
.
\esc_attr
(
$field
->
get_name
())
.
']'
;
?>
"
?>
"
id=
"
<?php
echo
\esc_attr
(
$field
->
get_id
());
?>
"
name=
"
<?php
echo
\esc_attr
(
$name_prefix
);
<?php
if
(
$field
->
has_classes
())
:
?>
?>
[
<?php
class=
"
<?php
echo
\esc_attr
(
$field
->
get_classes
());
?>
"
echo
\esc_attr
(
$field
->
get_name
());
<?php
endif
;
?>
?>
]"
id=
"
<?php
<?php
if
(
$field
->
get_type
()
===
'text'
&&
$field
->
has_placeholder
())
:
?>
echo
\esc_attr
(
$field
->
get_id
());
placeholder=
"
<?php
echo
\esc_html
(
$field
->
get_placeholder
());
?>
"
?>
"
<?php
endif
;
?>
<?php
<?php
foreach
(
$field
->
get_attributes
()
as
$key
=>
$atr_val
)
:
if
(
$field
->
has_classes
())
{
echo
$key
.
'="'
.
\esc_attr
(
$atr_val
)
.
'"'
;
?>
?>
class=
"
<?php
<?php
endforeach
;
?>
echo
\esc_attr
(
$field
->
get_classes
());
?>
"
<?php
<?php
if
(
$field
->
is_required
())
:
?>
required=
"required"
<?php
endif
;
?>
}
<?php
if
(
$field
->
is_disabled
())
:
?>
disabled=
"disabled"
<?php
endif
;
?>
?>
<?php
if
(
$field
->
is_readonly
())
:
?>
readonly=
"readonly"
<?php
endif
;
?>
<?php
if
(
\in_array
(
$field
->
get_type
(),
[
'number'
,
'text'
,
'hidden'
]))
:
?>
<?php
value=
"
<?php
echo
\esc_html
(
$value
);
?>
"
if
(
$field
->
get_type
()
===
'text'
&&
$field
->
has_placeholder
())
{
<?php
else
:
?>
?>
placeholder=
"
<?php
echo
\esc_html
(
$field
->
get_placeholder
());
?>
"
<?php
}
?>
<?php
foreach
(
$field
->
get_attributes
()
as
$key
=>
$atr_val
)
{
echo
$key
;
?>
="
<?php
echo
\esc_attr
(
$atr_val
);
?>
"
<?php
}
?>
<?php
if
(
$field
->
is_required
())
{
?>
required=
"required"
<?php
}
if
(
$field
->
is_disabled
())
{
?>
disabled=
"disabled"
<?php
}
if
(
$field
->
is_readonly
())
{
?>
readonly=
"readonly"
<?php
}
?>
<?php
if
(
\in_array
(
$field
->
get_type
(),
[
'number'
,
'text'
,
'hidden'
]))
{
?>
value=
"
<?php
echo
\esc_html
(
$value
);
?>
"
<?php
}
else
{
?>
value=
"yes"
value=
"yes"
<?php
<?php
if
(
$value
===
'yes'
)
:
?>
if
(
$value
===
'yes'
)
{
checked=
"checked"
?>
checked=
"checked"
<?php
<?php
endif
;
?>
}
<?php
endif
;
?>
}
?>
/>
/>
<?php
<?php
if
(
$field
->
get_type
()
===
'checkbox'
&&
$field
->
has_sublabel
())
:
?>
if
(
$field
->
get_type
()
===
'checkbox'
&&
$field
->
has_sublabel
())
{
<?php
echo
\esc_html
(
$field
->
get_sublabel
());
?>
</label>
?>
<?php
endif
;
?>
<?php
echo
\esc_html
(
$field
->
get_sublabel
());
?>
</label>
<?php
}
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