You are here

function me_menu in me aliases 5

Same name and namespace in other branches
  1. 8 me.module \me_menu()
  2. 6.2 me.module \me_menu()
  3. 6 me.module \me_menu()
  4. 7 me.module \me_menu()

Implementation of hook_menu().

File

./me.module, line 6

Code

function me_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/me',
      'title' => t('\'me\' Aliases'),
      'description' => t('Define URL paths for Me aliasing.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'me_settings',
      ),
      'access' => user_access('administer site configuration'),
      'type' => MENU_NORMAL_ITEM,
    );
  }

  // If users have static paths for 'me' in the menu, then we need to be able to handle those correctly.
  // This is handled when $may_cache is TRUE.
  // When $may_cache is FALSE, then we need to check the current path to see

  //i f it matches any of our aliases. We only need to check that it matches

  // the beginning of the alias. For this to work properly, 'me' also needs
  // to be the last module to run it's hook_menu().
  return array_merge($items, _me_create_menu_items($may_cache));
}