Implicit Relationships

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jwaxman's picture

I'm just getting starting creating field, filter, etc handlers for Views for a project.
I've hit the point where I can't get further from existing examples and the API documentation.

I'm working with table, let's call it "Stuff"
Among the stored fields is a user ID.
I'd like to make it easy for someone creating a view of the table to show the username associated with that user ID.

I have absolutely no trouble creating a relationship handler that lets a user create a view that gives them access to all the fields in the user table. I suppose I could force the user to do that.

What I'd like instead is for the person creating a view from the "Stuff" table to see "Stuff: Username" as a choice for a field.

I suppose if I needed to I could write a field handler that loaded the user from the user ID and rendered a username. I'm not sure why, but this seems duplicative and not particularly good behavior for performance.

Is there a way, in the Views API framework, to accomplish what I want by describing the way the Stuff and Users tables are related and using the existing Views handlers for the username rendering?

In other words I'd like the relationship between "Stuff" and "users" to be implicit in my stuff_views module rather than explicit as a relationship in the Views interface.

I hoped I picked a good title.

Thanks

Comments

If I understand your

tizzo's picture

If I understand your question correctly you absolutely can. What you have to do tell views to join the user table to your table on the appropriate field.

Assuming your my_stuff table has a uid field you would do something like this in your implementation of hook_views_data():

<?php
  $data
['users']['table']['join'] = array(
   
'my_stuff' => array(
     
'left_field' => 'uid',
     
'field' => 'uid',
     
'type' => 'INNER',
    ), 
  ); 
?>

This essentially pulls anything from the user group into your view so that your users can see them in the fields, filters, arguments etc. You should still define a relationship because they are a bit more flexible but I think this gives you what you want.

If you want to look at some examples of this check out the implementations in views/modules/user.views.inc and views/modules/node.views.inc.

Many many thanks. It works

jwaxman's picture

Many many thanks.
It works of course.

I was using

$data['my_stuff']['table']['join'] = array(
    'users' => array(
      'table' => 'my_stuff',
      'left_field' => 'uid',
      'field' => 'uid',
      'left_table' => 'users',
    ),
);

and not getting anywhere.
Now I just need to figure out why.

Also, why is the code you've given me less flexible than using a relationship in the UI?
What flexibility/elegance/performance do I lose this way?
I'm not challenging your statement. I really want to learn.

What you were doing with the

tizzo's picture

What you were doing with the code above would expose your field to listings of users rather than expose users on listings of your stuff.

I say that it's more flexible because you might not be pulling in everything else that gets added to the user (or more likely node) by using this approach. If you do the same thing with node you won't get the content fields with this sort of a join but you will with a relationship. In general I think you want to make both available to the user unless it doesn't make sense to do so for some other reason. You'll notice both user and node implementations in views core work both ways.

Something similar?

TomSherlock's picture

I think I may want to do something similar to jwaxman. But I'm not sure which api to use nor if 'join' plays into this and if it does not sure how.

I want to be able to display a list of volunteers (users). The username is the the volunteers realname. Obviously If I sort the usernames will be ordered by their first name. I want to sort by last name.

Also I want to be able to group volunteers by the station to which they are assigned.

Multiple tables are involved here.

I have profile content type with a field for the last name.

My first guess is to write a bunch of SQL select statements and loops to match on the uid and bring everything together. But then I'm no longer user Views.

Any suggestions?

Thanks

The only question I have is

tizzo's picture

The only question I have is where the station assignments are stored. I'm not sure I see why this isn't something you can do through the views ui...

Create a view of users, add the last name profile field as a sort. If the assignments are in profile data you can add that as a field and group by it. If it's stored in some custom table you might need to expose that to views using some code like what I posted above. If they're connected by a user reference from a node then you can probably do that part through the ui as well (depending on how you set it up).

Station assignment is stored

TomSherlock's picture

Station assignment is stored in a station assignment node.

So we have

User
-username
-userid

Profile
-FirstName
-LastName

StationAssignment
-UserReference -> userid
-Station (node id)
-Station (node id)
-Station (node id)

Station
-Name
-UserReference -> userid
-UserReference -> userid
-UserReference -> userid
-UserReference -> userid

I think my initial mistake was to use UserReference to User instead of NodeReference to Profile.

I already have a view which successfully presents users in alphabetically by lastname. Nevertheless I am unable to present users from the station node in alphabetical order by lastname.

Here is one failed view:

<?php
$view
= new view;
$view->name = 'valentine_social_volunteers_2';
$view->description = 'Valentine Social Volunteers';
$view->tag = 'stations';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
 
