I need to be able to change the layout and basic HTML of the dropdown form that is enabled by LoginToboggan. This is currently defined in the

function _logintoboggan_toggleboggan ($form) {

This doesn't allow for the HTML that is defined in this function to be controlled by the user's theme. There is even a note in the code that states that this should be in the theme.

I am submitting a patch that moves the HTML of this code into a theme function that is called by the _logintoboggan_toggleboggan function. It is a pretty simple patch. I have tested it with the latest Drupal 5 and am able to customize the output of the dropdown using theme hooks.

Please review the patch and let me know what changes if any would need to be made to implement it into the module. Should I also submit a patch for the Drupal 6 version of the module?

CommentFileSizeAuthor
logintoboggan_form_theme.patch1.88 KBbryan kennedy

Comments

hunmonk’s picture

Status: Needs review » Closed (works as designed)
  • a theme function should not be returning form array elements, it should be returning HTML output to render
  • the HTML that you're trying to override with this theme function is the minimum needed for the block to function properly. IMO this should be tightly controlled to ensure proper functionality
  • if you really wanted to manipulate this stuff, you could implement a mini-module that uses hook_form_alter() to adjust $form['pre'] and $form['post'] -- you only need to make sure it's weighted after logintoboggan in the hook order.
  • the issue over at http://drupal.org/node/227768 is still a valid concern, but i don't think we need to solve it in this extreme of a manner.