I guess glance view on working site will give you more information than a walls of text explaining every single feature, but before do that lets see on check-list here http://drupal.org/node/59
i will shrink some base text
1. Your module shows no hint of Coding Standards.
No it do respect them, i try to follow drupal coding standard as closely as i can, and always use coder-module as a polisher to my code.
2. Your module outputs a lot of HTML but there's not a theme function in to be found in the code anywhere.
it does not output any html tag due to its logic, but i always use hook_theme for all custom output and templates for parts that end-user will see
3. Your module has a lot of string literals but not a hint of t()?
all string that user will see run through t() directly or indirectly via other built-in functions, i supose i can miss some but its totaly an exception that must be fixed as soon as i find such thing.
4. Some security advice. One of the first checks is to count how many times you have used check_plain() and how often %d appears in you module.
all user input that is goin to be displayed is run through check_plain() and all queries are made through according placeholders
5. Your module pulls in a lot of JavaScript code in-line without a hint of jQuery involvement.
this module does not use js, but rely on my other two supporting modules, witch all a following this check list, one of them extend standart ahah capabilities overriding built-in drupal ahah file, that functionality as i planing will be moved from it to another standalone module extending and easing ahah and ajax routine for me and maybe others, but this is another story.
6. Many people write good motivation messages and then mess it up right at the end with "here's a link to my contribution, it's about 75% done".
module's logic is complete, and its future depend on either it goes to CVS and i will write good coments and docs, or it does not and i leave it as is in second case it 100% complete.
ok now lets see how it works, well i was inspired by Matt Petrowsky from GotDrupal.com when in one of his video (http://gotdrupal.com/videos/drupal-views-arguments) he says that how it would be cool if drupal have such functionality in menu UI to create menu items and map them with % to some content... well that my module is doing! so in case you see that video i was building demo site in the almost same envierment.
so we have
a) site here http://test.in-place.org.ua/
b) user "JOE BLOGGER" with password "testQmenu" (log in to see it in action)
c) role BLOGGER that can blog AND have premission "administer qmenu" so you can see how it look like when you administrating them, obviously "JOE BLOGGER" has assigned to this role
d) as i mention earlier there currently 3 types of source content supported - node, view, path. as you login as JOE BLOGGER and click "my account" you will notice 4 additional tabs (LOCAL_TASKS) on your screen, first 3 are represent each of source type, but before you click them, let me briefly explain what you can expect
first: # Blogger`s check list (node) - is a standart node (Page type) created by root and mapped to this local task, this can be some quick reference, or check list, or reminder or whatever should be always by the hand (i'm planning to create bookmar module and that could be on that page too, but thats again another story) depending on what content available on site
second: # Blog posts (view test) - this is what Matt Petrowsky want to have in drupal, that tab linked to a view that display users blog posts, and user argument extracted from an URL and mapped to a view as parametr
third: # QMenu (path test) - this is actualy 3 mapped path as this task has 2 subtasks. this is a mapped interface for managing QMenu where you can see how it organised, what parameters can be added for different source types and test some features. here is another way of use this module - display same pages in more than one places, from a module-designer view i want this manage QMenu interface was near standart Menu in adnim/build but poorly JOE blogger cant see that even if he has "administer qmenu" premisison, so i mapped that into his "my account" page.
fourth: this was created by root and point to admin/build where JOE BLOGGER should not have access click it (JOE BLOGGER cant even create such links to places where he have not access)
well all after it's up to you - try to create some mapping also try to map something that you shouldn't have access like "admin"
and few words on security, in addition to access premissions that you can set for the menu item itself following will apply
for node: node_access('view', $node)
for path: all security checks that that path would normaly check
for view: well it up to view designer check incoming paramenres
p.s. to create an entry first press preview and if you have access to that source type - submit button will apear withing prebiew of source content
with best regard, and thank you for even reading all this.. if you of course do :)
Comments
Comment #1
qwaygon commentedthis is the module
Comment #2
qwaygon commentedtime past, and supported ahah (qtools_ahah) module that was suposed to fit the needs of QMenu become the real essence of my desires, and probably more valuable than QMenu itself, i DO belive that it worth at least looking at becouse as for me it so useful and flexible that i will definetly use it to the rest of my life, even that it only provide some api, it is well self-documented clean and coder say its ok, it pass all checks here http://drupal.org/node/59. i don't write separate example module but QMenu is used its features so QMenu can be an example module
so here is a question what should i do since QMenu forms manipulation significally changed in backend according to qtools_ahah new features:
a) add reworked code to this issue with (the changes does not affect any functionality or logic, only form ahah handling part, it become more secure, more clean, more flexible and less coded) (i will actually do this)
b) write here an appication for qtools_ahah moving to CVS (i'd be happy to maintain both, but dont want abuse CVS, so if i have to choose with one is more important for me and community i belive its "qtools_ahah") from its name you can think that its just another "ahah_helper" module but i saw code for ahah_helper, and this module much more than that, so much that if i want to comaintain "ahah_helper" it will has to be rewriting from scratch, here i use completly different way, much more flexible, richer, and secure. since qtools_ahah module is well self documented - please glance on it and if you thinks that it "might" be ok for CVS - i will write complete application here or create a new one . from now "qtools_ahah" dont have any dependencies, and completly 100% finished standalone module, QMenu included in this acrhive is an example of using "qtools_ahah" module, if you decide to give it a chance - start straight from qtools_ahah.module there is a dosens of comment there (grammar may be horroble and a lot of typo in coments, but if this goes to CVS its obviouse will be fixed)
p.s. i don't mean any harm for "ahah_helper" its just accomplish different goals
Comment #3
avpadernoIt seems that the file is duplicating code already present in misc/ahah.js, rather than extending it.
Comment #4
qwaygon commentedwhell mostly yes for now, the reason it is so - its becouse i can't just extend Drupal.ahah.prototype.success function without changing original drupal files (and that would be not in drupal way) so i have to cut whole function in to my file to inject a little loop for each "extra" piece, at the time of this writings injection also allow evaluting js on client side and look like this
doesn't look very shiny but do its job and future is depend on eaither it goes to CVS
with this feature comes i've change a 4.4 part of qtools_ahah_page_callback doc
and just in case we have switched from QMenu to qtools_ahah here are demo site for you
url: http://dp.in-place.org.ua/
user: barefoot
pass: but.smart
nevermind about what happening on the site since it was a demo for my friend, BUT it also uses all features of qtools_ahah to aka "server side" managing of jcarousel
when you in, go to http://dp.in-place.org.ua/node/14/manage there will be managing interface for my implementation for galleries and images , what we are interesting about is bottom 2 regions
1st - QImage already attached to this gallery...
2nd - QImage that are not attached to any QGallery
so lets see qtools_ahah in action
a) select some images in 2nd region and press attach, qtools_ahah will refresh 4 separated div-s (2 selects for paging and 2 ul-s from jcarousels) this is multiply extras test, the target on actual button's '#ahah' property is set to unexisted ID and all 4 pieses goes trough extras
and after you do that you will note that 1st region while contain added images looks broken, thats becouse we just print content inside a carousel but the initial size of carousel stay unchanged and result in "vertical row" of images
b) attach ALL images to the gallery (so the 2nd region become empty) and refresh the page, now 2nd regions jcarousel size is set to 1 (ther are single message)... now select some images from 1st region and press detach. This time items goes to the bottom jcarousel and all looks fine, becouse in this time we add another 2 extras
that tels our carousel that we going to manipulate images so it can rearange itself.
in attachment you will find current qtools_ahah used module on that site and a part from qgallery module that contain complete hook_qtools_ahah_access(); implemenation for whole page, and handling AHAH key = 'qgallery/manage/detach/%' section (as you can note both "detach" and "attach" buttons use same function for refreshing page).
p.s. qtools_ahah.module doesn't have many changes, just add a hook_perm and extend coments for main function
Comment #5
qwaygon commentedComment #6
avpadernoI have seen some JavaScript functions that has been copied as they are from the file ahah.js. If you need to change a function, there isn't the need to copy the functions that are not changed.
Comment #7
qwaygon commentedyes but it IS changed... hm... i downloaded modules2.zip from #2 post just to check , unpack and look at qtools_ahah.js it contain changed part that hard to be missed with huge coment
the send.zip from #4 have even more changed text (see first code snippet in #4 coment) while that are not "1000 lines of chage" they ARE nessesary (nvm for all comented alerts)
so i don't realy understand what do you mean by "there isn't the need to copy the functions that are not changed." while that clearly has a point :) it does not apply to this case, becouse this function definetly CHANGED in qtools_ahah.js
Comment #8
avpadernoThank 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 #10
avpaderno