Our use case is to get rid of ranking poll, but, well, might as well make it a hookable system.
Here's some api for the hooks, but didn't see any place to put them so not in patch.
/**
* Returns advpoll modes
*
* @return array
* An array of modes
*
* 'name': mode key, used to identify the mode.
*
* 'name_label': The title/label of the mode, used for user interface.
*
* 'description': Description of the type.
*/
function hook_advpoll_info() {
return array(
'mypoll' => array(
'name' => 'mypoll',
'name_label' => t('My poll type'),
'description' => t('Description of my poll type.'),
),
);
}
/**
* Alter the type of modes available.
*
* @param array $modes
* A keyed array of different advpoll modes
*/
function hook_advpoll_alter($modes) {
unset($modes['mypoll']);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 987446_advpoll_advpoll_info.patch | 18.03 KB | hefox |
| #2 | advpoll_advpoll_info.patch | 577 bytes | hefox |
| advpoll_advpoll_info.patch | 583 bytes | hefox |
Comments
Comment #1
hefox commented(typo with the documentation, should be hook_advpoll_info_alter).
Comment #2
hefox commentedTypo in patch also, fail u.u.
(I guess also should documentent that people need to implement the other 'hooks' and how).
Comment #3
hefox commentedHere's an extended patch to convert existing implementations into a full hook system where node type == mode,* and use psuedo hooks like node types do
The 'new' hooks are
though can't find where hook_advpoll_preprocess_voting_form functionality was being used.
* Wanted to do that so the hooks would be named space, if hadn't done it the binary implementations would be binary_blah, eek!
(... all cause I wanted to eradicate ranking poll via a drupal_alter XD).
However without #987462: check advpoll_node_info instead of strstr to determine if advpoll type? still need node type to begin with advpoll.
Comment #4
gobinathmD6 is EOL hence won't be fixing this.