CMS  Version 3.9
QuestionnairePreview Class Reference
+ Inheritance diagram for QuestionnairePreview:
+ Collaboration diagram for QuestionnairePreview:

Public Member Functions

 QuestionnairePreview ($mgr)
 
 writeOneQuestion ($question)
 
 writeScript ()
 
- Public Member Functions inherited from QuestionnaireForm
 QuestionnaireForm ($mgr, $readOnlyForm=false)
 
 makeSubordinate ($subordinate=true)
 
 getValidationEngine ()
 
 button ($text, $url, $confirm=null, $isScript=false)
 Adds a custom button to the form. More...
 
 drawButtons ()
 Draws any additional buttons specified in the calling script. More...
 
 getAnswer ($question)
 
 writeHTML ()
 
 fromPOST ()
 Put any updated or new answers in the $_POST array into the array of answers that are indexed by question id so that when we draw the form, the answers are shown, even if page is not reloaded. More...
 
 drawForm ()
 
 drawSubmitButtons ($submitLabel)
 
 drawReadOnly ()
 
 drawView ()
 
 getIndexedAnswers ()
 
 validate ()
 
 save ()
 

Public Attributes

 $mgr
 
- Public Attributes inherited from QuestionnaireForm
 $mgr
 
 $questions
 
 $answers
 
 $submitLabel = "Save"
 
 $validators = array()
 
 $requiredText = "<b>You must answer all required questions.</b><br/>"
 
 $msg
 
 $onSaveComplete = null
 Callback event handler that is fired after the AutoForm has finished saving data to the database. More...
 
 $readOnlyForm
 Specifies whether the entire form is read-only. More...
 
 $id
 
 $labelCSS = ""
 CSS Class to use for label cells. More...
 
 $valueCSS = ""
 CSS Class to use for field/value cells. More...
 
 $buttonCSS = "button"
 CSS Class to use for buttons. More...
 
 $inputCSS = ""
 CSS Class to use for input fields. More...
 
 $checkboxCSS = ""
 CSS Class to use for checkbox fields. More...
 
 $markRequiredFields = false
 Set to true to add an asterisk after required field labels. More...
 
 $onFormatLabel = null
 Label Processing hook. More...
 
 $buttons_at_top = false
 
 $requiredFieldsText = "* indicates required question"
 
 $subordinate = false
 
 $buttons = array()
 The custom buttons collection. More...
 
 $allowIncompleteSave = true
 Allows users to save partially completed forms. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QuestionnaireForm
static incrementArray ($array)
 

Detailed Description

Definition at line 502 of file questionnaire_form.inc.

Member Function Documentation

◆ QuestionnairePreview()

QuestionnairePreview::QuestionnairePreview (   $mgr)

Definition at line 506 of file questionnaire_form.inc.

507  {
508  $this->mgr = $mgr;
509  $this->readOnlyForm = true;
510 
511  $questions = $this->mgr->getQuestions();
512 
513  if(count($questions) == 0) return;
514 
515  foreach($questions as $question)
516  {
517  $this->questions[] = QuestionField::create($this, $question);
518  }
519  }
static create($parent, $question)
$form readOnlyForm
$question

◆ writeOneQuestion()

QuestionnairePreview::writeOneQuestion (   $question)

Reimplemented from QuestionnaireForm.

Definition at line 521 of file questionnaire_form.inc.

522  {
523  $required = $question->getRequired();
524  $qPk = $question->getID();
525  $num = ($question->question->question_number) ? $question->question->question_number : $this->mgr->getQuestionNumber();
526 
527  echo " <dt><label for='question_{$qPk}'>";
528 
529  if (!$question->skipNumbering)
530  {
531  echo "<b>{$num}.</b> ";
532  }
533 
534  echo "{$question->question->question}{$required}</label></dt>\n";
535 
536  echo " <dd>";
537 
538  $question->writeHTML();
539 
540  echo " <br/></dd>";
541  }

◆ writeScript()

QuestionnairePreview::writeScript ( )

Reimplemented from QuestionnaireForm.

Definition at line 544 of file questionnaire_form.inc.

545  {
546  return "";
547  }

Member Data Documentation

◆ $mgr

QuestionnairePreview::$mgr

Definition at line 504 of file questionnaire_form.inc.


The documentation for this class was generated from the following file: