Visibility API
tjholowaychuk - September 3, 2007 - 00:31
Brief description:
Provides a UI and API for modules to provide path/role access to both php and js widgets.
Key Features:
- Role specific visibility settings.
- Path specific visibility settings
- Show only on paths %
- Do not show on paths %
- Allows wildcards Example: products/*
- JavaScript inclusion / exclusion by CSS selectors
How to use:
- visibility_api_access($key, $path = '');
-
Every widget using specific visiblity api access must have a visibility_api_key.
The function above will simply return TRUE or FALSE if all visibility criteria are met, an optional path can be entered to check paths other than the current path.
-
Every widget using specific visiblity api access must have a visibility_api_key.
- visibility_api_form_configuration($key, &$form, $js = FALSE);
- A UI is provided to the user by simply adding this function into your settings form code. $visibility_api_key being a unique indentifier specific to your module or widget. $form being of course the form which you would like to add the visibility_api configuration form. When $js is TRUE additional form elements are provided to allow the user to also include / exclude by CSS selectors.
- NOTE: the submission values are automatically captured and saved.
Known Modules using Visibility API:
Development by vision media
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 5.x-1.2-6 | 2008-Apr-21 | 8.67 KB | Download · Release notes | Recommended for 5.x | |
