You are here

function _signup_user_no_views in Signup 6.2

Same name and namespace in other branches
  1. 5.2 includes/views.none.inc \_signup_user_no_views()

Private helper as a partial implementation of hook_user().

See also

signup_user()

1 call to _signup_user_no_views()
signup_user in ./signup.module
Implementation of hook_user().

File

includes/no_views.inc, line 55
Provides all the code for required UI elements for sites that do not have views.module enabled. If views is enabled, there are default views for all of these things (which are therefore customizable and more powerful) in signup/views/views.inc.

Code

function _signup_user_no_views($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'view':

      // grab list of nodes the user signed up for.
      $signups = signup_list_user_signups($user->uid);
      if (count($signups) && variable_get('signup_no_views_user_info', TRUE)) {
        $user->content['signup'] = array(
          '#type' => 'user_profile_category',
          '#attributes' => array(
            'class' => 'signup',
          ),
          '#weight' => 5,
          '#title' => t('Signup information'),
        );
        $user->content['signup']['current'] = array(
          '#type' => 'user_profile_item',
          '#attributes' => array(
            'class' => 'signup-current',
          ),
          '#title' => t('Current signups'),
          '#value' => theme_item_list($signups),
          '#weight' => 0,
        );
        $user->content['signup']['schedule'] = array(
          '#type' => 'user_profile_item',
          '#attributes' => array(
            'class' => 'signup-schedule',
          ),
          '#title' => t('Signup schedule'),
          '#value' => l(t('View full signup schedule'), 'user/' . $user->uid . '/signups'),
          '#weight' => 2,
        );
      }
      break;
  }
}