You are here

function _profile2_regpath_set_title in Profile2 Registration Path 7.2

Same name and namespace in other branches
  1. 7 registration_form.inc \_profile2_regpath_set_title()

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

Parameters

object $regpath: 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 ./profile2_regpath.inc
Page callback: Displays a user login form.
_profile2_regpath_user_password in ./profile2_regpath.inc
Page callback: Displays the forgot password form.
_profile2_regpath_user_register in ./profile2_regpath.inc
Page callback: Displays a user registration form.

File

./profile2_regpath.inc, line 147
Modifications to the user registration form.

Code

function _profile2_regpath_set_title($regpath, $key) {

  // Look for custom title in foremost profile, according to weight.
  if (isset($regpath[0]->misc) && ($misc = unserialize($regpath[0]->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));
}