Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Implements hook_install().
- */
- function achievements_optout_install() {
- field_create_field(array(
- 'field_name' => 'achievements_optout',
- 'type' => 'list_boolean',
- 'settings' => array(
- 'allowed_values' => array(0 => '', 1 => ''),
- ),
- ));
- field_create_instance(array(
- 'bundle' => 'user',
- 'entity_type' => 'user',
- 'field_name' => 'achievements_optout',
- 'label' => t('I DO NOT wish to participate in or unlock achievements'),
- 'description' => t('DANGER! Checking this box will remove your unlocked achievements and delete your stored statistics.'),
- 'widget' => array(
- 'type' => 'options_onoff',
- 'weight' => 1,
- 'settings' => array(
- 'display_label' => 1,
- ),
- ),
- ));
- }
- /**
- * Implements hook_uninstall().
- */
- function achievements_optout_uninstall() {
- field_delete_field('achievements_optout');
- }
Add Comment
Please, Sign In to add comment