You are here

coder_upgrade.module in Coder 7

Same filename and directory in other branches
  1. 7.2 coder_upgrade/coder_upgrade.module

File

coder_upgrade/coder_upgrade.module
View source
<?php

/**
 * @file
 * Provides primary Drupal hook implementations.
 *
 * Developer module that assists a contributed module with version upgrade from
 * the Drupal 6.x to 7.x core API. The module creates new code files by
 * modifying existing code files in accordance with the core API changes. The
 * module goal is to enable 6.x module developers to release a 7.x version in
 * conjunction with the release of Drupal 7. The initial 7.x version would be
 * a straight port of features from the 6.x version. Feature changes and
 * other enhancements would then occur subsequent to the initial 7.x release.
 *
 * For a list of core API changes that are handled by this module, see:
 * - http://drupal.org/node/394070
 *
 * Copyright 2008-11 by Jim Berry ("solotandem", http://drupal.org/user/240748)
 */
if (function_exists('t')) {

  // This code is being executed inside a process running Drupal.
  module_load_include('inc', 'coder_upgrade', 'coder_upgrade');
}

/**
 * Implements hook_permission().
 */
function coder_upgrade_permission() {
  return array(
    'administer code conversions' => array(
      'title' => t('Administer code conversions'),
      'description' => t('Manage code conversion tasks for Coder Upgrade.'),
    ),
  );
}

/**
 * Implements hook_menu().
 */
function coder_upgrade_menu() {
  module_load_include('inc', 'coder_upgrade', 'includes/menu');
  return _coder_upgrade_menu();
}

/**
 * Implements hook_menu_alter().
 */
function coder_upgrade_menu_alter(&$items) {
  if (!module_exists('coder_review')) {

    // Remove the Coder menu item.
    unset($items['admin/config/development/coder']);

    // Promote the menu items defined by this module.
    $items['admin/config/development/coder/upgrade']['title'] = 'Coder Upgrade';
    $items['admin/config/development/coder/upgrade']['type'] = MENU_NORMAL_ITEM;
  }
}

/**
 * Implements hook_help().
 */
function coder_upgrade_help($path, $arg) {
  if (strpos($path, 'admin/config/development/coder/upgrade') === 0 || $path == 'admin/help#coder_upgrade') {
    module_load_include('inc', 'coder_upgrade', 'includes/help');
    return _coder_upgrade_help($path, $arg);
  }
}