Here is a module I wrote that opens the user login (user/login) and user register (user/register) into a modal frame. Please review it and modify it as necessary and see if we can add it to the next release of modalframe_contrib.

This is a useful module because it relies on a login block and there are no redirections after login or logout (except for a javascript-fired page refresh after login).

Instructions:

Depends on modalframe api module
unpack into sites/all/modules
enable "Modal Frame Register"
Go to admin/build/blocks
Place the 'Modal Frame Register/Login' block somewhere in your regions

Developed with Modal Frame API:
; Information added by drupal.org packaging script on 2010-05-14
version = "6.x-1.7"
core = "6.x"
project = "modalframe"
datestamp = "1273809616"

Thanks All!

Joe Hyde
http://www.hydeinteractive.com/

CommentFileSizeAuthor
modalframe_register.tar_.gz2.86 KBjghyde

Comments

webavant’s picture

This module works great and I hope it is committed very soon!

bratsun’s picture

super cool! exactly what i was looking for! thanks.

bratsun’s picture

To my mind it has only one drawback now. When you close the modal window, the page gets refreshed. What if the visitor did not fill in anything (just decided to login later)?

btopro’s picture

As some simple "fixes" to better conform with drupal convention. references to $_GET['q'] should be arg()

if ($_GET['q'] == 'modal/register' || $_GET['q'] == 'modal/login' || $_GET['q'] == 'modal/register/welcome') {

should be more like

if (arg(0) == 'modal' && (arg(1) == 'register' || arg(1) == 'login')) {

Other then that this looks great, going to try it out now. +1 for adding this in.

btopro’s picture

upon form submission (logging in) it reloads the logged in session inside the ModalFrame... lookin at how to fix it now..

jonfhancock’s picture

Subscribing

markus_petrux’s picture

Status: Needs review » Fixed

I have fixed a few coding standard issues and reorganized a little the code so that all functions are prefixed with module name, etc.

Committed to CVS:

http://drupal.org/cvs?commit=394174
http://drupal.org/cvs?commit=394176

Also, I have updated the README and the project page with a reference to the new module.

Thanks for the contribution. I'm sure it will help many sites out there as a base to their own customized implementations.

jghyde’s picture

After login, it stays on the same page by design. But how do you show that the user is logged in unless you reload the page to show the "logged in" version of the log-in block?

The refresh is fired by JQuery, so I guess you could edit that, or make a admin option to not reload the page (and hence load a diff Jquery function)

Joe

jghyde’s picture

AWESOME! My first module is committed! Time to crack out the beer.

joe

jghyde’s picture

I tested #5. It does load the destination in the modal frame after login IF the login_destination module is enabled.

I am not sure to call this a bug or call it "by design" and suggest that the module will forever be incompatible with login_destination.

Here's why:

The module prints login links from a block. The block login stays on the same page. That's why the module was written: To provide a way to log in without leaving the page that you are on.

So, if a page loads inside the modal window after clicking the submit button on the login modal, check and see if you also have login_destination enabled. Disable login_destination and see if the problem persists.

I'd appreciate feedback on fixing compatibilty with login_destination AND if there are any other conflicts that cause the modal window to contain the resulting page, full headers and all.

Thanks!

Joe

markus_petrux’s picture

Component: New module » modalframe_register.module

Since the module has already been committed to CVS, I think it is now better to deal with any outstanding issues using separate posts in the queue.

Please, post patches using the proper format and follow Drupal conding standards. :)

Status: Fixed » Closed (fixed)

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