1) { $output['form'] = drupal_get_form('userpoints_filter_cat_select', 'userpoints/', $tid); } $output['table'] = array( '#markup' => theme('table', array('header' => $header, 'rows' => $rows)), ); $output['pager'] = array( '#markup' => theme('pager'), ); return $output; } /** * Themes the header of the table on the "user by points" page. * * @return * An header array used by theme_table() and TableSort. */ function theme_userpoints_list_users_header() { return array( array('data' => t('User'), 'field' => 'u.name'), array('data' => t('Category'), 'field' => 't.name'), array('data' => t('!Points', userpoints_translation()), 'field' => 'p.points', 'sort' => 'desc'), ); } /* * Themes the output of a single row of the "user by points" page * * @return * Array for a single row, suitable for inclusion with theme_table. */ function theme_userpoints_list_users_row($attributes) { global $user; $row = $attributes['row']; if (!$row->cat) { $row->cat = t('!Uncategorized', userpoints_translation()); } $details = ''; if ($user->uid == $row->uid) { $details = "  " . l(t("(details)"), "myuserpoints"); } return array( array('data' => theme('username', array('account' => $row)) . $details), array('data' => $row->cat, 'align' => 'right'), array('data' => $row->points, 'align' => 'right'), ); } /** * Theme implementation to display a userpoints category. */ function theme_userpoints_view_category($variables) { $element = $variables['element']; $element += array( '#attributes' => array(), ); $output = ''; if (!empty($element['#title'])) { $output .= '

' . $element['#title'] . '

'; } $output .= '
'; $output .= drupal_render_children($element); $output .= '
'; return $output; } /** * Theme implementation to display a userpoints item. */ function theme_userpoints_view_item($variables) { $element = $variables['element']; $element += array( '#attributes' => array(), ); $output = '
' . $element['#title'] . '
'; $output .= '
' . $element['#value'] . '
'; return $output; }