webform_default_fields.install in Webform Default Fields 7
Same filename and directory in other branches
Installation Webform Default Fields module routines
File
webform_default_fields.installView source
<?php
// $Id$
/**
* @file
* Installation Webform Default Fields module routines
*/
/**
* Implements 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();
}
/**
* Implements 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) {
variable_del('webform_default_fields_nid_' . $content_type);
node_delete($nid);
}
}
}
Functions
Name | Description |
---|---|
webform_default_fields_enable | Implements hook_enable(). |
webform_default_fields_uninstall | Implements hook_uninstall(). |