You are here

function context_menu_block_enable in Context: Menu Block 7.3

Same name and namespace in other branches
  1. 6.3 context_menu_block.install \context_menu_block_enable()

Implementation of hook_enable().

File

./context_menu_block.install, line 16
Install file for Context: Menu Block.

Code

function context_menu_block_enable() {
  $t = get_t();
  $info = drupal_parse_info_file(drupal_get_path('module', 'context') . '/context.info');

  // Check to see if Context's version is defined in its .info file.
  // @see context_menu_block_requirements()
  if (!isset($info['version'])) {
    variable_set('context_menu_block_validate', TRUE);
    drupal_set_message($t('Context does not have a version defined in its .info file. This could be because you are using a checkout of its git repository. For Context: Menu Block support, make sure you are using the @branch branch of Context.', array(
      '@branch' => CONTEXT_MENU_BLOCK_CONTEXT_SUPPORTED,
    )), 'warning');
  }
  elseif (!_context_menu_block_validate_context($info['version'])) {
    drupal_set_message($t('Context: Menu Block requires Context @branch. Update Context to continue using Context: Menu Block.', array(
      '@branch' => CONTEXT_MENU_BLOCK_CONTEXT_SUPPORTED,
    )), 'error');
  }
}