This project is not covered by Drupal’s security advisory policy.
This API module provides storage for User Preferences. Beats creating fields on the User entity or using $user->data which leaves you feeling dirty :/
Define preferences via hooks, clear the caches if/when defining new ones as this is all cached.
For convenience in the hook definition you can target forms to have your preference field added to which will also auto save the submitted form preference values. Note that $form['#user']->uid must be defined in the target form else we can't work out which user we're working with. Patches welcome to improve this.
If not using the form stuff then there are a set of functions to call to get/set preferences.
user_preferences($uid)- grab all of a users preferencesuser_preferences_save($uid, $preferences)- set a series of preferencesuser_preferences_save_single($uid, $preference, $value)- you get the idea...
@todo
- Behat tests (Travis CI)
- Per user preference cache
- Cross environment preference syncing
- REST API
Project information
3 sites report using this module
- Created by heylookalive on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
