You are here

function template_preprocess_lt_password_description in LoginToboggan 8

Implements hook_preprocess_() for theme function defined at hook_theme above.

Theme the password description of the user login form and the user login block.

File

./logintoboggan.module, line 413
LoginToboggan module.

Code

function template_preprocess_lt_password_description(&$variables) {
  switch ($variables['form_id']) {
    case 'user_login_form':

      // The password field's description on the /user/login page.
      $min_pass_length = \Drupal::config('logintoboggan.settings')
        ->get('minimum_password_length');
      if ($min_pass_length != '0') {
        $variables['description'] = t('The password field is case sensitive,
         minimum length %min characters.', [
          '%min' => $min_pass_length,
        ]);
      }
      else {
        $variables['description'] = t('The password field is case sensitive.');
      }
      break;
    case 'user_login_block':

      // If showing the login form in a block, don't print any descriptive text.
      $variables['description'] = NULL;
      break;
  }
}