You are here

function webform_install in Webform 6.3

Same name and namespace in other branches
  1. 5.2 webform.install \webform_install()
  2. 5 webform.install \webform_install()
  3. 6.2 webform.install \webform_install()
  4. 7.4 webform.install \webform_install()
  5. 7.3 webform.install \webform_install()

Implements hook_install().

File

./webform.install, line 417
Webform module install/schema hooks.

Code

function webform_install() {
  module_load_include('inc', 'node', 'content_types');
  db_query("UPDATE {system} SET weight = -1 WHERE name = 'webform' AND type = 'module'");
  drupal_install_schema('webform');

  // Optionally create the default webform type.
  if (variable_get('webform_install_create_content_type', TRUE)) {
    $webform_type = array(
      'type' => 'webform',
      'name' => st('Webform'),
      'module' => 'node',
      'description' => st('Create a new form or questionnaire accessible to users. Submission results and statistics are recorded and accessible to privileged users.'),
      'custom' => TRUE,
      'modified' => TRUE,
      'locked' => FALSE,
    );
    $webform_type = (object) _node_type_set_defaults($webform_type);
    node_type_save($webform_type);
  }
}