Commit d39be464 authored by Jelle Sebreghts's avatar Jelle Sebreghts
Browse files

hide webform settings if clientside_validation_webform is disabled

parent 6b26ea94
...@@ -438,7 +438,7 @@ function clientside_validation_settings_form_submit($form, &$form_state) { ...@@ -438,7 +438,7 @@ function clientside_validation_settings_form_submit($form, &$form_state) {
clientside_validation_settings_update($cvs_type, $cvs_formid, $values); clientside_validation_settings_update($cvs_type, $cvs_formid, $values);
} }
else { else {
clientside_validation_settings_add($cvs_type, $cvs_formid, $values); clientside_validation_settings_add($cvs_type, $cvs_formid, $values, TRUE);
} }
} }
} }
......
...@@ -68,15 +68,17 @@ function clientside_validation_menu() { ...@@ -68,15 +68,17 @@ function clientside_validation_menu() {
'file' => 'clientside_validation.admin.inc', 'file' => 'clientside_validation.admin.inc',
'weight' => 10, 'weight' => 10,
); );
$items['admin/config/validation/clientside_validation/webforms'] = array( if (module_exists('clientside_validation_webform')) {
'title' => 'Webforms', $items['admin/config/validation/clientside_validation/webforms'] = array(
'description' => 'Override settings for webforms.', 'title' => 'Webforms',
'page callback' => 'drupal_get_form', 'description' => 'Override settings for webforms.',
'page arguments' => array('clientside_validation_settings_overview', 'webforms'), 'page callback' => 'drupal_get_form',
'access arguments' => array('administer site configuration'), 'page arguments' => array('clientside_validation_settings_overview', 'webforms'),
'file' => 'clientside_validation.admin.inc', 'access arguments' => array('administer site configuration'),
'weight' => 11, 'file' => 'clientside_validation.admin.inc',
); 'weight' => 11,
);
}
$items['admin/config/validation/clientside_validation/custom-forms'] = array( $items['admin/config/validation/clientside_validation/custom-forms'] = array(
'title' => 'Custom forms', 'title' => 'Custom forms',
'description' => 'Override settings for custom forms.', 'description' => 'Override settings for custom forms.',
...@@ -224,7 +226,6 @@ function clientside_validation_webform_after_build(&$form, &$form_state) { ...@@ -224,7 +226,6 @@ function clientside_validation_webform_after_build(&$form, &$form_state) {
$settings = array(); $settings = array();
_clientside_validation_add_general_settings($settings, $form['#id']); _clientside_validation_add_general_settings($settings, $form['#id']);
_clientside_validation_add_special_rules($js_rules, $settings, $form); _clientside_validation_add_special_rules($js_rules, $settings, $form);
if (variable_get('clientside_validation_use_minified', 0) == 0) { if (variable_get('clientside_validation_use_minified', 0) == 0) {
drupal_add_js(drupal_get_path('module', 'clientside_validation') . '/jquery-validate/jquery.validate.js'); drupal_add_js(drupal_get_path('module', 'clientside_validation') . '/jquery-validate/jquery.validate.js');
} }
...@@ -330,7 +331,6 @@ function clientside_validation_form_after_build(&$form, &$form_state) { ...@@ -330,7 +331,6 @@ function clientside_validation_form_after_build(&$form, &$form_state) {
function _clientside_validation_add_general_settings(&$settings, $form_id) { function _clientside_validation_add_general_settings(&$settings, $form_id) {
$definedsettings = clientside_validation_settings_current_form(); $definedsettings = clientside_validation_settings_current_form();
// Add a setting for this form if the hidden elements should still be validated // Add a setting for this form if the hidden elements should still be validated
$include_hidden_setting = $definedsettings['include_hidden']['include_hidden']; $include_hidden_setting = $definedsettings['include_hidden']['include_hidden'];
$include_hidden = preg_split('/(\r\n?|\n)/', $include_hidden_setting, -1, PREG_SPLIT_NO_EMPTY); $include_hidden = preg_split('/(\r\n?|\n)/', $include_hidden_setting, -1, PREG_SPLIT_NO_EMPTY);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment