I took a look at this as something I want to use in a site I'm building, primarily as an example. I thought the implementation of widgets fell short -- do you really want people modifying your module's directory to add their widgets? That kind of sucks.

CTools provides a great plugin system to allow modules and themes to provide widgets. This means themes can SHIP with customized vote up/down widgets that fit for that theme and are simply selectable.

Also, CTools has an AJAX framework that made it possible to remove all javascript from this package. Makes widget creation easier when you don't have to worry about javascript at all. To facilitate this I moved the javascript response callback to the .theme.inc file, and modified the call slightly since these calls now need to know which widget is in use so it knows how to render the result.

Finally, this corrects a couple of errors in the template file, such as not using t(). And I included documentation on the widgets.

Whether this patch is accepted or not, I'll be building a site with a module that utilizes this patch. I may release a vote_up_down submodule for another voting type, but won't be able to release it without this patch. However you want to do it.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

merlinofchaos’s picture

Note that this adds a .inc file for each widget and removes the .js file for each widget, so be sure to cvs add and cvs rm accordingly. patch won't do that part for you.

merlinofchaos’s picture

Oh and yes, I realize this adds a dependency on another module. However:

1) CTools will spread
2) The AJAX framework in CTools is pretty close to what went into core for Drupal 7, so it's more in line with what you'll want for D7 updating anyway.

merlinofchaos’s picture

FileSize
35.88 KB

Weird. I remember there being a patch here once. Ah well. Here is the patch.

MichaelP’s picture

Merlin,

could you elaborate on the installation steps of this patch for lesser mortals please?

Many thanks.

nightowl77’s picture

For people reading the issue thread: Post #4 and #5 (this one) is a help/support note and you can skip it

@MichealP: You didn't say if you are on Windows/Linux or Mac

You can find some information on how to apply patches in Windows here: http://drupal.org/node/60179

There's also a discussion here: http://drupal.org/node/14231

The basic steps involved are:

1. Download the 6.x-dev version of vote_up_down
2. Unzip the 6.x-dev version
3. Download the patch and save it in the directory created in step 2.
4. Apply the patch as described in the links above (On Linux the command would be patch -p0 < ctools-plugin.patch)

You should now have the changes merlinofchaos implemented

Hope this helps!

crea’s picture

Subscribing. Would be sooo pity to have this forgotten

lut4rp’s picture

Issue tags: +vud-2-blocker

Tagged.

marvil07’s picture

Subscribing and marking as blocker, since Patrul and me are really interested in this to happen. Mainly because actual own widget system do not rock enough :-)

merlinofchaos’s picture

I'm definitely still interested in this as I am using it for a site I am building in my spare time. I should make sure the patch is the most up to date. I can' tremember if I made changes afterward or not.

marvil07’s picture

Assigned: Unassigned » marvil07
marvil07’s picture

I updated the patch according to the last code in DRUPAL-6--2 branch.

I'm also attaching a second patch where I "recover" the js alert when user is denied to access(one of those changes since this patch appear).

It's the first time I interact with ctools, so I could not find a way to react on the denied class without using javascript(I mean a js file), so maybe there's a ssugestion for that? :-)

marvil07’s picture

uppss.. too quickly :-( here is a second version of the second patch that works for all widgets.

marvil07’s picture

Status: Needs review » Fixed

Some hours ago I talked with merlinofchaos about this, his review of the re-roll was positive. So it's commited. Thanks for taking the time to review :-)

I also commited the fix for popup as the patch here.
I tried to do it with ctools_ajax_render_error() but for that, I need the message on vud_vote(), and one of the conditions that message depend on is teaser flag, so.. I did not find a way to have that value on vud_vote() and then I commited this solution :-)

Status: Fixed » Closed (fixed)
Issue tags: -vud-2-blocker

Automatically closed -- issue fixed for 2 weeks with no activity.