summaryrefslogtreecommitdiff
path: root/modules/tracker/tracker.module
blob: 489160f96d580af7af0689827597bdec44cba193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
// $Id$

/**
 * @file
 * Enables tracking of recent posts for users.
 */

/**
 * Implementation of hook_help().
 */
function tracker_help($path, $arg) {
  switch ($path) {
    case 'admin/help#tracker':
      $output = '<p>' . t('The tracker module displays the most recently added or updated content on your site, and provides user-level tracking to follow the contributions of particular authors.') . '</p>';
      $output .= '<p>' . t("The <em>Recent posts</em> page is available via a link in the navigation menu block and displays new and recently-updated content (including the content type, the title, the author's name, number of comments, and time of last update) in reverse chronological order. Posts are marked updated when changes occur in the text, or when new comments are added. To use the tracker module to follow a specific user's contributions, select the <em>Track</em> tab from the user's profile page.") . '</p>';
      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) . '</p>';
      return $output;
  }
}

/**
 * Implementation of hook_menu().
 */
function tracker_menu() {
  $items['tracker'] = array(
    'title' => 'Recent posts',
    'page callback' => 'tracker_page',
    'access arguments' => array('access content'),
    'weight' => 1,
    'file' => 'tracker.pages.inc',
  );
  $items['tracker/all'] = array(
    'title' => 'All recent posts',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'access callback' => 'user_is_logged_in',
  );
  $items['tracker/%user_current'] = array(
    'title' => 'My recent posts',
    'access callback' => 'user_is_logged_in',
    'page arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
  );

  $items['user/%user/track'] = array(
    'title' => 'Track',
    'page callback' => 'tracker_page',
    'page arguments' => array(1, TRUE),
    'type' => MENU_LOCAL_TASK,
    'file' => 'tracker.pages.inc',
  );
  $items['user/%user/track/posts'] = array(
    'title' => 'Track posts',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  return $items;
}