Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
clientside_validation
Commits
6b26ea94
Commit
6b26ea94
authored
May 07, 2012
by
Jelle Sebreghts
Browse files
don't use disabled settings
parent
3acffb8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
clientside_validation.admin.inc
clientside_validation.admin.inc
+8
-4
clientside_validation.module
clientside_validation.module
+4
-1
No files found.
clientside_validation.admin.inc
View file @
6b26ea94
...
...
@@ -90,7 +90,7 @@ function clientside_validation_general_settings_form($form_id, $form_state) {
}
function
clientside_validation_settings_form
(
$form
,
$form_state
,
$cvs_formid
=
NULL
,
$cvs_type
=
'default'
)
{
$settings
=
clientside_validation_settings_load
(
$cvs_type
,
$cvs_formid
);
$settings
=
clientside_validation_settings_load
(
$cvs_type
,
$cvs_formid
,
TRUE
);
$form
[
'new'
]
=
array
(
'#type'
=>
'value'
,
...
...
@@ -452,13 +452,15 @@ function _cv_setting_status($status) {
function
clientside_validation_settings_overview
(
$form
,
$form_state
,
$cvs_type
)
{
$form
=
array
();
$settings
=
clientside_validation_settings_load
(
$cvs_type
);
$settings
=
clientside_validation_settings_load
(
$cvs_type
,
NULL
,
TRUE
);
$definedforms
=
array
();
$empty_text
=
""
;
switch
(
$cvs_type
)
{
case
'content-types'
:
$destination
=
array
(
'destination'
=>
'admin/config/validation/clientside_validation/content-types'
);
$settinguri
=
'admin/config/validation/clientside_validation/content-types/'
;
$headerlabel
=
t
(
'Content type'
);
$empty_text
=
t
(
'No content types available'
);
$content_types
=
node_type_get_types
();
foreach
(
$content_types
as
$content_type
)
{
...
...
@@ -473,6 +475,7 @@ function clientside_validation_settings_overview($form, $form_state, $cvs_type)
$destination
=
array
(
'destination'
=>
'admin/config/validation/clientside_validation/webforms'
);
$settinguri
=
'admin/config/validation/clientside_validation/webforms/'
;
$headerlabel
=
t
(
'Webforms'
);
$empty_text
=
t
(
'No webforms available'
);
$webform_types
=
webform_variable_get
(
'webform_node_types'
);
$nodes
=
array
();
...
...
@@ -496,6 +499,7 @@ function clientside_validation_settings_overview($form, $form_state, $cvs_type)
$destination
=
array
(
'destination'
=>
'admin/config/validation/clientside_validation/custom-forms'
);
$settinguri
=
'admin/config/validation/clientside_validation/custom-forms/'
;
$headerlabel
=
t
(
'Form Id'
);
$empty_text
=
t
(
'No custom forms added yet'
);
foreach
(
$settings
as
$customform
)
{
$definedforms
[]
=
array
(
...
...
@@ -600,11 +604,11 @@ function clientside_validation_settings_overview($form, $form_state, $cvs_type)
t
(
'Status'
),
t
(
'Actions'
),
);
$form
[
'content
type
s'
]
=
array
(
$form
[
str_replace
(
'-'
,
''
,
$cvs_
type
)
]
=
array
(
'#theme'
=>
'table'
,
'#header'
=>
$header
,
'#rows'
=>
$rows
,
'#empty'
=>
t
(
'No content types available.'
)
,
'#empty'
=>
$empty_text
,
);
return
$form
;
...
...
clientside_validation.module
View file @
6b26ea94
...
...
@@ -1199,7 +1199,7 @@ function clientside_validation_settings_load_defaults() {
return
$defaults
;
}
function
clientside_validation_settings_load
(
$cvs_type
=
NULL
,
$cvs_formid
=
NULL
)
{
function
clientside_validation_settings_load
(
$cvs_type
=
NULL
,
$cvs_formid
=
NULL
,
$include_disabled
=
FALSE
)
{
if
(
$cvs_type
==
'default'
)
{
$default_settings
=
array
(
'validate_options'
=>
array
(
...
...
@@ -1238,6 +1238,9 @@ function clientside_validation_settings_load($cvs_type = NULL, $cvs_formid = NUL
if
(
!
empty
(
$cvs_formid
))
{
$query
->
condition
(
'form_id'
,
$cvs_formid
);
}
if
(
!
$include_disabled
)
{
$query
->
condition
(
'status'
,
1
);
}
$result
=
$query
->
execute
();
...
...
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