function fckeditor_profile_save in FCKeditor - WYSIWYG HTML editor 5.2
Same name and namespace in other branches
- 6 fckeditor.module \fckeditor_profile_save()
Save a profile to the database. @todo add more entries to array in the user_save line
1 call to fckeditor_profile_save()
- fckeditor_admin in ./
fckeditor.module - Controller for FCKeditor administrative settings.
File
- ./
fckeditor.module, line 681 - FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2007 Frederico Caldeira Knabben
Code
function fckeditor_profile_save($edit) {
db_query("DELETE FROM {fckeditor_settings} WHERE name = '%s' or name = '%s'", $edit['name'], $edit['old_name']);
db_query("DELETE FROM {fckeditor_role} WHERE name = '%s' or name = '%s'", $edit['name'], $edit['old_name']);
db_query("INSERT INTO {fckeditor_settings} (name, settings) VALUES ('%s', '%s')", $edit['name'], serialize($edit));
if ($edit['rids']) {
foreach ($edit['rids'] as $rid => $value) {
db_query("INSERT INTO {fckeditor_role} (name, rid) VALUES ('%s', %d)", $edit['name'], $rid);
}
}
// if users can't set their own defaults, make sure to remove $user->fckeditor_status so their default doesn't override the main default
if ($edit['user_choose'] == 'false') {
global $user;
user_save($user, array(
'fckeditor_status' => NULL,
));
}
}