function nodeaccess_save_role_aliases in Nodeaccess 5
Same name and namespace in other branches
- 6.2 nodeaccess.module \nodeaccess_save_role_aliases()
- 6 nodeaccess.module \nodeaccess_save_role_aliases()
- 7 nodeaccess.module \nodeaccess_save_role_aliases()
1 call to nodeaccess_save_role_aliases()
- nodeaccess_admin_form_submit in ./
nodeaccess.module - Submit function for nodeaccess_admin_form.
File
- ./
nodeaccess.module, line 706
Code
function nodeaccess_save_role_aliases($edit) {
db_query('DELETE FROM {nodeaccess_role_alias}');
$success = TRUE;
if (is_array($edit)) {
foreach ($edit as $key => $value) {
$success = $success && db_query("INSERT INTO {nodeaccess_role_alias} (rid, name, weight) VALUES (%d, '%s', %d)", $key, $value['name'], $value['weight']);
}
}
if (!$success) {
drupal_set_message(t("There was a problem saving to the database"));
}
return $success;
}