You are here

function themekey_ui_user_insert in ThemeKey 7.2

Same name and namespace in other branches
  1. 7.3 themekey_ui.module \themekey_ui_user_insert()
  2. 7 themekey_ui.module \themekey_ui_user_insert()

Implementation of hook_user_insert()

Parameters

unknown_type $edit:

unknown_type $account:

unknown_type $category:

1 call to themekey_ui_user_insert()
themekey_ui_user_update in ./themekey_ui.module
Implementation of hook_node_update()

File

./themekey_ui.module, line 355
ThemeKey UI is an extension for ThemeKey

Code

function themekey_ui_user_insert(&$edit, $account, $category) {
  if (user_access('assign theme to own nodes') && variable_get('themekey_ui_author', 0) && !empty($edit['themekey_ui_theme'])) {
    db_merge('themekey_ui_author_theme')
      ->key(array(
      'uid' => $account->uid,
    ))
      ->fields(array(
      'uid' => $account->uid,
      'theme' => $edit['themekey_ui_theme'],
    ))
      ->execute();
    if (isset($account->themekey_ui_theme) && $edit['themekey_ui_theme'] != $account->themekey_ui_theme) {

      // theme settings changed
      // fast deletion of page cache (truncate)
      cache_clear_all('*', 'cache_page', TRUE);
    }
    $edit['themekey_ui_theme'] = NULL;
  }
}