If you use the user login block and would the "Create new account" and "Request new password" links/forms to be modal, you can achieve this by placing the following code into your themes template.php.

/**
 * Implement hook_form_alter().
 */
function YOURTHEME_form_user_login_block_alter(&$form, &$form_state, $form_id) {  
  $items = array();
  if (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
    $items[] = theme('simple_dialog_link', array(
      'text' => t('Create new account'),
      'path' => 'user/register',
      'selector' => 'user-register-form',
      'title' => t('Create a new user account.'),
      'options' => array(
            'width' => 900,
            'resizable' => FALSE,
            'position' => 'center',
          ),
      'class' => array(),
      'query' => '',
      )
    );
  }
  $items[] = theme('simple_dialog_link', array(
      'text' => t('Request new password'),
      'path' => 'user/password',
      'selector' => 'user-pass',
      'title' => t('Request new password via e-mail.'),
      'options' => array(
            'width' => 900,
            'resizable' => FALSE,
            'position' => 'center',
          ),
      'class' => array(),
      'query' => '',
      )
    );
  $form['links'] = array('#markup' => theme('item_list', array('items' => $items)));

}

Comments

drclaw’s picture

Status: Reviewed & tested by the community » Fixed

Cool. Nice tip!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.