Home « Server software «
Documentation: overlays/poll.php
class Poll extends Overlay - Describe one poll
Normally, a poll appears at the front page only to let people vote.However, you can select to also display raw results by adding the keyword '
poll_with_results
' in the field for options of the containing article.This script is a reference file of this system.
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
- GnapZ
Testeurs:
- Timster
Reste à faire:
- export data as csv
get_fields() - Build the list of fields for one overlay
function get_fields($host, $capability='?')
- $host - the hosting attributes
- $capability='?' - string surfer capability ('?', 'M', or 'A')
- returns a list of ($label, $input, $hint)
Voir aussi:
get_label() - Get an overlaid label
function get_label($label, $action='view')
- $label - string the target label
- $action='view' - string the on-going action
- returns the label to use
- 'edit' modification of an existing object
- 'delete' deletion form
- 'new' creation of a new object
- 'view' rendering of the object
Voir aussi:
get_text() - Display the content of one poll
function get_text($variant='view', $host=NULL)
- $variant='view' - string the variant, if any
- $host=NULL - attributes of the hosting page
- returns some HTML to be inserted into the resulting page
- 'view' - display poll result with graphical bars
- 'list' - display the voting form and results if article has option 'poll_with_results',
- 'box' - display the voting form
- else display the voting form
Voir aussi:
get_text_to_list() - Show voting form and raw results
function get_text_to_list($host=NULL, $enable_votes=TRUE)
- $host=NULL - array attributes of the containing page
- $enable_votes=TRUE - boolean TRUE if votes are enabled, FALSE otherwise
- returns some HTML to be inserted into the resulting page
get_text_to_view() - Fully describe a poll in its main page
function get_text_to_view($host=NULL, $enable_votes=TRUE)
- $host=NULL - array attributes of the containing page
- $enable_votes=TRUE - boolean TRUE if votes are enabled, FALSE otherwise
- returns some HTML to be inserted into the resulting page
Voir aussi:
get_text_to_vote() - Get the text to make people vote
function get_text_to_vote($host=NULL, $enable_votes=TRUE)
- $host=NULL - array attributes of the containing page
- $enable_votes=TRUE - boolean TRUE if votes are enabled, FALSE otherwise
- returns some HTML to be inserted into the resulting page
parse_fields() - Retrieve the content of one modified overlay
function parse_fields($fields)
- $fields - the fields as filled by the end user
- returns array of updated attributes
Voir aussi: