Stud.IP  jlu_3.3 Revision
vote_edit.lib.php File Reference

Namespaces

namespace  vote
 

Functions

 printJSfunctions ()
 
 printFormStart ( $voteID, $rangeID, $referer)
 
 printTitleField ( $title="")
 
 printQuestionField ( $question="")
 
 printAnswerFields ( $answers)
 
 printRightRegion ()
 
 printRuntimeSettings ( $startMode="manual", $stopMode="manual", $startDate, $stopDate, $timeSpan)
 
 printProperties ( $multipleChoice, $resultVisibility, $co_visibility, $anonymous, $namesVisibility, $changeable)
 
 printFormEnd ()
 
 image_if_true ($option)
 

Variables

global $type
 
global $vote
 
global $pageMode
 

Function Documentation

◆ image_if_true()

image_if_true (   $option)

prints a cross image or a blank image

@access public

Parameters
bool$optionthe condition
Returns
string the HTML <img.. tag
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printAnswerFields()

printAnswerFields (   $answers)

prints the answer fields table for current vote

@access public

Parameters
array$answersthe vote's answers, if existing, e.g.: array( array( "answer_id" => "35b9dfed54c3740edcf96ece787994f3", "text" => "This is my answer", "counter" => 7, "correct" => YES ), array( "answer_id" => ... , .. ) )
Here is the call graph for this function:

◆ printFormEnd()

printFormEnd ( )

prints the end of the edit form ... closes

public

Here is the call graph for this function:

◆ printFormStart()

printFormStart (   $voteID,
  $rangeID,
  $referer 
)

prints the start of the edit form and errors, if any ... opens

@access public

Parameters
int$voteIDthe md5 ID of the vote to be created/modified
int$rangeIDthe rangeID of the vote to be created/modified
string$refererthe original http referer to be memorized...
Here is the call graph for this function:

◆ printJSfunctions()

printJSfunctions ( )

prints needed javascript functions...

@access public

◆ printProperties()

printProperties (   $multipleChoice,
  $resultVisibility,
  $co_visibility,
  $anonymous,
  $namesVisibility,
  $changeable 
)

prints the table for the vote's properties

@access public

Parameters
bool$multipleChoicewhether multiple answers are allowed
int$resultVisibilitysee VOTE_RESULTS_*
bool$co_visibilitywhether the user sees the correct answers right after voting (only if test)
bool$anonymouswhether the vote is being treated anonymously or not
bool$changeablewhether the user is allowed to change a given answer (only if not anonymous)
Here is the call graph for this function:

◆ printQuestionField()

printQuestionField (   $question = "")

prints the question field for current vote

@access public

Parameters
string$questionthe vote's question, if existing
Here is the call graph for this function:

◆ printRightRegion()

printRightRegion ( )

prints the right-hand-side region of the page, with a nice infobox and save/cancel buttons

@access public

Here is the call graph for this function:

◆ printRuntimeSettings()

printRuntimeSettings (   $startMode = "manual",
  $stopMode = "manual",
  $startDate,
  $stopDate,
  $timeSpan 
)

prints the tables for the runtime settings (start date, stop date...)

@access public

Parameters
string$startModeshould be "manual" or "timeBased"
string$stopModeshould be "manual" or "timeBased" or "timeSpanBased"
int$startDatea unix timestamp for the vote's start date
int$stopDatea unix timestamp for the vote's stop date
int$timeSpana timespan for the vote in seconds
Here is the call graph for this function:

◆ printTitleField()

printTitleField (   $title = "")

prints the title field for current vote

@access public

Parameters
string$titlethe vote's title, if existing
Here is the call graph for this function:

Variable Documentation

◆ $pageMode

global $pageMode

◆ $type

int $type

is either "vote" or "test" @access private

◆ $vote

Vote $vote

the vote object @access private