Closed (fixed)
Project:
Simple Dialog
Version:
7.x-1.4
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2012 at 07:50 UTC
Updated:
5 Nov 2012 at 16:41 UTC
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
Comment #1
drclaw commentedCool. Nice tip!