You are here

function activity_page in Activity 6

Same name and namespace in other branches
  1. 5.4 activity.module \activity_page()
  2. 5 activity.module \activity_page()
  3. 5.2 activity.module \activity_page()
  4. 5.3 activity.module \activity_page()

Menu callback for displaying site or user activity as full page.

1 string reference to 'activity_page'
activity_menu in ./activity.module
Implementation of hook_menu().

File

./activity.module, line 871
activity.module

Code

function activity_page($page = 'all') {
  global $user;
  drupal_add_css(drupal_get_path('module', 'activity') . '/activity.css');
  if ($page == 'mine') {
    $activities = activity_get_activity($user->uid, NULL, variable_get('activity_page_pager', 20));
    $table = theme('activity_table', $activities);
    $feed_url = url('activity/' . $user->uid . '/feed');
    drupal_add_feed($feed_url);
    $feed = theme('feed_icon', $feed_url, t('My activity'));
    return theme('activity_page', $activities, $table);
  }
  else {
    if ($page == 'all') {
      $activities = activity_get_activity(ACTIVITY_ALL, NULL, variable_get('activity_page_pager', 20));
      $table = theme('activity_table', $activities);
      $feed_url = url('activity/all/feed');
      drupal_add_feed($feed_url);
      $feed = theme('feed_icon', $feed_url, t('All activity'));
      return theme('activity_page', $activities, $table);
    }
  }
}