You are here

function page_title_user in Page Title 6.2

Same name and namespace in other branches
  1. 5.2 page_title.module \page_title_user()

Implementation of hook_user().

2 string references to 'page_title_user'
page_title_uninstall in ./page_title.install
Implementation of hook_uninstall().
user_page_title_pattern_alter in modules/user.page_title.inc
Implementation of hook_page_title_pattern_alter().

File

./page_title.module, line 444
Enhanced control over the page title (in the head tag).

Code

function page_title_user($op, &$edit, &$account) {
  switch ($op) {
    case 'update':
      if (isset($edit['page_title']) && user_access('set page title')) {
        db_query("DELETE FROM {page_title} WHERE type = 'user' AND id = %d", $account->uid);
      }

    // Fallthrough to insert is intentional!
    case 'insert':
      if (isset($edit['page_title']) && drupal_strlen(trim($edit['page_title'])) > 0 && user_access('set page title')) {
        db_query("INSERT INTO {page_title} VALUES('user', %d, '%s')", $account->uid, $edit['page_title']);
      }
      break;
    case 'delete':
      db_query("DELETE FROM {page_title} WHERE type = 'user' AND id = %d", $account->uid);
      break;
  }
}