Flag State is a small module that implements a very basic Flag type which can be used to control and maintain a boolean state flag for use in code or Rules evaluations. It gets all the benefits and features of the flag module including per user/global state, anonymous user support (Flag 2.x), flexible UI, export (features) friendly, integration with rules and views modules etc.
State flags are useful as a quick way of adding per user or global on/off switches.
The flag can be displayed on a block or elsewhere. Either do this in your theme, custom module or use the php filter in a custom block etc, Views header text etc. The code to render the flag is:
<?php
return flag_create_link('<flag_name>', 1);
?>For example use see my browsing history feature demo where the "Turn OFF browsing history" link (rendered in the View header) sets or unsets a state flag that is used in rules as a) a condition to disable the user's browsing history and b) as an event to clear the user's browsing history.
Downloads
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Utility
- Reported installs: 9 sites currently report using this module. View usage statistics.
- Downloads: 147
- Last modified: May 6, 2011