-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
katypool
committed
Feb 17, 2015
1 parent
8cabd9e
commit 30f6e54
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
sites/all/modules/playbox_users/playbox_users.features.field_base.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |