You are here

function user_relationshipsactivity_page in Activity 6

Same name and namespace in other branches
  1. 5.4 contrib/user_relationshipsactivity/user_relationshipsactivity.module \user_relationshipsactivity_page()

user_relationships activity page callback

1 string reference to 'user_relationshipsactivity_page'
user_relationshipsactivity_menu in contrib/user_relationshipsactivity/user_relationshipsactivity.module
Implementation of hook_menu().

File

contrib/user_relationshipsactivity/user_relationshipsactivity.module, line 240

Code

function user_relationshipsactivity_page($type = NULL) {
  global $user;
  drupal_add_css(drupal_get_path('module', 'activity') . '/activity.css');
  if ($type) {
    if (user_access('view own activity')) {
      $relationships = user_relationships_load(array(
        'rtid' => $type,
        'user' => $user->uid,
        'approved' => 1,
      ));
      foreach ($relationships as $relationship) {
        if ($relationship->requester_id == $user->uid) {
          $uids[] = $relationship->requestee_id;
        }
        else {
          $uids[] = $relationship->requester_id;
        }
      }
      $activities = array();
      if ($uids) {
        $activities = activity_get_activity($uids, NULL, variable_get('activity_page_pager', 20));
      }
      $table = theme('activity_table', $activities);
      return theme('activity_page', $activities, $table);
    }
  }
  $table = theme('activity_table', array());
  return theme('activity_page', array(), $table);
}