You are here

function submitted_by_install in Submitted By 7

Set up submitted varaiables.

File

./submitted_by.install, line 22
Install, update and uninstall functions for the Submitted By module.

Code

function submitted_by_install() {

  // Get all node type.
  $node_types = node_type_get_types();

  // Get info about view_modes.
  $entity_info = entity_get_info('node');
  foreach ($entity_info['view modes'] as $mode => $info) {
    $strings[$mode] = SUBMITTED_BY_NODE_TEXT;
  }

  // Save the node type and comment settings.
  foreach ($node_types as $node_type) {
    variable_set('submitted_by_' . $node_type->type, $strings);
    variable_set('submitted_by_comment_node_' . $node_type->type, SUBMITTED_BY_COMMENT_NODE_TEXT);
  }
}