You are here

function follow_menu in Follow 5

Same name and namespace in other branches
  1. 6 follow.module \follow_menu()
  2. 7.2 follow.module \follow_menu()
  3. 7 follow.module \follow_menu()

Implementation of hook_menu().

File

./follow.module, line 26
Allows users to add links to their social network profiles.

Code

function follow_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/follow',
      'title' => t('Site follow links'),
      'description' => t('Add sitewide follow links'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'follow_links_form',
      ),
      'access' => user_access('edit site follow links'),
    );
  }
  else {
    $items[] = array(
      'path' => 'user/' . arg(1) . '/follow',
      'title' => 'My follow links',
      'description' => 'edit follow links',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'follow_links_form',
        1,
      ),
      'access' => user_access('follow_links_user_access'),
      'type' => MENU_LOCAL_TASK,
    );

    // Add the Follow CSS.
    drupal_add_css(drupal_get_path('module', 'follow') . '/follow.css');
  }
  return $items;
}