You are here

function _profile2_regpath_set_title in Profile2 Registration Path 7

Same name and namespace in other branches
  1. 7.2 profile2_regpath.inc \_profile2_regpath_set_title()

Sets page title for registration, login, and forgot password pages.

Parameters

object $profiles: Object containing single row from profile2_regpath_get_profiles() database result.

string $key: Array key for 'misc' array. This will determine the title settings.

3 calls to _profile2_regpath_set_title()
_profile2_regpath_user_login in ./registration_form.inc
Page callback: Displays a user login form.
_profile2_regpath_user_password in ./registration_form.inc
Page callback: Displays the forgot password form.
_profile2_regpath_user_register in ./registration_form.inc
Page callback: Displays a user registration form.

File

./registration_form.inc, line 72
Builds profile-specific register, login, and password forms.

Code

function _profile2_regpath_set_title($regpath, $key) {

  // Look for custom title in foremost profile, according to weight.
  if (isset($regpath->misc) && ($misc = unserialize($regpath->misc))) {
    if (array_key_exists($key, $misc)) {
      $title = $misc[$key];
    }
  }
  else {
    $title = 'User account';
  }

  // Set title. See http://drupal.org/node/1800116 for use of t().
  drupal_set_title(t($title));
}