This patch is in response to an IRC conversation between Roger, RobLoach, and myself. I believe this takes us in the direction we discussed, as well as adding a close command and some documentation changes.

The main points of interest are:

  • Move anything not strickly dialog api related to another module (now called dialog_links)
  • Renamed example folder and dialog_example module to "dialog_examples" (To address the fact that it is showing off multiple sub-modules now.)
  • Added dialog_loading command to dialog.module
  • Added dialog_close command to dialog.module and dialog.js
  • Added and changed many code comments. Feel free to correct the language anywhere its needed.

Please review and let me know if anything needs changes for a commit.

This patch is against the D7 version, aka CVS HEAD.

Comments

te-brian’s picture

StatusFileSize
new15.14 KB

This fixes one documentation length issue and one typo in the dialog_command_close() function.

te-brian’s picture

Title: Dialog module reorganiztion and changes. » Dialog module reorganization and changes.

Title typo

te-brian’s picture

After some IRC talk, I'm going to make some revisions to this patch. So feel free to comment on it in general, but don't commit.

robloach’s picture

Status: Needs review » Needs work

te-brain and I talked about having:

dialog.module
The Dialog API stripped down to the bones. This contains the Dialog AJAX commands (dialog_display, dialog_close, dialog, dialog_xlazyloader, etc).
dialog_core.module
Adds Dialog stuff to Drupal core via dialog.user.inc (dialogs for user.module), dialog.node.inc (dialogs for node module), dialog.taxonomy.inc (dialogs for taxonomy terms and vocabularies), etc. Dialog Core would also come with administration to check which features become enabled.
dialog_examples.module
Some use cases of the Dialog's API, similar to how the Examples module is setup.
zroger’s picture

I like the direction of this.

I haven't yet played with it, but one initial thought is that we should be using 'dismiss' instead of 'close' for consistency with the 6.x branch.

te-brian’s picture

StatusFileSize
new18.2 KB

Alright, this patch accounts for recent IRC decisions as well as Roger's request to change 'close' to 'dismiss'.

It also adds the dialog_core module. This provides the means to use a 'use-dialog' class on links, as well as adding some special handling for logging in, registering, and requesting a password via the dialog. Left TODO on this functionality are some '#ajax' quirks, such as an enter key press not triggering the submit button's ajax functionality.

More generally, there are also some ajax problems to deal with such as 403 and 404s not being handled well in the dialog. Ideally, php errors during an ajax requests would prompt an error message, rather than send the user to a json reponse. These are probably to be solved outside this module, however.

[Edit]: Applying the patch leaves behind an empty 'example' folder (the real one is now 'examples'). I'm not sure how to deal with this in a patch.

robloach’s picture

Priority: Normal » Critical
Status: Needs work » Needs review
StatusFileSize
new20.35 KB

Okay, I built off of what te-brian did, and moved in some of the concepts that Roger brought up in the DRUPAL-6--1 branch as well as rearranged a couple things....

  1. Moved the user stuff from the example to modules/dialog_user/dialog_user.module.
  2. Removed $_GET['dialog'] as that's just kind of ugly. Replaced with dialog_enabled.
  3. We now have example/dialog_example.module, modules/dialog_user.module, etc to match the DRUPAL-6--1 setup.
  4. Moved all the OMGEVERYTHINGSADIALOG stuff (drupal_core.module) to modules/dialog_contextual/dialog_contextual.module, which adds a dialog for all the contextual links.
  5. Moved some of the stuff that should be part of dialog.module there (like the command_redirect).
  6. Added the %dialog_js menu load handler. This allows you to either use dialog_enabled or the custom menu callbacks. Dialog User and Dialog Example uses the menu callbacks, while the contextual links use dialog_enabled.

Todo:

  • Something is missing with modules/dialog_user/dialog_user.module's dialog_user_login_callback. You guys mind taking a look? The drupal_get_form() call is incorrect....
  • There are a lot of places in Dialog User that we could expose the dialog. This just exposes it on the user block.
  • Dialog Contextual Links is pretty minimalistic, and I'm sure it could improve, if you get any ideas, shoot them!
  • Dialog Comments
andypost’s picture

subcribe

podarok’s picture

subscribe

devin carlson’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

The 7.x-1.x branch of the Dialog module is unsupported.