Closed (won't fix)
Project:
Audio
Version:
5.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2007 at 04:27 UTC
Updated:
10 Oct 2007 at 06:52 UTC
I'd like to bring a lightbox.js UI element into the Audio module so that when you submit a song, the long lonely wait for an upload is improved with a fade-out and a simple update bar. The lightbox.js page (http://www.creativeruin.com/index.cfm/article/32944) has everything I need, but I can't make heads or tails out of the hook-laden form in audio.module. In a simple form, it's called as easily as:
<input type="submit" name="submit" value="Submit" rel="lightboxform" />
Where would I make the call with audio.module?
Comments
Comment #1
sinker commentedI've re-titled this support entry, and can now clarify after some more research:
I want the last submit button on the audio upload page to have this simple text added as a suffix:
rel="lightboxform"Now, I've added this to the PHP:
where it seems all the other arrays are being defined, but (1) I'm not sure I'm even defining the right submit function, as there are so many and (2) I'm not seeing it in the source code of the rendered page, so clearly I'm doing something wrong.
For the life of me, I don't know what. Thanks in advance for any and all help!
Comment #2
sinker commentedany help?
Comment #3
drewish commentedyou'd need to do that through a hook_form_alter() since the node.module is what puts the submit button onto the form.
Comment #4
sinker commentedCan you walk me through this a little bit more completely? I'm new to these types of modifications.
Comment #5
zirafa commentedUnfortunately this is more of a general drupal coding question, so marking as won't fix.
But I believe what you want to do is actually add rel="lightboxform" inside the input.submit element, not after. #suffix and #prefix specify HTML that comes before and after that actual form element.
What I'm guessing you want is:
Go to: http://api.drupal.org/
and scroll down to Form API Quickstart and Form API Reference. Those should help with understanding the Form API system in Drupal.
About Form API #attributes:
http://api.drupal.org/api/file/developer/topics/forms_api_reference.html...
About hook_form_alter
http://api.drupal.org/api/function/hook_form_alter/5
Basically, you want to create a new module, with your own hook_form_alter, and modify audio_node_form to add the #attributes that you want.
Additionally, you can go to #drupal-support in IRC to get real time help.
Comment #6
zirafa commentedAlso note that you can add this using jQuery, something akin to