1 node_hooks_example.install node_hooks_example_install()

Implements hook_install().

We need to set a default node_hooks_example_node_type_<contentType> setting to 0 for each available content type.

We call node_type_get_types() to get a list of all the content types.

File

modules/examples/node_hooks_example/node_hooks_example.install, line 57
Install, update and uninstall functions for the nodeapi_example module.

Code

function node_hooks_example_install() {
  $config = config('node_hooks_example.settings');
  $node_types = array_keys(node_type_get_types());
  foreach ($node_types as $type) {
    $config->set('node_hooks_example_node_type_' . $type, 0);
  }
  $config->save();
}