ILIAS  release_8 Revision v8.23
ILIAS\Survey\PrintView\PagePrintViewProviderGUI Class Reference
+ Inheritance diagram for ILIAS\Survey\PrintView\PagePrintViewProviderGUI:
+ Collaboration diagram for ILIAS\Survey\PrintView\PagePrintViewProviderGUI:

Public Member Functions

 __construct (\ilLanguage $lng, \ilCtrl $ctrl, int $ref_id)
 
 getTemplateInjectors ()
 
 getSelectionForm ()
 form which is featured in the modal form target is modified to open in new window (not yet possible with ks forms) the print/pdf message is added automatically More...
 
 getPages ()
 
- Public Member Functions inherited from ILIAS\Export\AbstractPrintViewProvider
 setOffline (bool $offline)
 Set output mode. More...
 
 getOnSubmitCode ()
 
 autoPageBreak ()
 
 getSelectionForm ()
 
 getPages ()
 
 getTemplateInjectors ()
 

Protected Attributes

ILIAS Survey Editing EditingGUIRequest $request
 
ilObjSurvey $survey
 
int $ref_id
 
ilLanguage $lng
 
ilCtrl $ctrl
 
- Protected Attributes inherited from ILIAS\Export\AbstractPrintViewProvider
 $offline = false
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Export\AbstractPrintViewProvider
const PRINT = "print"
 
const OFFLINE = "offline"
 
- Protected Member Functions inherited from ILIAS\Export\AbstractPrintViewProvider
 getOutputMode ()
 Get output mode. More...
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file class.PagePrintViewProviderGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\PrintView\PagePrintViewProviderGUI::__construct ( \ilLanguage  $lng,
\ilCtrl  $ctrl,
int  $ref_id 
)

Definition at line 36 of file class.PagePrintViewProviderGUI.php.

References ILIAS\Survey\PrintView\PagePrintViewProviderGUI\$ctrl, $DIC, ILIAS\Survey\PrintView\PagePrintViewProviderGUI\$lng, ILIAS\Survey\PrintView\PagePrintViewProviderGUI\$ref_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

40  {
41  global $DIC;
42 
43  $this->request = $DIC->survey()
44  ->internal()
45  ->gui()
46  ->editing()
47  ->request();
48 
49  $this->lng = $lng;
50  $this->ctrl = $ctrl;
51  $this->ref_id = $ref_id;
52  $this->survey = new \ilObjSurvey($this->ref_id);
53  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getPages()

ILIAS\Survey\PrintView\PagePrintViewProviderGUI::getPages ( )
Returns
string[]

Implements ILIAS\Export\PrintViewProvider.

Definition at line 100 of file class.PagePrintViewProviderGUI.php.

100  : array
101  {
102  $print_pages = [];
103 
104 
105  $pages = $this->survey->getSurveyPages();
106  if ($this->request->getPrintSelection() === "page") {
107  $pg = $this->request->getPage();
108  if ($pg === 0) {
109  $pg = 1;
110  }
111  $pages = [$pages[$pg - 1]];
112  }
113 
114  $question_title_mode = $this->request->getIncludeLables()
115  ? 3
116  : 1;
117 
118  foreach ($pages as $page) {
119  $page_renderer = new PageRenderer(
120  $this->survey,
121  $page,
122  [],
123  [],
124  $question_title_mode
125  );
126  $print_pages[] = $page_renderer->render();
127  }
128  return $print_pages;
129  }

◆ getSelectionForm()

ILIAS\Survey\PrintView\PagePrintViewProviderGUI::getSelectionForm ( )

form which is featured in the modal form target is modified to open in new window (not yet possible with ks forms) the print/pdf message is added automatically

Returns
ilPropertyFormGUI|null

Implements ILIAS\Export\PrintViewProvider.

Definition at line 64 of file class.PagePrintViewProviderGUI.php.

References ILIAS\Survey\PrintView\PagePrintViewProviderGUI\$ctrl, and ILIAS\Survey\PrintView\PagePrintViewProviderGUI\$lng.

65  {
66  $lng = $this->lng;
67  $ilCtrl = $this->ctrl;
68 
69  $form = new \ilPropertyFormGUI();
70 
71  $radg = new \ilRadioGroupInputGUI($lng->txt("svy_selection"), "print_selection");
72  $radg->setValue("page");
73  $op1 = new \ilRadioOption($lng->txt("svy_current_page"), "page");
74  $radg->addOption($op1);
75  $op2 = new \ilRadioOption($lng->txt("svy_all_pages"), "all");
76  $radg->addOption($op2);
77 
78  $form->addItem($radg);
79 
80  // include labels in print view
81  if ($this->survey->getShowQuestionTitles()) {
82  $cb = new \ilCheckboxInputGUI($lng->txt("svy_print_show_labels"), "include_labels");
83  $form->addItem($cb);
84  }
85 
86  $form->addCommandButton("printView", $lng->txt("print_view"));
87 
88  $form->setTitle($lng->txt("svy_print_selection"));
89  $ilCtrl->setParameterByClass("ilSurveyEditorGUI", "pg", $this->request->getPage());
90  $form->setFormAction(
91  $ilCtrl->getFormActionByClass(
92  "ilSurveyEditorGUI",
93  "printView"
94  )
95  );
96 
97  return $form;
98  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

◆ getTemplateInjectors()

ILIAS\Survey\PrintView\PagePrintViewProviderGUI::getTemplateInjectors ( )
Returns
callable[] each callable gets the $tpl passed to inject css/js/...

Implements ILIAS\Export\PrintViewProvider.

Definition at line 55 of file class.PagePrintViewProviderGUI.php.

References $tpl.

55  : array
56  {
57  return [
58  static function (\ilGlobalTemplate $tpl): void {
59  //$tpl add js/css
60  }
61  ];
62  }
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

Field Documentation

◆ $ctrl

ilCtrl ILIAS\Survey\PrintView\PagePrintViewProviderGUI::$ctrl
protected

◆ $lng

ilLanguage ILIAS\Survey\PrintView\PagePrintViewProviderGUI::$lng
protected

◆ $ref_id

int ILIAS\Survey\PrintView\PagePrintViewProviderGUI::$ref_id
protected

◆ $request

ILIAS Survey Editing EditingGUIRequest ILIAS\Survey\PrintView\PagePrintViewProviderGUI::$request
protected

Definition at line 30 of file class.PagePrintViewProviderGUI.php.

◆ $survey

ilObjSurvey ILIAS\Survey\PrintView\PagePrintViewProviderGUI::$survey
protected

Definition at line 31 of file class.PagePrintViewProviderGUI.php.


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