You are here

function rules_i18n_rules_ui_menu_alter in Rules 7.2

Implements hook_menu().

File

rules_i18n/rules_i18n.module, line 11
Rules i18n integration.

Code

function rules_i18n_rules_ui_menu_alter(&$items, $base_path, $base_count) {
  $items[$base_path . '/manage/%rules_config/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -100,
  );

  // I18n generates the menu items for reaction rules. For the others,
  // we provide further i18n menu items for all other base paths.
  if ($base_path != 'admin/config/workflow/rules/reaction') {
    $items[$base_path . '/manage/%rules_config/translate'] = array(
      'title' => 'Translate',
      'page callback' => 'i18n_page_translate_localize',
      'page arguments' => array(
        'rules_config',
        $base_count + 1,
      ),
      'access callback' => 'i18n_object_translate_access',
      'access arguments' => array(
        'rules_config',
        $base_count + 1,
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'i18n.pages.inc',
      'file path' => drupal_get_path('module', 'i18n'),
      'weight' => 10,
    );
    $items[$base_path . '/manage/%rules_config/translate/%i18n_language'] = array(
      'title' => 'Translate',
      'page callback' => 'i18n_page_translate_localize',
      'page arguments' => array(
        'rules_config',
        $base_count + 1,
        $base_count + 3,
      ),
      'access callback' => 'i18n_object_translate_access',
      'access arguments' => array(
        'rules_config',
        $base_count,
      ),
      'type' => MENU_CALLBACK,
      'file' => 'i18n.pages.inc',
      'file path' => drupal_get_path('module', 'i18n'),
      'weight' => 10,
    );
  }
}