You are here

function support_user_view in Support Ticketing System 7

Implementation of hook_user_view().

File

./support.module, line 822
support.module

Code

function support_user_view($account, $view_mode, $langcode) {
  global $user;
  if (variable_get('support_display_user_links', TRUE)) {
    if ($view_mode == 'full' && (user_access('create support_ticket content', $account) && $user->uid == $account->uid || user_access('administer support'))) {
      $items = array();
      $items[] = l(t('View recent tickets'), "support/user/{$account->uid}", array(
        'attributes' => array(
          'title' => t("Read @username's latest tickets.", array(
            '@username' => check_plain($account->name),
          )),
        ),
      ));
      $items[] = l(t('Create new ticket'), 'node/add/support-ticket');
      $account->content['summary']['support'] = array(
        '#type' => 'user_profile_item',
        '#title' => t('Tickets'),
        '#markup' => theme('item_list', array(
          'items' => $items,
        )),
        '#attributes' => array(
          'class' => array(
            'support',
          ),
        ),
      );
    }
  }
}