tracker.module 2.29 KB
Newer Older
Dries's avatar
   
Dries committed
1
<?php
2
// $Id$
Dries's avatar
   
Dries committed
3

Dries's avatar
   
Dries committed
4
5
6
7
8
/**
 * @file
 * Enables tracking of recent posts for users.
 */

Dries's avatar
Dries committed
9
10
11
/**
 * Implementation of hook_help().
 */
12
13
function tracker_help($path, $arg) {
  switch ($path) {
Dries's avatar
   
Dries committed
14
    case 'admin/help#tracker':
15
16
      $output = '<p>'. t('The tracker module displays the most recently added or updated content to the website allowing users to see the most recent contributions. The tracker module provides user level tracking for those who like to follow the contributions of particular authors.') .'</p>';
      $output .= '<p>'. t('The  &quot;recent posts&quot; page is available via a link in the navigation menu block and contains a reverse chronological list of new and recently-updated content. The table displays  the content type, the title, the author\'s name, how many comments that item has received, and when it was last updated. Updates include any changes to the text, either by the original author or someone else, as well as any new comments added to an item. To use the tracker module to <em>watch</em> for a user\'s updated content, click on that user\'s profile, then the <em>track</em> tab.') .'</p>';
17
      $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="@tracker">Tracker page</a>.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) .'</p>';
18
      return $output;
Dries's avatar
   
Dries committed
19
  }
Dries's avatar
   
Dries committed
20
21
}

Dries's avatar
   
Dries committed
22
/**
Dries's avatar
   
Dries committed
23
 * Implementation of hook_menu().
Dries's avatar
   
Dries committed
24
 */
25
26
function tracker_menu() {
  $items['tracker'] = array(
27
    'title' => 'Recent posts',
28
29
30
    'page callback' => 'tracker_page',
    'access arguments' => array('access content'),
    'weight' => 1,
31
    'file' => 'tracker.pages.inc',
32
33
  );
  $items['tracker/all'] = array(
34
    'title' => 'All recent posts',
35
36
37
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'access callback' => 'user_is_logged_in',
  );
38
  $items['tracker/%user_current'] = array(
39
    'title' => 'My recent posts',
40
    'access callback' => 'user_is_logged_in',
41
42
    'page arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
43
  );
44
45

  $items['user/%user/track'] = array(
46
    'title' => 'Track',
47
48
    'page callback' => 'tracker_page',
    'page arguments' => array(1, TRUE),
49
    'type' => MENU_LOCAL_TASK,
50
    'file' => 'tracker.pages.inc',
51
  );
52
  $items['user/%user/track/posts'] = array(
53
    'title' => 'Track posts',
54
55
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
Dries's avatar
   
Dries committed
56
  return $items;
Dries's avatar
   
Dries committed
57
}