'content_profile_rel' => array(
   
'label' => 'Content Profile',
   
'required' => 0,
   
'type' => 'profile',
   
'id' => 'content_profile_rel',
   
'table' => 'users',
   
'field' => 'content_profile_rel',
   
'override' => array(
     
'button' => 'Override',
    ),
   
'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
 
'uid' => array(
   
'label' => 'Uid',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => '',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'link_to_user' => 1,
   
'exclude' => 1,
   
'id' => 'uid',
   
'table' => 'users',
   
'field' => 'uid',
   
'override' => array(
     
'button' => 'Override',
    ),
   
'relationship' => 'none',
  ),
 
'field_hb_assignee_uid' => array(
   
'label' => 'Assign a volunteer',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => '',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'target' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'empty' => '',
   
'hide_empty' => 0,
   
'empty_zero' => 0,
   
'link_to_node' => 0,
   
'label_type' => 'widget',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => TRUE,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => FALSE,
    ),
   
'exclude' => 0,
   
'id' => 'field_hb_assignee_uid',
   
'table' => 'node_data_field_hb_assignee',
   
'field' => 'field_hb_assignee_uid',
   
'relationship' => 'none',
  ),
 
'field_p_firstname_value' => array(
   
'label' => '',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => 'user/[uid]',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'link_to_node' => 0,
   
'label_type' => 'none',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => TRUE,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => FALSE,
    ),
   
'exclude' => 1,
   
'id' => 'field_p_firstname_value',
   
'table' => 'node_data_field_p_firstname',
   
'field' => 'field_p_firstname_value',
   
'relationship' => 'none',
   
'override' => array(
     
'button' => 'Override',
    ),
  ),
 
'field_p_lastname_value' => array(
   
'label' => 'Parent',
   
'alter' => array(
     
'alter_text' => 1,
     
'text' => '[field_p_firstname_value] [field_p_lastname_value]',
     
'make_link' => 0,
     
'path' => 'user/[uid]',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'link_to_node' => 1,
   
'label_type' => 'custom',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => TRUE,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => FALSE,
    ),
   
'exclude' => 0,
   
'id' => 'field_p_lastname_value',
   
'table' => 'node_data_field_p_lastname',
   
'field' => 'field_p_lastname_value',
   
'relationship' => 'none',
   
'override' => array(
     
'button' => 'Override',
    ),
  ),
 
'field_station_volunteers_uid' => array(
   
'label' => 'Volunteers',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => '',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'target' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'empty' => '',
   
'hide_empty' => 0,
   
'empty_zero' => 0,
   
'link_to_node' => 0,
   
'label_type' => 'widget',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => 1,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => 0,
    ),
   
'exclude' => 0,
   
'id' => 'field_station_volunteers_uid',
   
'table' => 'node_data_field_station_volunteers',
   
'field' => 'field_station_volunteers_uid',
   
'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
 
'field_p_lastname_value_1' => array(
   
'order' => 'ASC',
   
'delta' => -1,
   
'id' => 'field_p_lastname_value_1',
   
'table' => 'node_data_field_p_lastname',
   
'field' => 'field_p_lastname_value',
   
'override' => array(
     
'button' => 'Override',
    ),
   
'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
 
'type' => array(
   
'operator' => 'in',
   
'value' => array(
     
'profile' => 'profile',
     
'station_reg' => 'station_reg',
    ),
   
'group' => '0',
   
'exposed' => FALSE,
   
'expose' => array(
     
'operator' => FALSE,
     
'label' => '',
    ),
   
'id' => 'type',
   
'table' => 'node',
   
'field' => 'type',
   
'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
 
'type' => 'role',
 
'role' => array(
   
'22' => 22,
  ),
));
$handler->override_option('cache', array(
 
'type' => 'none',
));
$handler->override_option('title', 'Class Parents Directory');
$handler->override_option('footer_format', '3');
$handler->override_option('footer_empty', 0);
$handler->override_option('items_per_page', 0);
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
 
'grouping' => 'field_p_cp_teach_grade_nid',
 
'override' => 1,
 
'sticky' => 0,
 
'order' => 'asc',
 
'columns' => array(
   
'field_p_firstname_value' => 'field_p_firstname_value',
   
'field_p_lastname_value' => 'field_p_lastname_value',
   
'field_p_email_email' => 'field_p_email_email',
   
'field_p_phone_value' => 'field_p_phone_value',
   
'field_p_classparent_teacher_nid' => 'field_p_classparent_teacher_nid',
   
'field_p_cp_teach_grade_nid' => 'field_p_cp_teach_grade_nid',
  ),
 
'info' => array(
   
'field_p_firstname_value' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_lastname_value' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_email_email' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_phone_value' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_classparent_teacher_nid' => array(
     
'separator' => '',
    ),
   
'field_p_cp_teach_grade_nid' => array(
     
'separator' => '',
    ),
  ),
 
