Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
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 (   $option)

prints a cross image or a blank image

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 (   $answers)

prints the answer fields table for current vote

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 ( )

prints the end of the edit form ... closes

public

Here is the call graph for this function:

printFormStart (   $voteID,
  $rangeID,
  $referer 
)

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

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 ( )

prints needed javascript functions...

public

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

prints the table for the vote's properties

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 (   $question = "")

prints the question field for current vote

public

Parameters
string$questionthe vote's question, if existing

Here is the call graph for this function:

printRightRegion ( )

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

public

Here is the call graph for this function:

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

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

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 (   $title = "")

prints the title field for current vote

public

Parameters
string$titlethe vote's title, if existing

Here is the call graph for this function:

Variable Documentation

global $pageMode
int $type

is either "vote" or "test" private

Vote $vote

the vote object private