You are here

function ckeditor_user_presave in CKEditor - WYSIWYG HTML editor 7

Implements hook_user_presave().

File

includes/ckeditor.user.inc, line 127
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_user_presave(&$edit, $account, $category) {
  if (user_access('customize ckeditor')) {
    module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib');
    $default = ckeditor_user_get_setting_default();
    $edit['data']['ckeditor_default'] = isset($edit['ckeditor_default']) ? $edit['ckeditor_default'] : $default['default'];
    $edit['data']['ckeditor_show_toggle'] = isset($edit['ckeditor_show_toggle']) ? $edit['ckeditor_show_toggle'] : $default['show_toggle'];
    $edit['data']['ckeditor_width'] = isset($edit['ckeditor_width']) ? $edit['ckeditor_width'] : $default['width'];
    $edit['data']['ckeditor_lang'] = isset($edit['ckeditor_lang']) ? $edit['ckeditor_lang'] : $default['lang'];
    $edit['data']['ckeditor_auto_lang'] = isset($edit['ckeditor_auto_lang']) ? $edit['ckeditor_auto_lang'] : $default['auto_lang'];
  }
}