Survey page renderer.  
 More...
◆ __construct()
      
        
          | ILIAS\Survey\Page\PageRenderer::__construct  | 
          ( | 
          \ilObjSurvey  | 
          $survey,  | 
        
        
           | 
           | 
          array  | 
          $page_data,  | 
        
        
           | 
           | 
          array  | 
          $working_data = [],  | 
        
        
           | 
           | 
          array  | 
          $errors = [],  | 
        
        
           | 
           | 
          int  | 
          $question_title_mode = 1  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ compressQuestion()
  
  
      
        
          | ILIAS\Survey\Page\PageRenderer::compressQuestion  | 
          ( | 
          ?array  | 
          $previous_page,  | 
         
        
           | 
           | 
          array  | 
          $page  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
Definition at line 156 of file class.PageRenderer.php.
Referenced by ILIAS\Survey\Page\PageRenderer\render().
  160         if (is_null($previous_page)) {
   164         if ($previous_page[
"type_tag"] === $page[
"type_tag"] &&
   165             $page[
"type_tag"] === 
"SurveySingleChoiceQuestion") {
   166             if (\SurveySingleChoiceQuestion::compressable($previous_page[
"question_id"], $page[
"question_id"])) {
  
 
 
◆ render()
      
        
          | ILIAS\Survey\Page\PageRenderer::render  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 57 of file class.PageRenderer.php.
References $data, ILIAS\$error, ILIAS\Survey\Page\PageRenderer\$page_data, ILIAS\Survey\Page\PageRenderer\$question_title_mode, ILIAS\Survey\Page\PageRenderer\compressQuestion(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().
   62         $stpl = new \ilTemplate(
"tpl.page.html", 
true, 
true, 
"components/ILIAS/Survey/Page");
    65         if (count($page) > 1 && $page[0][
"questionblock_show_blocktitle"]) {
    66             $stpl->setCurrentBlock(
"questionblock_title");
    67             $stpl->setVariable(
"TEXT_QUESTIONBLOCK_TITLE", $page[0][
"questionblock_title"]);
    68             $stpl->parseCurrentBlock();
    72         $compress_view = 
false;
    73         if (count($page) > 1) {
    74             $compress_view = $page[0][
"questionblock_compress_view"];
    76         $previous_page = null;
    78         foreach ($page as $k => 
$data) {
    79             $page[$k][
"compressed"] = 
false;
    80             $page[$k][
"compressed_first"] = 
false;
    82                 $page[$k][
"compressed"] = 
true;
    83                 if ($previous_key !== null && $page[$previous_key][
"compressed"] == 
false) {
    84                     $page[$previous_key][
"compressed_first"] = 
true;
    88             $previous_page = 
$data;
    92         foreach ($page as 
$data) {
    94             if ($data[
"heading"]) {
    95                 $stpl->setCurrentBlock(
"heading");
    96                 $stpl->setVariable(
"QUESTION_HEADING", $data[
"heading"]);
    97                 $stpl->parseCurrentBlock();
    99             $stpl->setCurrentBlock(
"survey_content");
   101             $question_gui = $this->survey->getQuestionGUI($data[
"type_tag"], $data[
"question_id"]);
   104             $question_gui->object->setObligatory($data[
"obligatory"]);
   107             $show_questiontext = ($data[
"questionblock_show_questiontext"]) ? 1 : 0;
   111             if (!$this->survey->getShowQuestionTitles() || $data[
"compressed_first"]) {
   114             $working_data = $this->working_data[$data[
"question_id"]] ?? null;
   115             $error = $this->errors[$data[
"question_id"]] ?? 
"";
   120             $question_output = $question_gui->getWorkingForm(
   125                 $this->survey->getSurveyId(),
   130             if ($data[
"compressed"]) {
   133                 $stpl->setVariable(
"CMPR_CLASS", 
"il-svy-qst-compressed");
   135             $stpl->setVariable(
"QUESTION_OUTPUT", $question_output);
   138             $this->
ctrl->setParameter($this, 
"qid", $data[
"question_id"]);
   140             if ($data[
"obligatory"]) {
   143             $stpl->parseCurrentBlock();
   148             $stpl->setCurrentBlock(
"required");
   149             $stpl->setVariable(
"TEXT_REQUIRED", $this->
lng->txt(
"required_field"));
   150             $stpl->parseCurrentBlock();
 
 
 
 
◆ $ctrl
  
  
      
        
          | ilCtrl ILIAS\Survey\Page\PageRenderer::$ctrl | 
         
       
   | 
  
protected   | 
  
 
 
◆ $errors
  
  
      
        
          | array ILIAS\Survey\Page\PageRenderer::$errors = [] | 
         
       
   | 
  
protected   | 
  
 
 
◆ $lng
◆ $page_data
  
  
      
        
          | array ILIAS\Survey\Page\PageRenderer::$page_data | 
         
       
   | 
  
protected   | 
  
 
 
◆ $question_title_mode
  
  
      
        
          | int ILIAS\Survey\Page\PageRenderer::$question_title_mode | 
         
       
   | 
  
protected   | 
  
 
 
◆ $survey
◆ $working_data
  
  
      
        
          | array ILIAS\Survey\Page\PageRenderer::$working_data = [] | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: