Skip to content

Commit

Permalink
#103: Team choice on user entity
Browse files Browse the repository at this point in the history
  • Loading branch information
katypool committed Feb 17, 2015
1 parent 8cabd9e commit 30f6e54
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* @file
* playbox_users.features.field_base.inc
*/

/**
* Implements hook_field_default_field_bases().
*/
function playbox_users_field_default_field_bases() {
$field_bases = array();

// Exported field_base: 'field_playbox_user_team'
$field_bases['field_playbox_user_team'] = array(
'active' => 1,
'cardinality' => 1,
'deleted' => 0,
'entity_types' => array(),
'field_name' => 'field_playbox_user_team',
'foreign keys' => array(),
'indexes' => array(
'value' => array(
0 => 'value',
),
),
'locked' => 0,
'module' => 'list',
'settings' => array(
'allowed_values' => array(
'presidents' => 'Presidents',
'robots' => 'Robots',
),
'allowed_values_function' => '',
),
'translatable' => 0,
'type' => 'list_text',
);

return $field_bases;
}

function playbox_form_user_profile_form_alter(&$form, &$form_id, $form_state){
dsm($form);
}
9 changes: 9 additions & 0 deletions sites/all/modules/playbox_users/playbox_users.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name = Playbox Users
core = 7.x
package = Playbox
version = 7.x-1.0-alpha1
project = playbox_users
dependencies[] = features
dependencies[] = list
features[features_api][] = api:2
features[field_base][] = field_playbox_user_team
17 changes: 17 additions & 0 deletions sites/all/modules/playbox_users/playbox_users.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* @file
* Drupal needs this blank file.
*/

function playbox_users_get_team() {
$account = user_load($GLOBALS['user']->uid);
// Get team from user entity
if ($items = field_get_items('user', $account, 'field_playbox_user_team')) {
$playbox_user_team = $items[0];
}
}

function playbox_users_form_user_profile_form_alter(&$form, &$form_state, $form_id){
dsm($form);
}

0 comments on commit 30f6e54

Please sign in to comment.