You are here

webform_default_fields.install in Webform Default Fields 6

Installation Webform Default Fields module routines

File

webform_default_fields.install
View source
<?php

// $Id$

/**
 * @file
 * Installation Webform Default Fields module routines
 */

/**
 * Implementation of hook_enable().
 */
function webform_default_fields_enable() {
  module_load_include('module', 'webform_default_fields');
  foreach (webform_variable_get('webform_node_types') as $content_type) {
    if (variable_get('webform_default_fields_nid_' . $content_type, 0)) {
      $nid = _webform_default_fields_create_container_node($content_type);
      variable_set('webform_default_fields_nid_' . $content_type, $nid);
    }
  }
  menu_rebuild();
}

/**
 * Implementation of hook_uninstall().
 */
function webform_default_fields_uninstall() {
  foreach (webform_variable_get('webform_node_types') as $content_type) {
    $nid = variable_get('webform_default_fields_nid_' . $content_type, 0);
    if ($nid) {
      node_delete($nid);
    }
  }
}

Functions

Namesort descending Description
webform_default_fields_enable Implementation of hook_enable().
webform_default_fields_uninstall Implementation of hook_uninstall().