Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
soundcloudfield
Commits
65a0a3ef
Commit
65a0a3ef
authored
Mar 02, 2014
by
attila.fekete
Browse files
Readable width validation
parent
6f12e7e6
Changes
1
Show whitespace changes
Inline
Side-by-side
soundcloudfield.module
View file @
65a0a3ef
...
@@ -217,7 +217,9 @@ function soundcloudfield_field_instance_settings_form($field, $instance) {
...
@@ -217,7 +217,9 @@ function soundcloudfield_field_instance_settings_form($field, $instance) {
* Validate the field settings form.
* Validate the field settings form.
*/
*/
function
soundcloudfield_settings_form_validate
(
$element
,
&
$form_state
,
$complete_form
)
{
function
soundcloudfield_settings_form_validate
(
$element
,
&
$form_state
,
$complete_form
)
{
if
(
!
empty
(
$form_state
[
'values'
][
'instance'
][
'settings'
][
'soundcloudplayer'
][
'width'
])
&&
(
$form_state
[
'values'
][
'instance'
][
'settings'
][
'soundcloudplayer'
][
'width'
]
<
1
||
$form_state
[
'values'
][
'instance'
][
'settings'
][
'soundcloudplayer'
][
'width'
]
>
100
))
{
// Validate width.
$width
=
$form_state
[
'values'
][
'instance'
][
'settings'
][
'soundcloudplayer'
][
'width'
];
if
(
!
empty
(
$width
)
&&
(
$width
<
1
||
$width
>
100
))
{
form_set_error
(
'instance][settings][soundcloudplayer][width'
,
t
(
'Player width must be a positive integer between 1-100'
));
form_set_error
(
'instance][settings][soundcloudplayer][width'
,
t
(
'Player width must be a positive integer between 1-100'
));
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment