Active
Project:
Form Tooltips
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Apr 2009 at 02:05 UTC
Updated:
2 Jun 2009 at 20:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
entrigan commented: ) you are right. This is my first module, and it amazing how something that works perfectly for your own personal needs can be wrong in so many ways when applied in a general sense.
Ok so my question is, until I can build a admin-interface (I do not think I will have time until perhaps the end of the month) what forms should have the tooltips applied? It could grab only forms not on admin pages. Or possibly only node add / node edit forms (that is how it used to be).
What do you think?
Comment #2
entrigan commentedSo rather than change where the tooltips are applied I have reduced the cases they get applied to so that it only happens for things that look like form item containers (not always a black and white question). This means it no longer applies to the modules page, but will still apply to something like the add vocabulary page.
This also means it will not apply to *any* thing you put a description tag on.
Sorry for the obvious bugs, I think I was a little hasty with the 1.0 release, but either way thanks for the help, I think we have it pretty close to working now.
Comment #3
entrigan commentedComment #4
TheAlienShore commentedI would say it would be good for pretty much anything public facing. For my case, I'd like it to only apply on node add or edit forms. Other people may feel differently, but that's what would work for the site I'm currently building.
Comment #5
sinasquax commentedIt's a great module but it could be greater if you add an admin page with a textarea where we can write the form name where this module should apply to.
Comment #6
sinasquax commentedHello, i have implemented a little administration page for this module, you can choose which forms will have tooltips :
Create a form_tooltips.install and put this code :
Create a form_tooltips.admin.inc and put this code :
And replace code of form_tooltips.module by :
This code works fine but if you set visibily to : 'Show on every form except the listed forms.' and you set a form id in the forms list, so if the form listed is on a page with other forms, the tooltips will be used regardless the option.
So maybe it will be better to set a list of path where tooltips will be applied instead a list of forms id.
And we can add other options like style of tooltips, color, effect, ...
Comment #7
entrigan commentedThanks Sinasquax,
I have been planning on looking into how to do this for a while, and this looks great. I just committed your updates to the 1.x-dev, and I am going to play/test it alot more tomorrow morning when I have time.
is the ^ an XOR operation?
if ((in_array($form_id, $forms_id)) ^ (!($scope)))BTW, thanks for the amazing code commenting.
EDIT: So it looks like the form validation is failing for things like page_node_form, perhaps because node forms are not declared with functions? I am looking into it. Otherwise it works great.
Comment #8
sinasquax commentedThank you for testing,
Yes the ^ is a XOR operation but for 'bit' test instead for logical test (in this case it's the same but it's preferable to put XOR instead ^, my mistake)
You are right, the node form doesn't works, i think it's because the code for nodes (node_form which is factory form for all content type) is doesn't loaded when drupal shows form tooltips admin form and so the test with function_exists return false.
But with this test, there's another problem, you can put function like variable_get, ... in the textarea and it will be validated (but it will does nothing), it's another reason to use path instead form name for the check but maybe there's a drupal function which return an array of form name or use drupal_get_form instead function_exists.
(sorry for my bad english)
Comment #9
sinasquax commentedI have modified the code to deal with paths instead with form id, i don't know what is the best solution (form id or path ?) but if you want keep the form id version so you must remove the check which looks if the form id is correct (because it's wrong).
You can set which path has / hasn't form_tooltips with paths like this :
node/%
node/%/edit
node/add/page
...
Comment #10
entrigan commentedI am hesitant to implement path based controls, because I think it is less intuitive (although perhaps easier to use). Either way my computer went kaput, so I will be revisiting this in a few days when I get this all sorted out.
On second thought paths might be a great idea, because many people do not know how to find form ID's, and like you said since it will apply to all forms on the page, that might actually be more intuitive. Unless it passes a variable to the JQuery which makes it only apply to specific forms within the page.