You are here

user.page_title.inc in Page Title 6.2

Same filename and directory in other branches
  1. 8.2 modules/user.page_title.inc
  2. 7.2 modules/user.page_title.inc

User implementations of the page title hooks

File

modules/user.page_title.inc
View source
<?php

/**
 * @file
 * User implementations of the page title hooks
 */

/**
 * Implementation of hook_page_title_alter().
 */
function user_page_title_alter(&$title) {

  // If we're looking at either a user profile page, get the user title
  if (($user = menu_get_object('user')) || ($user = menu_get_object('user_uid_optional')) && variable_get('page_title_user_showfield', 0) && ($user_title = page_title_load_title($user->uid, 'user'))) {
    $title = $user_title;
  }
}

/**
 * Implementation of hook_page_title_pattern_alter().
 */
function user_page_title_pattern_alter(&$pattern, &$types) {

  // User Page Pattern
  if (($user = menu_get_object('user')) || ($user = menu_get_object('user_uid_optional'))) {
    $types['user'] = $user;
    $pattern = variable_get('page_title_user', '');
  }
}

/**
 * Implementation of hook_page_title_settings().
 */
function user_page_title_settings() {
  return array(
    'page_title_user' => array(
      'label' => 'User Profile',
      'scopes' => array(
        'global',
        'user',
      ),
      'show field' => TRUE,
      'description' => 'This pattern will be used for a user profile page (eg <code>/user/1</code>)',
    ),
  );
}

Functions

Namesort descending Description
user_page_title_alter Implementation of hook_page_title_alter().
user_page_title_pattern_alter Implementation of hook_page_title_pattern_alter().
user_page_title_settings Implementation of hook_page_title_settings().