diff --git a/modules/tracker.module b/modules/tracker.module index 24951d50e7defb4eddeb57ffd2db30a8283218cb..925c6b998638eed38007595ca0eff2296e316047 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -37,10 +37,24 @@ function tracker_menu($may_cache) { 'type' => MENU_LOCAL_TASK); } } + else { + if (arg(0) == 'user' && is_numeric(arg(1))) { + $items[] = array('path' => 'user/'. arg(1) .'/track', 'title' => t('track posts'), + 'callback' => 'tracker_track_user', 'access' => user_access('access content'), + 'type' => MENU_LOCAL_TASK); + } + } return $items; } +/** + * Menu callback. Prints a listing of active nodes on the site. + */ +function tracker_track_user() { + tracker_page(arg(1)); +} + /** * Menu callback. Prints a listing of active nodes on the site. */ @@ -90,10 +104,4 @@ function tracker_page($uid = 0) { print theme('page', $output); } -function tracker_user($type, &$edit, &$user) { - if ($type == 'view' && user_access('access content')) { - return array(t('History') => form_item(t('Recent posts'), l(t('recent posts'), "tracker/$user->uid"))); - } -} - ?> diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 24951d50e7defb4eddeb57ffd2db30a8283218cb..925c6b998638eed38007595ca0eff2296e316047 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -37,10 +37,24 @@ function tracker_menu($may_cache) { 'type' => MENU_LOCAL_TASK); } } + else { + if (arg(0) == 'user' && is_numeric(arg(1))) { + $items[] = array('path' => 'user/'. arg(1) .'/track', 'title' => t('track posts'), + 'callback' => 'tracker_track_user', 'access' => user_access('access content'), + 'type' => MENU_LOCAL_TASK); + } + } return $items; } +/** + * Menu callback. Prints a listing of active nodes on the site. + */ +function tracker_track_user() { + tracker_page(arg(1)); +} + /** * Menu callback. Prints a listing of active nodes on the site. */ @@ -90,10 +104,4 @@ function tracker_page($uid = 0) { print theme('page', $output); } -function tracker_user($type, &$edit, &$user) { - if ($type == 'view' && user_access('access content')) { - return array(t('History') => form_item(t('Recent posts'), l(t('recent posts'), "tracker/$user->uid"))); - } -} - ?>