Limited theming abilty

ckng - September 18, 2008 - 18:43
Project:Advanced Poll
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

A quick glance at the advpoll result theming ability seems to be limited.
The only remotely related issues raised before are #111774: Creating a tpl.php file and #194317: Integrate Open Flash Chart API.

Currently provided theme functions are
theme_advpoll_bar()
theme_advpoll_results()
theme_advpoll_voting_binary_form()
theme_advpoll_voting_ranking_form()

E.g. possible theming requirements (which ATM seemingly impossible)
- using other chart types such as pie, line, area chart other than bar chart
- integration with other charting libraries - Google Chart API, Open Flash Chart, etc

I think the problem resides in the $results passed to theme_advpoll_results(), which is already pre-rendered bar instead of data. This renders the theme function useless as there is nothing much on the chart you can change. The theme_advpoll_bar() is having the similar problem by taking in one choice data at a time, which will not work for other chart types.

Take binary vote as example, my suggestion is
- advpoll_view_results_binary() should return a result set
- theme_advpoll_results() take in the result set, which at some point call theme_advpoll_bar() for bar, and can be overrided to output other chart types or integrate with other charting API.

Does that make sense? =)

#1

fajerstarter - September 19, 2008 - 15:20
Component:User interface (CSS, Images, etc.)» Code

Just reading this quickly it does sound like it makes a lot of sense :)

 
 

Drupal is a registered trademark of Dries Buytaert.