Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/inri/public_html/daCode-HEAD/daCode/src/phplib/poll.php3
daCode -

Poll

Poll

This class will handle the poll system

 

private class Poll

This class will handle the poll system

daCode http://www.dacode.org/
src/phplib/poll.php3
$Id: poll.php3,v 1.84 2002/05/13 21:34:03 jbcombes Exp $

Depends: Config Db Utils Html

 

Public Method Summary

void

Poll()

Class constructor
string

submit_new(mixed $table, [ string $widthcomment ])

Handles submission of a new poll
string

show_poll()

Shows a poll with form to vote
string

update_poll(integer $answer, integer $id)

Take a vote into account.
string

show_results([ string $id ])

Displays the results of a poll
string

poll_to_moderate()

Lists polls to moderate
string

edit_poll(integer $id)

Moderation form
string

list_polls()

List all polls for admin
mixed

mod_poll(integer $id, [ integer $status ])

Take into accout moderator's choice

Private Method Summary

string

add_poll(array $table)

Insert submitted values into the poll spool

Private Field Summary

object Db

$db

Db abstraction layer
object Session

$session

Session instance
object Cache

$cache

Cache abstraction layer
object HTML

$html

HTML rendering package (subclass of HTML)
object Utils

$utils

Utils package

Public Method Details

Poll

public void Poll( )

  Class constructor

Returns void


submit_new

public string submit_new( mixed $table, [ string $widthcomment ] )

  Handles submission of a new poll
If table is an array, calls add_poll and returns; else prints the html form.

Parameter
mixed $table
array resulting of form submission
string $widthcomment = >>"60"<<
of comments textarea
Returns string

the HTML form or "Thanks sidebox.

See Also Poll::add_poll()

show_poll

public string show_poll( )

  Shows a poll with form to vote

Returns string

the sidebox with the form.


update_poll

public string update_poll( integer $answer, integer $id )

  Take a vote into account.

Parameter
integer $answer
answer the user selected
integer $id
of the poll
Returns string

HTML comments indicating status or error message


show_results

public string show_results( [ string $id ] )

  Displays the results of a poll
Calls exit if SQL fails

Parameter
string $id = >>"-1"<<
ID of poll, -1 for old polls?
Returns string

box with poll results


poll_to_moderate

public string poll_to_moderate( )

  Lists polls to moderate

Returns string

the list


edit_poll

public string edit_poll( integer $id )

  Moderation form

Parameter
integer $id
ID of the poll
Returns string

the form


list_polls

public string list_polls( )

  List all polls for admin

Returns string

the list


mod_poll

public mixed mod_poll( integer $id, [ integer $status ] )

  Take into accout moderator's choice
Cals exit if user not admin (or is it moderator)?

Parameter
integer $id
poll ID
integer $status = >>0<<
status to set
Returns mixed

void if success, string HTML comment describing error on failure


Private Method Details

add_poll

private string add_poll( array $table )

  Insert submitted values into the poll spool

Parameter
array $table
table, resulting submit_new form submission
Returns string

thanks message


Private Field Details

$db

private object Db $db

>><<

Db abstraction layer


$session

private object Session $session

>><<

Session instance


$cache

private object Cache $cache

>><<

Cache abstraction layer


$html

private object HTML $html

>><<

HTML rendering package (subclass of HTML)


$utils

private object Utils $utils

>><<

Utils package



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta