function flag_lists_save in Flag Lists 6
Same name and namespace in other branches
- 7.3 flag_lists.module \flag_lists_save()
- 7 flag_lists.module \flag_lists_save()
Saves a flag to the database. It is a wrapper around update($flag) and insert($flag).
2 calls to flag_lists_save()
- flag_lists_form_submit in ./
flag_lists.admin.inc - Save a list.
- flag_lists_rebuild in ./
flag_lists.module - Update ALL flag lists with settings form values.
File
- ./
flag_lists.module, line 823 - The Flag Lists module.
Code
function flag_lists_save(&$flag, $account = NULL) {
if (!isset($account)) {
$account = $GLOBALS['user'];
}
if (isset($flag->fid)) {
flag_lists_update($flag);
$flag->is_new = FALSE;
module_invoke_all('flag_lists', $flag, $account);
}
else {
flag_lists_insert($flag);
$flag->is_new = TRUE;
module_invoke_all('flag_lists', $flag, $account);
}
// Clear the page cache for anonymous users.
// cache_clear_all('*', 'cache_page', TRUE);
}