You are here

function wysiwyg_user_update in Wysiwyg 7.2

Implements hook_user_update().

1 call to wysiwyg_user_update()
wysiwyg_user_insert in ./wysiwyg.module
Implements hook_user_insert().

File

./wysiwyg.module, line 1016

Code

function wysiwyg_user_update(&$edit, $account, $category) {
  if (isset($edit['wysiwyg_status'])) {
    db_delete('wysiwyg_user')
      ->condition('uid', $account->uid)
      ->execute();
    $query = db_insert('wysiwyg_user')
      ->fields(array(
      'uid',
      'format',
      'status',
    ));
    foreach ($edit['wysiwyg_status'] as $format => $status) {
      $query
        ->values(array(
        'uid' => $account->uid,
        'format' => $format,
        'status' => (int) (bool) $status,
      ));
    }
    $query
      ->execute();
  }
}