Download & Extend

Tabe titles on user/{,register,password} pages

Project:iTweak Login
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

It seems that when you change the text for the login block links, it cascades that change for the 'create account' link but not for the 'new password' link; I'm trying to effectively swap the two over, and this works fine for the login block, as I can override the targets of the links with each other's urls, and similarly swap the text (although I also alter one of the). However, it leaves the tabs at the top of all three pages confusing, as I have two tabs that say 'Forgotten password?', one of which points to the 'create account' page.

Looking at the code, I see that there's a block that applies to the page version:

      if (!$inpage) {
        $items = array();
        if (variable_get('user_register', 1)) {
          if ($register_button) {
            // Add a new register button ...
            $form['#validate'][] = '_itweak_login_custom_buttons';
            $form['register'] = array(
              '#type' => 'submit',
              // Place at the same weight as "Login" button for now
              '#weight' => $form['submit']['#weight'],
              '#value' => $register_button_name,
            );
          }
          else {
            // ... instead of a regular link
            $items[] = l($register_name, $register_url, array('attributes' => array('title' => t('Create a new user account.')))); // HERE
          }
        }
        if ($recover_button) {
          // Add a new register button ...
          $form['#validate'][] = '_itweak_login_custom_buttons';
          $form['recover'] = array(
            '#type' => 'submit',
            // Place at the same weight as "Login" button for now
            '#weight' => $form['submit']['#weight'],
            '#value' => $recover_button_name,
          );
        }
        else {
          // ... instead of a regular link
          $items[] = l($passwd_recover_name, $passwd_recover_url, array('attributes' => array('title' => t('Request new password via e-mail.')))); // HERE
        }
        $form['links']['#value'] = theme('item_list', $items);
        // Fix unassigned weight (it breaks order of controls later on)
        $form['links']['#weight'] = $form['submit']['#weight'] + 1;
      }

The lines labled HERE are those I assume apply the changes to the tabs. I can't see why one would be working but the other not. Of course, the text on the tab that's wrong isn't the default value in the code for passwd_recover_name either, so I'm at a bit of a loss.

Otherwise looking at what might be the problem, I can't see anything being done for the password recovering page but not the registration page. This may end up being a game-breaker, so I'm hoping for some guidance or help. I can think of several hypothetical explanations, but none that would be asymmetric like this.

Comments

#1

Okay, when setting them to swap as I have, my testing indicates that the tab that actually contains the registration form gets the text I set as the link text for the forgotten password form, while the one that actually contains the forgotten password form doesn't get changed at all.

#2

Ah, I see what's happening, I'll have to hack it I guess, although making it handle this intelligently will be interesting. Where do I submit a patch, if I can do it cleanly, to support this particular odd arrangement?

#3

Status:active» postponed (maintainer needs more info)

Patches should be submitted to the issue queue, as a response to an existing issue if possible.

#4

Version:6.x-1.14» 6.x-1.x-dev
Category:bug report» feature request
Status:postponed (maintainer needs more info)» closed (won't fix)

Please feel free to reopen with a patch rolled against -dev.