Closed (fixed)
Project:
Role Weights
Version:
5.x-1.x-dev
Component:
External module integration
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Oct 2008 at 22:48 UTC
Updated:
11 Feb 2009 at 17:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
pfaocleGreat idea, have been playing with tokens and e-commerce - will take a look!
Comment #2
pfaocleHere's a patch for 5.x.
No "lowest" one yet, but then the module doesn't do that yet.
Comment #3
pfaocleBigger one. This one provides "lowest" role tokens.
I've also added function
role_weights_get_weighted_max($roles, $weight_end), where $weight_end should be 'lightest' or 'heaviest'. Therole_weights_get_highestfunction remains so as to not break too much in 5.x.However, I didn't add a wrapper type function for ..._get_lowest(), as 'lowest' and 'highest' don't really make sense (as mentioned here). I'm tempted to go with the obvious "lightest" for most negative and "heaviest" for most positive, seeing as though we're dealing with weights (good headsmack moment from me on that one earlier!).
role_weights_get_highestcould possibly be deprecated and removed in a later version.I've very briefly tested this:
Feedback/testing appreciated.
Comment #4
gregglesAwesome! Thanks for your work on this.
One thing: it's probably best to run the role names through check_plain() just to be sure.
Comment #5
pfaocleSure.
Comment #6
pfaocleAdded in the better named API function (role_weights_get_weighted_max with a parameter) and left ..._get_highest() in as a wrapper function to be deprecated/removed. Committed to 5.x/HEAD today.
Just need to re-roll this with the two Token functions now.
Comment #7
pfaocleThis patch will apply to current 5,x-1.x-dev and HEAD branches, but NOT to 1.2.
Comment #8
pfaocleCommitted to 5.x-1.x-dev and HEAD.