'default' => '-1',
));
$handler = $view->new_display('page', 'Volunteer List', 'page_1');
$handler->override_option('fields', array(
 
'uid' => array(
   
'label' => 'Uid',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => '',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'target' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'empty' => '',
   
'hide_empty' => 0,
   
'empty_zero' => 0,
   
'link_to_user' => 1,
   
'exclude' => 0,
   
'id' => 'uid',
   
'table' => 'users',
   
'field' => 'uid',
   
'override' => array(
     
'button' => 'Use default',
    ),
   
'relationship' => 'none',
  ),
 
'name' => array(
   
'label' => 'Name',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => '',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'target' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'empty' => '',
   
'hide_empty' => 0,
   
'empty_zero' => 0,
   
'link_to_user' => 1,
   
'overwrite_anonymous' => 0,
   
'anonymous_text' => '',
   
'exclude' => 0,
   
'id' => 'name',
   
'table' => 'users',
   
'field' => 'name',
   
'override' => array(
     
'button' => 'Use default',
    ),
   
'relationship' => 'none',
  ),
 
'field_p_firstname_value' => array(
   
'label' => '',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => 'user/[uid]',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'link_to_node' => 0,
   
'label_type' => 'none',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => TRUE,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => FALSE,
    ),
   
'exclude' => 1,
   
'id' => 'field_p_firstname_value',
   
'table' => 'node_data_field_p_firstname',
   
'field' => 'field_p_firstname_value',
   
'relationship' => 'none',
   
'override' => array(
     
'button' => 'Override',
    ),
  ),
 
'field_p_lastname_value' => array(
   
'label' => 'Parent',
   
'alter' => array(
     
'alter_text' => 1,
     
'text' => '[field_p_firstname_value] [field_p_lastname_value]',
     
'make_link' => 0,
     
'path' => 'user/[uid]',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'link_to_node' => 1,
   
'label_type' => 'custom',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => TRUE,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => FALSE,
    ),
   
'exclude' => 0,
   
'id' => 'field_p_lastname_value',
   
'table' => 'node_data_field_p_lastname',
   
'field' => 'field_p_lastname_value',
   
'relationship' => 'none',
   
'override' => array(
     
'button' => 'Override',
    ),
  ),
 
'field_station_volunteers_uid' => array(
   
'label' => 'Volunteers',
   
'alter' => array(
     
'alter_text' => 0,
     
'text' => '',
     
'make_link' => 0,
     
'path' => '',
     
'link_class' => '',
     
'alt' => '',
     
'prefix' => '',
     
'suffix' => '',
     
'target' => '',
     
'help' => '',
     
'trim' => 0,
     
'max_length' => '',
     
'word_boundary' => 1,
     
'ellipsis' => 1,
     
'strip_tags' => 0,
     
'html' => 0,
    ),
   
'empty' => '',
   
'hide_empty' => 0,
   
'empty_zero' => 0,
   
'link_to_node' => 0,
   
'label_type' => 'widget',
   
'format' => 'default',
   
'multiple' => array(
     
'group' => 0,
     
'multiple_number' => '',
     
'multiple_from' => '',
     
'multiple_reversed' => 0,
    ),
   
'exclude' => 0,
   
'id' => 'field_station_volunteers_uid',
   
'table' => 'node_data_field_station_volunteers',
   
'field' => 'field_station_volunteers_uid',
   
'override' => array(
     
'button' => 'Use default',
    ),
   
'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
 
'status' => array(
   
'operator' => '=',
   
'value' => '1',
   
'group' => '0',
   
'exposed' => FALSE,
   
'expose' => array(
     
'operator' => FALSE,
     
'label' => '',
    ),
   
'id' => 'status',
   
'table' => 'node',
   
'field' => 'status',
   
'override' => array(
     
'button' => 'Use default',
    ),
   
'relationship' => 'none',
  ),
 
'type' => array(
   
'operator' => 'in',
   
'value' => array(
     
'profile' => 'profile',
     
'station' => 'station',
     
'station_reg' => 'station_reg',
    ),
   
'group' => '0',
   
'exposed' => FALSE,
   
'expose' => array(
     
'operator' => FALSE,
     
'label' => '',
    ),
   
'id' => 'type',
   
'table' => 'node',
   
'field' => 'type',
   
'override' => array(
     
'button' => 'Use default',
    ),
   
'relationship' => 'none',
  ),
));
$handler->override_option('title', 'Volunteer List');
$handler->override_option('use_pager', '1');
$handler->override_option('style_options', array(
 
'grouping' => '',
 
'override' => 1,
 
'sticky' => 1,
 
'order' => 'asc',
 
'columns' => array(
   
'uid' => 'uid',
   
'field_p_firstname_value' => 'field_p_firstname_value',
   
'field_p_lastname_value' => 'field_p_lastname_value',
   
'mail' => 'mail',
   
'field_p_phone_value' => 'field_p_phone_value',
  ),
 
'info' => array(
   
'uid' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_firstname_value' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_lastname_value' => array(
     
'sortable' => 1,
     
'separator' => '',
    ),
   
'mail' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
   
'field_p_phone_value' => array(
     
'sortable' => 0,
     
'separator' => '',
    ),
  ),
 
'default' => 'field_p_lastname_value',
));
$handler->override_option('path', 'social/valentine/volunteers/alpha');
$handler->override_option('menu', array(
 
'type' => 'none',
 
'title' => 'Parents',
 
'description' => 'Directory of Lincoln School Parents',
 
'weight' => '0',
 
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
 
'type' => 'normal',
 
'title' => 'Parents Directories',
 
'description' => 'Directories of Lincoln School Parents',
 
'weight' => '0',
));
?>

