function webform_node_defaults in Webform 7.4
Same name and namespace in other branches
- 6.3 webform.module \webform_node_defaults()
- 7.3 webform.module \webform_node_defaults()
Default settings for a newly created webform node.
7 calls to webform_node_defaults()
- WebformConditionalsTestCase::webformTestConditionalComponent in tests/
WebformConditionalsTestCase.test - Assembles a test node for checking if conditional properties are respected.
- WebformTestCase::webformForm in tests/
WebformTestCase.test - Create a sample Webform node.
- webform_check_record in ./
webform.module - Utility function to check if a webform record is necessary in the database.
- webform_clone_node_alter in ./
webform.module - Alter the node before saving a clone.
- webform_node_insert in ./
webform.module - Implements hook_node_insert().
File
- ./
webform.module, line 1732 - This module provides a simple way to create forms and questionnaires.
Code
function webform_node_defaults() {
$progress_bar_defaults = webform_variable_get('webform_progressbar_style');
$defaults = array(
'confirmation' => '',
'confirmation_format' => NULL,
'redirect_url' => '<confirmation>',
'block' => '0',
'allow_draft' => '0',
'auto_save' => '0',
'confidential' => '0',
'submit_notice' => '1',
'submit_text' => '',
'next_serial' => 1,
'submit_limit' => '-1',
'submit_interval' => '-1',
'total_submit_limit' => '-1',
'total_submit_interval' => '-1',
'progressbar_page_number' => in_array('progressbar_page_number', $progress_bar_defaults) ? '1' : '0',
'progressbar_percent' => in_array('progressbar_percent', $progress_bar_defaults) ? '1' : '0',
'progressbar_bar' => in_array('progressbar_bar', $progress_bar_defaults) ? '1' : '0',
'progressbar_pagebreak_labels' => in_array('progressbar_pagebreak_labels', $progress_bar_defaults) ? '1' : '0',
'progressbar_include_confirmation' => in_array('progressbar_include_confirmation', $progress_bar_defaults) ? '1' : '0',
'progressbar_label_first' => webform_variable_get('webform_progressbar_label_first'),
'progressbar_label_confirmation' => webform_variable_get('webform_progressbar_label_confirmation'),
'preview' => 0,
'preview_next_button_label' => '',
'preview_prev_button_label' => '',
'preview_title' => '',
'preview_message' => '',
'preview_message_format' => NULL,
'preview_excluded_components' => array(),
'status' => '1',
'record_exists' => FALSE,
'roles' => array(
'1',
'2',
),
'emails' => array(),
'components' => array(),
'conditionals' => array(),
);
drupal_alter('webform_node_defaults', $defaults);
return $defaults;
}