Here at the Dutch company Madcap.nl I have been developing a (drupal6-)module that works like a right-mouse-button on most operating systems. It is completely hookable by other modules and is therefor extremely versatile in it's functions.
Here we use it to move blocks around to different locations on the actual pages of the site itself (when logged in with the right access rule). It makes the blocks-admin-page obsolete because you can throw the blocks around on each page of your site. We also provide "hide on this page" and direct links for editing the block.
We also created a lot of functionality in these "contextual tips" for nodes, views, and users.
This means that each "entity" (page,node,block,view,user, etc) has a little icon in the top left corner when you mouse over them. When you click on it the contextual tip appears with all kinds of links and functions. These links and functions are hookable and thus extendable.
The module is called "contextual" and already used on some production sites. We would love to make this an open source module so everyone can enjoy it as we do.
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | administertooltip.tar_.gz | 26.84 KB | JaapB |
| #28 | administertooltip.tar_.gz | 26.83 KB | JaapB |
| #24 | administertooltip.tar_.gz | 26.53 KB | JaapB |
| #19 | administertooltip.tar_.gz | 26.58 KB | JaapB |
| #16 | administertooltip.tar_.gz | 26.45 KB | JaapB |
Comments
Comment #1
JaapB commentedHereby the latest version of the contextual module for Drupal 6.
Comment #2
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
Comment #3
sunThe only acceptable module and code under the project name/namespace "contextual" would be a backport of the Contextual module shipped with D7.
Comment #4
JaapB commentedI have renamed the module to "Administer tool tip".
Attached the new version of the Administer tool tip module.
(Which also contains drag and drop for blocks as a nice extra feature.)
Comment #5
JaapB commentedI'll keep posting updates on the module while I'll wait for comments, suggestions, and maybe, just maybe, a module-page on drupal.org some day...
Here is the latest version with some bugfixes.
Especially the enabling of administer tool tips for (most of the) custom themes.
Enjoy..
Comment #6
JaapB commentedMore fixes and stylized selection area.
Still hoping on a reply from the community...
Screenshot | Demo
Comment #7
zach harkey commentedI really like the adminstertooltip module so far. Any ideas how we might incorporate the Skinr module's "Edit Skin" task?
I thought I might be able to replace the Skinr cog with your administertooltip module, by inserting some code like the snippet below into some of the hook_administertooltip_block_links()
E.g., in hook_administertooltip_ENTITY_AREA():
While this did add the "Edit Skin" link, it does not open in a modal dialog window, nor does it do all the cool AJAX live updating in the background like the Skinr cog link does.
The Skinr cog appears to be constructed entirely in Javascript (skinr.js) where it seems to be hopelessly isolated from a more general (and extensible) contextual admin menu solution.
Any thoughts?
(My kingdom for a decent contextual-admin.)
Comment #8
JaapB commentedI'll look into it!
Maybe I can add (copy) some of the javascript in a seperate submodule of some sort, and make it work together.
I'll let you know...
Comment #9
JaapB commentedHey Zach,
I agree with you that that Skinr's way is really hard to implement within AdministerToolTip. I am currently revising some of the javascript in my ATT module, after which it should be easier to combine Skinr with ATT.
But... it would be great if this module could make it on the modules page on Drupal..
Comment #10
JaapB commentedOkey... it has been a MONTH...
I am not very psyched to "give back to the community" anymore..
Go here for the visual part of the module:
Screenshot | Demo
Comment #11
sunComment #12
JaapB commented-edit-
Did not see your reply when I posted, I'll post an updated version later on...
Attached file is not the right one! (cannot delete it)
Comment #13
sunComment #14
JaapB commentedHi Sun,
Thanks for your review!
I have updated the module to fit your requests and comments, you can see the changes in the attached file..
But I do not agree with (or understand) your following comment:
"Note that _administertooltip_extend() is based on a 3 year old tutorial, which suggests an architectural design that is considered bad today."
The function just creates hooks for this module so it can be extended by other modules. I thought that that was the power of Drupal?
Am I implementing this in the wrong way? If so, can you point me in the right direction?
Thanks again for reviewing my module, I really appreciate the good look at it
Cheers, Jaap
Comment #15
avpaderno_administertooltip_extend()is just a copy of the Drupal functionmodule_invoke_all().Why isn't the code using
module_invoke_all()?The hook implementations are commented as (or more correctly ).
hook_preprocess_page(),hook_preprocess_user_profile(), etc; rather than having a unique function, it would be better to split the code in different functions.Comment #16
JaapB commentedHey Kiam,
First my apologies for the late reply, I had a holiday without internet...
But thanks for your review!
Your comment about the module_invoke_all is much clearer now and I have adjusted my module accordingly.
I have also changed the comments to your suggestions.
Your third point I do not get completely. If I would crumble the "module_preprocess" into seperate functions I would have a lot of the same code multiple times?
Like:
Or am I getting it wrong?
Thanks for your insights!
Comment #17
avpadernoPoint #3 is only a suggestion, not something that really needs to be done.
To explain it better, I will add some more notes here.
hook_preprocess_HOOK()implementations receive only an argument;$hookis not passed them, because they already know for which hook then are invoked.Comment #18
JaapB commentedHi Kiam,
Interesting thought. If there was a way I could avoid "double code" in these preprocess-functions I would immediately cut that long function up in to single functions. But I do not see a great way to do that.
For instance, this gives to much "double code" for my taste, although it looks nicer ;-)
(draft code, needs proper function naming and comments)
I'll change it for now to see how it feels...
More interesting thoughts or comments?
Comment #19
JaapB commentedLatest version with seperate preprocess-functions and refurbished javascript.
Works very nice and easy now!
What do you think?
Module live in action:
Screenshot | Demo
Comment #20
JaapB commented*bump*
Comment #21
JaapB commented*re-bump*
Comment #22
sunNeeds to use drupal_get_path() instead. And, actually, you should use module_load_include() instead.
Requirements error handling should happen in hook_requirements(), not during runtime.
jquery_ui module is listed as dependency in the .info file. It therefore needs to be installed to install this module. Drupal loads all installed modules.
Identical issue as with jquery_ui here.
You have to properly initialize the theme in order to detect its regions. There are various modules (plus system.module in core) that allow to change the theme depending on request conditions, such as an administration theme.
---
Sorry, this module is quite large and hard to review and therefore takes it time. I'm running out of time now. Leaving as "needs review" so perhaps others will help reviewing.
Comment #23
avpadernoLet's start to fix what already reported.
Comment #24
JaapB commentedHey Sun (and others)
I really appreciate your reviews, but I am afraid that you will forget my module between the thousands of others waiting for a review... therefor my "bump" here and there. I will try to control my impatience ;-)
Attached you will find the new version of ATT.
Nothing really changed except the fixes of the review above.
Again, thanks for the reviews!
Comment #25
JaapB commentedforgot the status-change...
Comment #26
JaapB commented*bump*
Comment #27
avpadernohook_uninstall()to remove the Drupal variables it defines.The first line should be . For hook implementations, parameters and returned value are not described.
I would use different permissions; is not the best.
Comment #28
JaapB commented1. Has been fixed in new release which was not uploaded here. New upload attached.
2. I took your previous advice apparently to litterally:
"The hook implementations are commented as Implementation of hook_ (or more correctly Implements hook_)."
I changed it again.
3. Everything is run trough the coder module on minor, there are no problems reported now.
Comment #29
avpadernoThe last permission should be .
Drupal.ATT_DNDandDrupal.ATTshould be named to something closer to the name of the module.Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #30
JaapB commentedThanks again for the review!
"2. The code is not completely formatted as reported by the coding standards."
- this still needs to be fixed, I'll work on it tomorrow
The rest has been modified according to your review.
(also 2 minor bugfixes)
Comment #31
avpaderno@JaapB: Thank you for reporting here the changed code. Your CVS application has been approved; you can commit the code in CVS, now. :-)
Comment #32
JaapB commentedNICE! thanks!
I have created the projectpage here: http://drupal.org/project/administertooltip
The code will be there in a jiff...
Comment #35
avpaderno