Here are the content types:
Profile

<?php
$content
['type']  = array (
 
'name' => 'Profile',
 
'type' => 'profile',
 
'description' => 'A user profile built as content.',
 
'title_label' => 'Profile Name',
 
'body_label' => '',
 
'min_word_count' => '0',
 
'help' => '',
 
'node_options' =>
  array (
   
'status' => true,
   
'promote' => false,
   
'sticky' => false,
   
'revision' => false,
  ),
 
'old_type' => 'profile',
 
'orig_type' => 'profile',
 
'module' => 'node',
 
'custom' => '1',
 
'modified' => '1',
 
'locked' => '0',
 
'og_content_type_usage' => 'omitted',
 
'nodewords_edit_metatags' => true,
 
'nodewords_metatags_generation_method' => '0',
 
'nodewords_metatags_generation_source' => '2',
 
'nodewords_use_alt_attribute' => 1,
 
'nodewords_filter_modules_output' =>
  array (
   
0 => 1,
   
'imagebrowser' => false,
   
'img_assist' => false,
  ),
 
'nodewords_filter_regexp' => '',
 
'content_profile_use' => 1,
 
'comment' => '0',
 
'comment_default_mode' => '4',
 
'comment_default_order' => '1',
 
'comment_default_per_page' => '50',
 
'comment_controls' => '3',
 
'comment_anonymous' => 0,
 
'comment_subject_field' => '0',
 
'comment_preview' => '0',
 
'comment_form_location' => '0',
 
'notifications_node_ui' =>
  array (
   
'form' => false,
   
'comment' => false,
   
'links' => false,
   
'teaserlinks' => false,
   
'subform' => false,
   
'block' => false,
  ),
 
'notifications_content_type' =>
  array (
   
'taxonomy' => true,
   
'grouptype' => true,
   
'thread' => true,
   
'nodetype' => true,
   
'author' => false,
   
'typeauthor' => false,
  ),
 
'print_display' => 1,
 
'print_display_comment' => 0,
 
'print_display_urllist' => 1,
 
'print_mail_display' => 1,
 
'print_mail_display_comment' => 0,
 
'print_mail_display_urllist' => 1,
 
'print_pdf_display' => 1,
 
'print_pdf_display_comment' => 0,
 
'print_pdf_display_urllist' => 1,
 
'ant' => '1',
 
'ant_pattern' => '[field_p_firstname-raw] [field_p_lastname-raw]',
 
'ant_php' => 0,
);
$content['fields']  = array (
 
0 =>
  array (
   
'label' => 'First Name',
   
'field_name' => 'field_p_firstname',
   
'type' => 'text',
   
'widget_type' => 'text_textfield',
   
'change' => 'Change basic information',
   
'weight' => '62',
   
'rows' => 5,
   
'size' => '60',
   
'description' => 'Enter your first name or given name.',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'value' => '',
       
'_error_element' => 'default_value_widget][field_p_firstname][0][value',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' => NULL,
   
'group' => 'group_p_general',
   
'required' => 1,
   
'multiple' => '0',
   
'text_processing' => '0',
   
'max_length' => '',
   
'allowed_values' => '',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'text',
   
'widget_module' => 'text',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => false,
       
'sortable' => true,
       
'views' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '62',
     
'parent' => 'group_p_general',
     
'label' =>
      array (
       
'format' => 'inline',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
2 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
3 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
1 =>
  array (
   
'label' => 'Last Name',
   
'field_name' => 'field_p_lastname',
   
'type' => 'text',
   
'widget_type' => 'text_textfield',
   
'change' => 'Change basic information',
   
'weight' => '64',
   
'rows' => 5,
   
'size' => '60',
   
'description' => 'Enter your last name or family name.',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'value' => '',
       
'_error_element' => 'default_value_widget][field_p_lastname][0][value',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_p_lastname' =>
      array (
       
0 =>
        array (
         
'value' => '',
         
'_error_element' => 'default_value_widget][field_p_lastname][0][value',
        ),
      ),
    ),
   
'group' => 'group_p_general',
   
'required' => 1,
   
'multiple' => '0',
   
'text_processing' => '0',
   
'max_length' => '',
   
'allowed_values' => '',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'text',
   
'widget_module' => 'text',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => false,
       
'sortable' => true,
       
'views' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '64',
     
'parent' => 'group_p_general',
     
'label' =>
      array (
       
'format' => 'inline',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
2 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
3 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
);
$content['extra']  = array (
 
'title' => '71',
 
'revision_information' => '85',
 
'comment_settings' => '87',
 
'menu' => '84',
 
'taxonomy' => '89',
 
'book' => '10',
 
'path' => '86',
 
'print' => '30',
 
'url' => '100',
 
'click_count' => '100',
 
'last_click' => '100',
 
'last_status' => '100',
 
'last_status_info' => '100',
 
'last_checked' => '100',
 
'urlhash' => '100',
 
'reciprocal' => '100',
);
?>

Station:

<?php
$content
['type']  = array (
 
'name' => 'Station',
 
'type' => 'station',
 
'description' => 'An activity at a PTA event.',
 
'title_label' => 'Name',
 
'body_label' => '',
 
'min_word_count' => '0',
 
'help' => 'Provide a name and description of the event.',
 
'node_options' =>
  array (
   
'status' => true,
   
'promote' => false,
   
'sticky' => false,
   
'revision' => false,
  ),
 
'old_type' => 'station',
 
'orig_type' => '',
 
'module' => 'node',
 
'custom' => '1',
 
'modified' => '1',
 
'locked' => '0',
 
'og_content_type_usage' => 'omitted',
 
'nodewords_edit_metatags' => true,
 
'nodewords_metatags_generation_method' => '0',
 
'nodewords_metatags_generation_source' => '2',
 
'nodewords_use_alt_attribute' => 1,
 
'nodewords_filter_modules_output' =>
  array (
   
0 => 1,
   
'imagebrowser' => false,
   
'img_assist' => false,
  ),
 
'nodewords_filter_regexp' => '',
 
'content_profile_use' => 0,
 
'comment' => '0',
 
'comment_default_mode' => '4',
 
'comment_default_order' => '1',
 
'comment_default_per_page' => '50',
 
'comment_controls' => '3',
 
'comment_anonymous' => 0,
 
'comment_subject_field' => '1',
 
'comment_preview' => '1',
 
'comment_form_location' => '0',
 
'notifications_node_ui' =>
  array (
   
'form' => false,
   
'comment' => false,
   
'links' => false,
   
'teaserlinks' => false,
   
'subform' => false,
   
'block' => false,
  ),
 
'notifications_content_type' =>
  array (
   
'taxonomy' => true,
   
'grouptype' => true,
   
'thread' => true,
   
'nodetype' => true,
   
'author' => false,
   
'typeauthor' => false,
  ),
 
'print_display' => 1,
 
'print_display_comment' => 0,
 
'print_display_urllist' => 0,
 
'print_mail_display' => 1,
 
'print_mail_display_comment' => 0,
 
'print_mail_display_urllist' => 0,
 
'print_pdf_display' => 1,
 
'print_pdf_display_comment' => 0,
 
'print_pdf_display_urllist' => 0,
 
'ant' => '1',
 
'ant_pattern' => '[field_station_name-raw]',
 
'ant_php' => 0,
);
$content['fields']  = array (
 
0 =>
  array (
   
'label' => 'Name',
   
'field_name' => 'field_station_name',
   
'type' => 'text',
   
'widget_type' => 'text_textfield',
   
'change' => 'Change basic information',
   
'weight' => '11',
   
'rows' => 5,
   
'size' => '60',
   
'description' => 'Enter the name of the station.',
   
'default_value' =>
    array (
    ),
   
'default_value_php' => '',
   
'default_value_widget' => NULL,
   
'group' => false,
   
'required' => 1,
   
'multiple' => '0',
   
'text_processing' => '0',
   
'max_length' => '',
   
'allowed_values' => '',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'text',
   
'widget_module' => 'text',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => false,
       
'sortable' => true,
       
'views' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '11',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'hidden',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
5 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
1 =>
  array (
   
'label' => 'Description',
   
'field_name' => 'field_station_description',
   
'type' => 'text',
   
'widget_type' => 'text_textarea',
   
'change' => 'Change basic information',
   
'weight' => '12',
   
'rows' => '5',
   
'size' => 60,
   
'description' => 'Enter a description of the station.',
   
'default_value' =>
    array (
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_station_description' =>
      array (
       
0 =>
        array (
         
'value' => '',
         
'_error_element' => 'default_value_widget][field_station_description][0][value',
        ),
      ),
    ),
   
'group' => false,
   
'required' => 0,
   
'multiple' => '0',
   
'text_processing' => '0',
   
'max_length' => '',
   
'allowed_values' => '',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'text',
   
'widget_module' => 'text',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => false,
       
'sortable' => true,
       
'views' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '12',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'hidden',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
5 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
2 =>
  array (
   
'label' => 'Number of Spots',
   
'field_name' => 'field_station_spots',
   
'type' => 'number_integer',
   
'widget_type' => 'number',
   
'change' => 'Change basic information',
   
'weight' => '13',
   
'description' => '',
   
'default_value' =>
    array (
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_station_spots' =>
      array (
       
0 =>
        array (
         
'value' => '',
         
'_error_element' => 'default_value_widget][field_station_spots][0][value',
        ),
      ),
    ),
   
'group' => false,
   
'required' => 1,
   
'multiple' => '0',
   
'min' => '',
   
'max' => '',
   
'prefix' => '',
   
'suffix' => '',
   
'allowed_values' => '',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'number',
   
'widget_module' => 'number',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'int',
       
'not null' => false,
       
'sortable' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '13',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'inline',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
5 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
2 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
3 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
3 =>
  array (
   
'label' => 'Volunteers',
   
'field_name' => 'field_station_volunteers',
   
'type' => 'userreference',
   
'widget_type' => 'userreference_autocomplete',
   
'change' => 'Change basic information',
   
'weight' => '14',
   
'autocomplete_match' => 'contains',
   
'size' => '60',
   
'reverse_link' => 1,
   
'description' => '',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'uid' => NULL,
       
'_error_element' => 'default_value_widget][field_station_volunteers][0][uid][uid',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_station_volunteers' =>
      array (
       
0 =>
        array (
         
'uid' =>
          array (
           
'uid' => '',
           
'_error_element' => 'default_value_widget][field_station_volunteers][0][uid][uid',
          ),
         
'_error_element' => 'default_value_widget][field_station_volunteers][0][uid][uid',
        ),
      ),
    ),
   
'group' => false,
   
'required' => 0,
   
'multiple' => '1',
   
'referenceable_roles' =>
    array (
     
2 => 2,
     
24 => 24,
     
19 => 0,
     
23 => 0,
     
21 => 0,
     
16 => 0,
     
4 => 0,
     
8 => 0,
     
17 => 0,
     
9 => 0,
     
15 => 0,
     
3 => 0,
     
22 => 0,
     
14 => 0,
     
11 => 0,
     
10 => 0,
     
20 => 0,
     
5 => 0,
    ),
   
'referenceable_status' => '1',
   
'advanced_view' => '--',
   
'advanced_view_args' => '',
   
'op' => 'Save field settings',
   
'module' => 'userreference',
   
'widget_module' => 'userreference',
   
'columns' =>
    array (
     
'uid' =>
      array (
       
'type' => 'int',
       
'unsigned' => true,
       
'not null' => false,
       
'index' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '14',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'hidden',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
4 =>
  array (
   
'label' => 'Event',
   
'field_name' => 'field_station_event',
   
'type' => 'content_taxonomy',
   
'widget_type' => 'content_taxonomy_autocomplete',
   
'change' => 'Change basic information',
   
'weight' => '15',
   
'new_terms' => 'insert',
   
'extra_parent' => '0',
   
'maxlength' => '255',
   
'description' => 'Enter the related event, e.g. Halloween Social, Field Day, etc.',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'value' => '412',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_station_event' =>
      array (
       
'value' => 'Valentine Social',
      ),
    ),
   
'group' => false,
   
'required' => 1,
   
'multiple' => '0',
   
'save_term_node' => 1,
   
'vid' => '9',
   
'parent' => '0',
   
'parent_php_code' => '',
   
'depth' => '',
   
'op' => 'Save field settings',
   
'module' => 'content_taxonomy',
   
'widget_module' => 'content_taxonomy_autocomplete',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'int',
       
'not null' => false,
       
'sortable' => false,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '15',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'inline',
      ),
     
'teaser' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
5 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
5 =>
  array (
   
'label' => 'Weight',
   
'field_name' => 'field_station_weight',
   
'type' => 'number_integer',
   
'widget_type' => 'number',
   
'change' => 'Change basic information',
   
'weight' => '16',
   
'description' => 'Enter a number to order the stations.  A lower number is lighter, a higher number is heavier.',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'value' => '',
       
'_error_element' => 'default_value_widget][field_station_weight][0][value',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_station_weight' =>
      array (
       
0 =>
        array (
         
'value' => '',
         
'_error_element' => 'default_value_widget][field_station_weight][0][value',
        ),
      ),
    ),
   
'group' => false,
   
'required' => 0,
   
'multiple' => '0',
   
'min' => '-50',
   
'max' => '50',
   
'prefix' => '',
   
'suffix' => '',
   
'allowed_values' => '',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'number',
   
'widget_module' => 'number',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'int',
       
'not null' => false,
       
'sortable' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '16',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'above',
      ),
     
'teaser' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
5 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
);
$content['extra']  = array (
 
'title' => '18',
 
'revision_information' => '23',
 
'comment_settings' => '24',
 
'menu' => '21',
 
'taxonomy' => '17',
 
'book' => '20',
 
'path' => '22',
 
'print' => '19',
 
'url' => '30',
 
'click_count' => '31',
 
'last_click' => '32',
 
'last_status' => '29',
 
'last_status_info' => '28',
 
'last_checked' => '25',
 
'urlhash' => '26',
 
'reciprocal' => '27',
);
?>

Station Assignment:

<?php
$content
['type']  = array (
 
'name' => 'Station Registration Form',
 
'type' => 'station_reg',
 
'description' => 'Register volunteer for an event\'s station.',
 
'title_label' => 'Title',
 
'body_label' => '',
 
'min_word_count' => '0',
 
'help' => '',
 
'node_options' =>
  array (
   
'status' => true,
   
'promote' => false,
   
'sticky' => false,
   
'revision' => false,
  ),
 
'old_type' => 'station_reg',
 
'orig_type' => '',
 
'module' => 'node',
 
'custom' => '1',
 
'modified' => '1',
 
'locked' => '0',
 
'og_content_type_usage' => 'omitted',
 
'nodewords_edit_metatags' => true,
 
'nodewords_metatags_generation_method' => '0',
 
'nodewords_metatags_generation_source' => '2',
 
'nodewords_use_alt_attribute' => 1,
 
'nodewords_filter_modules_output' =>
  array (
   
0 => 1,
   
'imagebrowser' => false,
   
'img_assist' => false,
  ),
 
'nodewords_filter_regexp' => '',
 
'content_profile_use' => 0,
 
'comment' => '0',
 
'comment_default_mode' => '4',
 
'comment_default_order' => '1',
 
'comment_default_per_page' => '50',
 
'comment_controls' => '3',
 
'comment_anonymous' => 0,
 
'comment_subject_field' => '1',
 
'comment_preview' => '1',
 
'comment_form_location' => '0',
 
'notifications_node_ui' =>
  array (
   
'form' => false,
   
'comment' => false,
   
'links' => false,
   
'teaserlinks' => false,
   
'subform' => false,
   
'block' => false,
  ),
 
'notifications_content_type' =>
  array (
   
'taxonomy' => true,
   
'grouptype' => true,
   
'thread' => true,
   
'nodetype' => true,
   
'author' => false,
   
'typeauthor' => false,
  ),
 
'print_display' => 1,
 
'print_display_comment' => 0,
 
'print_display_urllist' => 1,
 
'print_mail_display' => 1,
 
'print_mail_display_comment' => 0,
 
'print_mail_display_urllist' => 1,
 
'print_pdf_display' => 1,
 
'print_pdf_display_comment' => 0,
 
'print_pdf_display_urllist' => 1,
 
'ant' => '1',
 
'ant_pattern' => '[field_hb_assignee-name]',
 
'ant_php' => 0,
);
$content['fields']  = array (
 
0 =>
  array (
   
'label' => 'Registrant',
   
'field_name' => 'field_hb_registrant_name',
   
'type' => 'markup',
   
'widget_type' => 'markup',
   
'change' => 'Change basic information',
   
'weight' => '-1',
   
'default_value' =>
    array (
    ),
   
'default_value_php' => '',
   
'group' => false,
   
'conditional_fields' =>
    array (
     
'field_hb_stations' => 'conditional_field_no_value',
     
'field_hb_stations_display' => 'conditional_field_no_value',
    ),
   
'markup' => '<div class="form-item"><h1>',
   
'op' => 'Save field settings',
   
'module' => 'markup',
   
'widget_module' => 'markup',
   
'columns' =>
    array (
    ),
   
'default_value_widget' => NULL,
   
'display_settings' =>
    array (
     
'weight' => '-1',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'inline',
      ),
     
'teaser' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
1 =>
  array (
   
'label' => 'Registrant 2',
   
'field_name' => 'field_hb_regsitrant_2',
   
'type' => 'userreference',
   
'widget_type' => 'userreference_autocomplete',
   
'change' => 'Change basic information',
   
'weight' => 0,
   
'autocomplete_match' => 'contains',
   
'size' => '60',
   
'reverse_link' => 0,
   
'description' => '',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'uid' => NULL,
       
'_error_element' => 'default_value_widget][field_hb_regsitrant_2][0][uid][uid',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_hb_regsitrant_2' =>
      array (
       
0 =>
        array (
         
'uid' => NULL,
         
'_error_element' => 'default_value_widget][field_hb_regsitrant_2][0][uid][uid',
        ),
      ),
    ),
   
'group' => false,
   
'conditional_fields' =>
    array (
     
'field_hb_stations' => 'conditional_field_no_value',
     
'field_hb_stations_display' => 'conditional_field_no_value',
    ),
   
'required' => 0,
   
'multiple' => '0',
   
'referenceable_roles' =>
    array (
     
2 => 2,
     
4 => 0,
     
6 => 0,
     
3 => 0,
     
5 => 0,
     
19 => false,
     
23 => false,
     
21 => false,
     
16 => false,
     
24 => false,
     
8 => false,
     
17 => false,
     
9 => false,
     
15 => false,
     
22 => false,
     
14 => false,
     
11 => false,
     
10 => false,
     
20 => false,
    ),
   
'referenceable_status' => '1',
   
'advanced_view' => '',
   
'advanced_view_args' => '',
   
'op' => 'Save field settings',
   
'module' => 'userreference',
   
'widget_module' => 'userreference',
   
'columns' =>
    array (
     
'uid' =>
      array (
       
'type' => 'int',
       
'unsigned' => true,
       
'not null' => false,
       
'index' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => 0,
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'hidden',
      ),
     
'teaser' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
2 =>
  array (
   
'label' => 'Assign a volunteer',
   
'field_name' => 'field_hb_assignee',
   
'type' => 'userreference',
   
'widget_type' => 'userreference_autocomplete',
   
'change' => 'Change basic information',
   
'weight' => '1',
   
'autocomplete_match' => 'contains',
   
'size' => '60',
   
'reverse_link' => 1,
   
'description' => 'Assign a PTA member to one or more of the stations below.',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'uid' => NULL,
       
'_error_element' => 'default_value_widget][field_hb_assignee][0][uid][uid',
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_hb_assignee' =>
      array (
       
0 =>
        array (
         
'uid' =>
          array (
           
'uid' => '',
           
'_error_element' => 'default_value_widget][field_hb_assignee][0][uid][uid',
          ),
         
'_error_element' => 'default_value_widget][field_hb_assignee][0][uid][uid',
        ),
      ),
    ),
   
'group' => false,
   
'conditional_fields' =>
    array (
     
'field_hb_stations' => 'conditional_field_no_value',
     
'field_hb_stations_display' => 'conditional_field_no_value',
    ),
   
'required' => 0,
   
'multiple' => '0',
   
'referenceable_roles' =>
    array (
     
9 => 9,
     
10 => 10,
     
2 => 0,
     
19 => 0,
     
23 => 0,
     
21 => 0,
     
16 => 0,
     
4 => 0,
     
24 => 0,
     
8 => 0,
     
17 => 0,
     
15 => 0,
     
3 => 0,
     
22 => 0,
     
14 => 0,
     
11 => 0,
     
20 => 0,
     
5 => 0,
    ),
   
'referenceable_status' => '1',
   
'advanced_view' => '--',
   
'advanced_view_args' => '',
   
'op' => 'Save field settings',
   
'module' => 'userreference',
   
'widget_module' => 'userreference',
   
'columns' =>
    array (
     
'uid' =>
      array (
       
'type' => 'int',
       
'unsigned' => true,
       
'not null' => false,
       
'index' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '1',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'hidden',
      ),
     
'teaser' =>
      array (
       
'format' => 'hidden',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
3 =>
  array (
   
'label' => 'Stations',
   
'field_name' => 'field_hb_stations',
   
'type' => 'text',
   
'widget_type' => 'optionwidgets_buttons',
   
'change' => 'Change basic information',
   
'weight' => '2',
   
'description' => '',
   
'default_value' =>
    array (
     
0 =>
      array (
       
'value' => NULL,
      ),
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_hb_stations' =>
      array (
       
'value' =>
        array (
         
'' => 1,
         
947 => false,
         
944 => false,
         
946 => false,
         
950 => false,
         
951 => false,
         
940 => false,
         
949 => false,
         
929 => false,
         
948 => false,
         
941 => false,
         
925 => false,
         
942 => false,
         
939 => false,
         
923 => false,
         
943 => false,
         
945 => false,
         
924 => false,
         
938 => false,
         
922 => false,
         
952 => false,
        ),
      ),
    ),
   
'group' => false,
   
'conditional_fields' =>
    array (
     
'field_hb_stations_display' => 'conditional_field_no_value',
    ),
   
'required' => 1,
   
'multiple' => '1',
   
'text_processing' => '0',
   
'max_length' => '',
   
'allowed_values' => '   ',
   
'allowed_values_php' => 'return getStations();',
   
'op' => 'Save field settings',
   
'module' => 'text',
   
'widget_module' => 'optionwidgets',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => false,
       
'sortable' => true,
       
'views' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'weight' => '2',
     
'parent' => '',
     
'label' =>
      array (
       
'format' => 'above',
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
 
4 =>
  array (
   
'label' => 'Stations (display)',
   
'field_name' => 'field_hb_stations_display',
   
'type' => 'text',
   
'widget_type' => 'optionwidgets_select',
   
'change' => 'Change basic information',
   
'weight' => '3',
   
'description' => '',
   
'default_value' =>
    array (
    ),
   
'default_value_php' => '',
   
'default_value_widget' =>
    array (
     
'field_hb_stations_display' =>
      array (
      ),
    ),
   
'group' => false,
   
'conditional_fields' =>
    array (
     
'field_hb_stations' => 'conditional_field_no_value',
    ),
   
'required' => 0,
   
'multiple' => '0',
   
'text_processing' => '0',
   
'max_length' => '',
   
'allowed_values' => '0|no-value',
   
'allowed_values_php' => '',
   
'op' => 'Save field settings',
   
'module' => 'text',
   
'widget_module' => 'optionwidgets',
   
'columns' =>
    array (
     
'value' =>
      array (
       
'type' => 'text',
       
'size' => 'big',
       
'not null' => false,
       
'sortable' => true,
       
'views' => true,
      ),
    ),
   
'display_settings' =>
    array (
     
'label' =>
      array (
       
'format' => 'above',
       
'exclude' => 0,
      ),
     
5 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'teaser' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'full' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
4 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
2 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
3 =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
     
'token' =>
      array (
       
'format' => 'default',
       
'exclude' => 0,
      ),
    ),
  ),
);
$content['extra']  = array (
 
'title' => '4',
 
'revision_information' => '6',
 
'comment_settings' => '7',
 
'menu' => '5',
 
'book' => '9',
 
'path' => '8',
 
'print' => '10',
 
'url' => '18',
 
'click_count' => '17',
 
'last_click' => '16',
 
'last_status' => '14',
 
'last_status_info' => '11',
 
'last_checked' => '12',
 
'urlhash' => '13',
 
'reciprocal' => '15',
);
?>

I've also written some code to manipulate some of the selections.