You are here

function custom_breadcrumbs_taxonomy_enable in Custom Breadcrumbs 7.2

Same name and namespace in other branches
  1. 6.2 custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module \custom_breadcrumbs_taxonomy_enable()

Implements hook_enable().

File

custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.install, line 11
Install file for the custom_breadcrumbs_taxonomy module.

Code

function custom_breadcrumbs_taxonomy_enable() {

  // Sets weight of custom_breadcrumbs_taxonomy to be greater than taxonomy,
  // views, and custom_breadcrumbs.
  $max_weight = custom_breadcrumbs_taxonomy_minimum_module_weight();
  $current_weight = _custom_breadcrumbs_get_module_weight(array(
    'custom_breadcrumbs_taxonomy',
  ));
  if ($current_weight['custom_breadcrumbs_taxonomy'] < $max_weight) {
    drupal_set_message(t('Increasing the weight of custom_breadcrumbs_taxonomy for use with other modules.'));
    db_update('system')
      ->fields(array(
      'weight' => $max_weight,
    ))
      ->condition('name', 'custom_breadcrumbs_taxonomy')
      ->execute();
    variable_set('menu_rebuild_needed', TRUE);
  }
}