You are here

function node_page_disable_enable in Node Page Disable 7

Same name and namespace in other branches
  1. 6 node_page_disable.install \node_page_disable_enable()

Implements hook_enable().

File

./node_page_disable.install, line 26
Handles installation steps for node_page_disable

Code

function node_page_disable_enable() {

  // Set up the default value based on frontpage
  $frontpage = variable_get('site_frontpage', 'node');
  if ($frontpage == 'node') {
    variable_set('node_page_disable_path_node_keep', TRUE);
  }
  else {
    variable_set('node_page_disable_path_node_keep', FALSE);
    drupal_set_message(t('The path <a href="@url">/node</a> is no longer active.', array(
      '@url' => url('node'),
    )));
  }
  variable_set('menu_rebuild_needed', TRUE);

  // Message about module settings
  drupal_set_message(t('You may adjust settings for Node Page Disable by visiting <a href="@url">@url</a>.', array(
    '@url' => url('admin/config/system/site-information'),
  )));
}