function styleswitcher_save_user_preference in Style Switcher 6.2
Same name and namespace in other branches
- 7.2 styleswitcher.module \styleswitcher_save_user_preference()
Saves the style key to the cookie.
Parameters
string $theme_key: Name of the theme to save the style for.
string $style_key: Style key to save.
2 calls to styleswitcher_save_user_preference()
- styleswitcher_active_style_path in ./
styleswitcher.module - Finds the style active for current user and returns its path.
- styleswitcher_switch in ./
styleswitcher.module - Page callback: Switches style when JS is disabled.
File
- ./
styleswitcher.module, line 762 - Module's hooks implementations and helper functions.
Code
function styleswitcher_save_user_preference($theme_key, $style_key) {
setcookie('styleswitcher[' . $theme_key . ']', $style_key, time() + STYLESWITCHER_COOKIE_EXPIRE, base_path());
}