You are here

function icon_menu_alter in Icon API 7

Implements hook_menu_alter().

File

./icon.module, line 164
icon.module Provides icon integration with menu items.

Code

function icon_menu_alter(&$items) {

  // Create a path alias for users with the "view icons" permission.
  $view_path_alias = variable_get('icon_api_view_path_alias');

  // If variable is not set and path is not taken, set it.
  if ($view_path_alias === NULL && empty($items['icons'])) {
    $view_path_alias = 'icons';
    variable_set('icon_api_view_path_alias', $view_path_alias);
  }
  $tmp_path = ICON_ADMIN_PATH . '/tmp';
  if (!empty($view_path_alias)) {
    $items[$view_path_alias] = $items[$tmp_path];
    $items[$view_path_alias . '/%icon_bundle'] = $items[$tmp_path . '/%icon_bundle'];
  }
  unset($items[$tmp_path]);
  unset($items[$tmp_path . '/%icon_bundle']);
}