Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
better_exposed_filters
Commits
4ff18a16
Commit
4ff18a16
authored
Aug 16, 2015
by
Mike Keran
Browse files
Proper handling of JSON encoded options for the datepicker.
parent
b65c73e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
better_exposed_filters_exposed_form_plugin.inc
View file @
4ff18a16
...
...
@@ -1298,7 +1298,7 @@ dateFormat: "dd-mm-yy"
$form
[
$filter_id
][
'max'
][
'#description'
]
=
$form
[
$filter_id
][
'#bef_description'
];
}
}
$bef_js
[
'datepicker_options'
][
'dateFormat'
]
=
str_replace
(
array_keys
(
$convert
),
array_values
(
$convert
),
$format
);
$bef_js
[
'datepicker_options'
][
'dateFormat'
]
=
json_encode
(
str_replace
(
array_keys
(
$convert
),
array_values
(
$convert
),
$format
)
)
;
}
else
{
$bef_js
[
'datepicker_options'
][
'dateFormat'
]
=
''
;
...
...
@@ -1337,6 +1337,11 @@ dateFormat: "dd-mm-yy"
if
(
!
empty
(
$options
[
'more_options'
][
'datepicker_options'
]))
{
foreach
(
explode
(
"
\n
"
,
$options
[
'more_options'
][
'datepicker_options'
])
as
$setting
)
{
list
(
$key
,
$val
)
=
explode
(
':'
,
trim
(
$setting
),
2
);
// No need to json_encode() this value like we do other datepicker
// options as it should already be entered in JSON format in the
// UI. While having an admin enter JSON in a text field is not
// ideal, it is how the jQueryUI widget documentation shows it in
// their examples.
$bef_js
[
'datepicker_options'
][
$key
]
=
$val
;
}
}
...
...
Write
Preview
Supports
Markdown
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