ILIAS  release_8 Revision v8.23
ilWkhtmlToPdfConfigFormGUI Class Reference
+ Collaboration diagram for ilWkhtmlToPdfConfigFormGUI:

Public Member Functions

 __construct ()
 
 addConfigForm (ilPropertyFormGUI $form)
 
 validateForm (ilPropertyFormGUI $form)
 
 getConfigFromForm (ilPropertyFormGUI $form)
 
 populateForm (ilPropertyFormGUI $form, ilWkhtmlToPdfConfig $config)
 

Protected Member Functions

 translate (string $txt)
 
 appendOutputOptionsForm (ilPropertyFormGUI $form)
 
 buildExternalLinksForm ()
 
 buildEnableFormsForm ()
 
 buildLowQualityForm ()
 
 buildGreyScaleForm ()
 
 buildPrintMediaTypeForm ()
 
 buildJavascriptDelayForm ()
 
 buildCheckboxSvgForm ()
 
 buildCheckedCheckboxSvgForm ()
 
 buildRadiobuttonSvgForm ()
 
 buildCheckedRadiobuttonSvgForm ()
 
 buildOverwriteDefaultFont ()
 
 appendPageSettingsForm (ilPropertyFormGUI $form)
 
 buildZoomForm ()
 
 buildOrientationsForm ()
 
 buildPageSizesForm ()
 
 buildMarginLeftForm ()
 
 buildMarginRightForm ()
 
 buildMarginTopForm ()
 
 buildMarginBottomForm ()
 
 buildHeaderForm ()
 
 buildHeaderTextForm ()
 
 buildHeaderHtmlForm ()
 
 buildFooterForm ()
 
 buildFooterTextForm ()
 
 buildFooterHtmlForm ()
 
 saveNewDefaultBinaryPath (string $path)
 

Private Attributes

ilLanguage $lng
 
ilGlobalTemplateInterface $main_tpl
 
ilPDFGenerationRequest $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWkhtmlToPdfConfigFormGUI::__construct ( )

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

References $DIC, and ILIAS\Repository\lng().

31  {
32  global $DIC;
33  $this->main_tpl = $DIC->ui()->mainTemplate();
34  $this->lng = $DIC->language();
35  $this->request = new ilPDFGenerationRequest($DIC->refinery(), $DIC->http());
36  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ addConfigForm()

ilWkhtmlToPdfConfigFormGUI::addConfigForm ( ilPropertyFormGUI  $form)

Definition at line 38 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References $path, ilPropertyFormGUI\addItem(), appendOutputOptionsForm(), appendPageSettingsForm(), and translate().

38  : void
39  {
40  $path = new ilTextInputGUI($this->translate('path'), 'path');
41  $form->addItem($path);
42 
43  $this->appendOutputOptionsForm($form);
44  $this->appendPageSettingsForm($form);
45  }
$path
Definition: ltiservices.php:32
appendOutputOptionsForm(ilPropertyFormGUI $form)
+ Here is the call graph for this function:

◆ appendOutputOptionsForm()

ilWkhtmlToPdfConfigFormGUI::appendOutputOptionsForm ( ilPropertyFormGUI  $form)
protected

Definition at line 52 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPropertyFormGUI\addItem(), buildCheckboxSvgForm(), buildCheckedCheckboxSvgForm(), buildCheckedRadiobuttonSvgForm(), buildEnableFormsForm(), buildExternalLinksForm(), buildGreyScaleForm(), buildJavascriptDelayForm(), buildLowQualityForm(), buildOverwriteDefaultFont(), buildPrintMediaTypeForm(), buildRadiobuttonSvgForm(), and translate().

Referenced by addConfigForm().

52  : void
53  {
54  $section_header = new ilFormSectionHeaderGUI();
55  $section_header->setTitle($this->translate('output_options'));
56  $form->addItem($section_header);
57 
58  $form->addItem($this->buildExternalLinksForm());
59  $form->addItem($this->buildEnableFormsForm());
60  $form->addItem($this->buildLowQualityForm());
61  $form->addItem($this->buildGreyScaleForm());
62  $form->addItem($this->buildPrintMediaTypeForm());
63  $form->addItem($this->buildJavascriptDelayForm());
64  $form->addItem($this->buildCheckboxSvgForm());
65  $form->addItem($this->buildCheckedCheckboxSvgForm());
66  $form->addItem($this->buildRadiobuttonSvgForm());
67  $form->addItem($this->buildCheckedRadiobuttonSvgForm());
68  $form->addItem($this->buildOverwriteDefaultFont());
69  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendPageSettingsForm()

ilWkhtmlToPdfConfigFormGUI::appendPageSettingsForm ( ilPropertyFormGUI  $form)
protected

Definition at line 140 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPropertyFormGUI\addItem(), buildFooterForm(), buildHeaderForm(), buildMarginBottomForm(), buildMarginLeftForm(), buildMarginRightForm(), buildMarginTopForm(), buildOrientationsForm(), buildPageSizesForm(), buildZoomForm(), and translate().

Referenced by addConfigForm().

140  : void
141  {
142  $section_header = new ilFormSectionHeaderGUI();
143  $section_header->setTitle($this->translate('page_settings'));
144  $form->addItem($section_header);
145  $form->addItem($this->buildZoomForm());
146  $form->addItem($this->buildOrientationsForm());
147  $form->addItem($this->buildPageSizesForm());
148  $form->addItem($this->buildMarginLeftForm());
149  $form->addItem($this->buildMarginRightForm());
150  $form->addItem($this->buildMarginTopForm());
151  $form->addItem($this->buildMarginBottomForm());
152  $form->addItem($this->buildHeaderForm());
153  $form->addItem($this->buildFooterForm());
154  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCheckboxSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildCheckboxSvgForm ( )
protected

Definition at line 113 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

114  {
115  return new ilTextInputGUI($this->translate('checkbox_svg'), 'checkbox_svg');
116  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCheckedCheckboxSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildCheckedCheckboxSvgForm ( )
protected

Definition at line 118 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

119  {
120  return new ilTextInputGUI($this->translate('checkbox_checked_svg'), 'checkbox_checked_svg');
121  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCheckedRadiobuttonSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildCheckedRadiobuttonSvgForm ( )
protected

Definition at line 128 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

129  {
130  return new ilTextInputGUI($this->translate('radio_button_checked_svg'), 'radio_button_checked_svg');
131  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEnableFormsForm()

ilWkhtmlToPdfConfigFormGUI::buildEnableFormsForm ( )
protected

Definition at line 78 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

79  {
80  $enable_forms = new ilCheckboxInputGUI($this->translate('enable_forms'), 'enable_forms');
81  $enable_forms->setInfo($this->translate('enable_forms_info'));
82  return $enable_forms;
83  }
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildExternalLinksForm()

ilWkhtmlToPdfConfigFormGUI::buildExternalLinksForm ( )
protected

Definition at line 71 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

72  {
73  $external_links = new ilCheckboxInputGUI($this->translate('external_links'), 'external_links');
74  $external_links->setInfo($this->translate('external_links_info'));
75  return $external_links;
76  }
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooterForm()

ilWkhtmlToPdfConfigFormGUI::buildFooterForm ( )
protected

Definition at line 262 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References buildFooterHtmlForm(), buildFooterTextForm(), ilPDFGenerationConstants\FOOTER_NONE, and translate().

Referenced by appendPageSettingsForm().

263  {
264  $footer_select = new ilRadioGroupInputGUI($this->translate('footer_type'), 'footer_select');
265  $footer_select->addOption(new ilRadioOption(
266  $this->translate("none"),
268  ''
269  ));
270  $footer_select->addOption($this->buildFooterTextForm());
271  $footer_select->addOption($this->buildFooterHtmlForm());
272 
273  return $footer_select;
274  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooterHtmlForm()

ilWkhtmlToPdfConfigFormGUI::buildFooterHtmlForm ( )
protected

Definition at line 302 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\FOOTER_HTML, and translate().

Referenced by buildFooterForm().

302  : ilRadioOption
303  {
304  $footer_html_option = new ilRadioOption(
305  $this->translate('html'),
307  ''
308  );
309 
310  $footer_html = new ilTextInputGUI($this->translate('footer_html'), 'footer_html');
311  $footer_html_option->addSubItem($footer_html);
312 
313  $footer_html_spacing = new ilTextInputGUI($this->translate('spacing'), 'footer_html_spacing');
314  $footer_html_option->addSubItem($footer_html_spacing);
315 
316  $footer_html_line = new ilCheckboxInputGUI($this->translate('footer_line'), 'footer_html_line');
317  $footer_html_option->addSubItem($footer_html_line);
318  return $footer_html_option;
319  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooterTextForm()

ilWkhtmlToPdfConfigFormGUI::buildFooterTextForm ( )
protected

Definition at line 276 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\FOOTER_TEXT, and translate().

Referenced by buildFooterForm().

276  : ilRadioOption
277  {
278  $footer_text_option = new ilRadioOption(
279  $this->translate('text'),
281  ''
282  );
283 
284  $footer_text_left = new ilTextInputGUI($this->translate('footer_text_left'), 'footer_text_left');
285  $footer_text_option->addSubItem($footer_text_left);
286 
287  $footer_text_center = new ilTextInputGUI($this->translate('footer_text_center'), 'footer_text_center');
288  $footer_text_option->addSubItem($footer_text_center);
289 
290  $footer_text_right = new ilTextInputGUI($this->translate('footer_text_right'), 'footer_text_right');
291  $footer_text_option->addSubItem($footer_text_right);
292 
293  $footer_text_spacing = new ilTextInputGUI($this->translate('spacing'), 'footer_text_spacing');
294  $footer_text_option->addSubItem($footer_text_spacing);
295 
296  $footer_text_line = new ilCheckboxInputGUI($this->translate('footer_line'), 'footer_text_line');
297 
298  $footer_text_option->addSubItem($footer_text_line);
299  return $footer_text_option;
300  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildGreyScaleForm()

ilWkhtmlToPdfConfigFormGUI::buildGreyScaleForm ( )
protected

Definition at line 92 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

93  {
94  $grey_scale = new ilCheckboxInputGUI($this->translate('greyscale'), 'greyscale');
95  $grey_scale->setInfo($this->translate('greyscale_info'));
96  return $grey_scale;
97  }
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeaderForm()

ilWkhtmlToPdfConfigFormGUI::buildHeaderForm ( )
protected

Definition at line 203 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References buildHeaderHtmlForm(), buildHeaderTextForm(), ilPDFGenerationConstants\HEADER_NONE, and translate().

Referenced by appendPageSettingsForm().

204  {
205  $header_select = new ilRadioGroupInputGUI($this->translate('header_type'), 'header_select');
206  $header_select->addOption(new ilRadioOption(
207  $this->translate('none'),
209  ''
210  ));
211  $header_select->addOption($this->buildHeaderTextForm());
212  $header_select->addOption($this->buildHeaderHtmlForm());
213 
214  return $header_select;
215  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeaderHtmlForm()

ilWkhtmlToPdfConfigFormGUI::buildHeaderHtmlForm ( )
protected

Definition at line 243 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\HEADER_HTML, and translate().

Referenced by buildHeaderForm().

243  : ilRadioOption
244  {
245  $header_html_option = new ilRadioOption(
246  $this->translate("html"),
248  ''
249  );
250 
251  $header_html = new ilTextInputGUI($this->translate('html'), 'head_html');
252  $header_html_option->addSubItem($header_html);
253 
254  $head_html_spacing = new ilTextInputGUI($this->translate('spacing'), 'head_html_spacing');
255  $header_html_option->addSubItem($head_html_spacing);
256 
257  $head_html_line = new ilCheckboxInputGUI($this->translate('header_line'), 'head_html_line');
258  $header_html_option->addSubItem($head_html_line);
259  return $header_html_option;
260  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeaderTextForm()

ilWkhtmlToPdfConfigFormGUI::buildHeaderTextForm ( )
protected

Definition at line 217 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\HEADER_TEXT, and translate().

Referenced by buildHeaderForm().

217  : ilRadioOption
218  {
219  $header_text_option = new ilRadioOption(
220  $this->translate('text'),
222  ''
223  );
224 
225  $header_text_left = new ilTextInputGUI($this->translate('header_text_left'), 'head_text_left');
226  $header_text_option->addSubItem($header_text_left);
227 
228  $header_text_center = new ilTextInputGUI($this->translate('header_text_center'), 'head_text_center');
229  $header_text_option->addSubItem($header_text_center);
230 
231  $header_text_right = new ilTextInputGUI($this->translate('header_text_right'), 'head_text_right');
232  $header_text_option->addSubItem($header_text_right);
233 
234  $head_text_spacing = new ilTextInputGUI($this->translate('spacing'), 'head_text_spacing');
235  $header_text_option->addSubItem($head_text_spacing);
236 
237  $head_text_line = new ilCheckboxInputGUI($this->translate('header_line'), 'head_text_line');
238 
239  $header_text_option->addSubItem($head_text_line);
240  return $header_text_option;
241  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildJavascriptDelayForm()

ilWkhtmlToPdfConfigFormGUI::buildJavascriptDelayForm ( )
protected

Definition at line 106 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

107  {
108  $javascript_delay = new ilTextInputGUI($this->translate('javascript_delay'), 'javascript_delay');
109  $javascript_delay->setInfo($this->translate('javascript_delay_info'));
110  return $javascript_delay;
111  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildLowQualityForm()

ilWkhtmlToPdfConfigFormGUI::buildLowQualityForm ( )
protected

Definition at line 85 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

86  {
87  $low_quality = new ilCheckboxInputGUI($this->translate('low_quality'), 'low_quality');
88  $low_quality->setInfo($this->translate('low_quality_info'));
89  return $low_quality;
90  }
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginBottomForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginBottomForm ( )
protected

Definition at line 196 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendPageSettingsForm().

197  {
198  $margin_bottom = new ilTextInputGUI($this->translate('margin_bottom'), 'margin_bottom');
199  $margin_bottom->setInfo($this->translate('margin_info'));
200  return $margin_bottom;
201  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginLeftForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginLeftForm ( )
protected

Definition at line 175 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendPageSettingsForm().

176  {
177  $margin_left = new ilTextInputGUI($this->translate('margin_left'), 'margin_left');
178  $margin_left->setInfo($this->translate('margin_info'));
179  return $margin_left;
180  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginRightForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginRightForm ( )
protected

Definition at line 182 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendPageSettingsForm().

183  {
184  $margin_right = new ilTextInputGUI($this->translate('margin_right'), 'margin_right');
185  $margin_right->setInfo($this->translate('margin_info'));
186  return $margin_right;
187  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginTopForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginTopForm ( )
protected

Definition at line 189 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendPageSettingsForm().

190  {
191  $margin_top = new ilTextInputGUI($this->translate('margin_top'), 'margin_top');
192  $margin_top->setInfo($this->translate('margin_info'));
193  return $margin_top;
194  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOrientationsForm()

ilWkhtmlToPdfConfigFormGUI::buildOrientationsForm ( )
protected

Definition at line 161 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\getOrientations(), and translate().

Referenced by appendPageSettingsForm().

162  {
163  $orientation = new ilSelectInputGUI($this->translate('orientation'), 'orientation');
164  $orientation->setOptions(ilPDFGenerationConstants::getOrientations());
165  return $orientation;
166  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOverwriteDefaultFont()

ilWkhtmlToPdfConfigFormGUI::buildOverwriteDefaultFont ( )
protected

Definition at line 133 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\getFontStyles(), and translate().

Referenced by appendOutputOptionsForm().

134  {
135  $overwrite_font = new ilSelectInputGUI($this->translate('overwrite_font'), 'overwrite_font');
136  $overwrite_font->setOptions(ilPDFGenerationConstants::getFontStyles());
137  return $overwrite_font;
138  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPageSizesForm()

ilWkhtmlToPdfConfigFormGUI::buildPageSizesForm ( )
protected

Definition at line 168 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPDFGenerationConstants\getPageSizesNames(), and translate().

Referenced by appendPageSettingsForm().

169  {
170  $page_size = new ilSelectInputGUI($this->translate('page_size'), 'page_size');
171  $page_size->setOptions(ilPDFGenerationConstants::getPageSizesNames());
172  return $page_size;
173  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPrintMediaTypeForm()

ilWkhtmlToPdfConfigFormGUI::buildPrintMediaTypeForm ( )
protected

Definition at line 99 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

100  {
101  $print_media = new ilCheckboxInputGUI($this->translate('print_media_type'), 'print_media_type');
102  $print_media->setInfo($this->translate('print_media_info'));
103  return $print_media;
104  }
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildRadiobuttonSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildRadiobuttonSvgForm ( )
protected

Definition at line 123 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendOutputOptionsForm().

124  {
125  return new ilTextInputGUI($this->translate('radio_button_svg'), 'radio_button_svg');
126  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildZoomForm()

ilWkhtmlToPdfConfigFormGUI::buildZoomForm ( )
protected

Definition at line 156 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References translate().

Referenced by appendPageSettingsForm().

157  {
158  return new ilTextInputGUI($this->translate('zoom'), 'zoom');
159  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConfigFromForm()

ilWkhtmlToPdfConfigFormGUI::getConfigFromForm ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form
Returns
array<string, mixed>

Definition at line 453 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilPropertyFormGUI\getInput().

453  : array
454  {
455  return [
456  'path' => $form->getInput('path'),
457  'zoom' => $form->getInput('zoom'),
458  'external_links' => (bool) $form->getInput('external_links'),
459  'enable_forms' => (bool) $form->getInput('enable_forms'),
460  'low_quality' => (bool) $form->getInput('low_quality'),
461  'greyscale' => (bool) $form->getInput('greyscale'),
462  'orientation' => $form->getInput('orientation'),
463  'page_size' => $form->getInput('page_size'),
464  'margin_left' => $form->getInput('margin_left'),
465  'margin_right' => $form->getInput('margin_right'),
466  'margin_top' => $form->getInput('margin_top'),
467  'margin_bottom' => $form->getInput('margin_bottom'),
468  'print_media_type' => (bool) $form->getInput('print_media_type'),
469  'javascript_delay' => $form->getInput('javascript_delay'),
470  'checkbox_svg' => $form->getInput('checkbox_svg'),
471  'checkbox_checked_svg' => $form->getInput('checkbox_checked_svg'),
472  'radio_button_svg' => $form->getInput('radio_button_svg'),
473  'radio_button_checked_svg' => $form->getInput('radio_button_checked_svg'),
474  'header_select' => $form->getInput('header_select'),
475  'head_text_left' => $form->getInput('head_text_left'),
476  'head_text_center' => $form->getInput('head_text_center'),
477  'head_text_right' => $form->getInput('head_text_right'),
478  'head_text_spacing' => $form->getInput('head_text_spacing'),
479  'head_text_line' => $form->getInput('head_text_line'),
480  'head_html_line' => $form->getInput('head_html_line'),
481  'head_html_spacing' => $form->getInput('head_html_spacing'),
482  'head_html' => $form->getInput('head_html'),
483  'footer_select' => $form->getInput('footer_select'),
484  'footer_text_left' => $form->getInput('footer_text_left'),
485  'footer_text_right' => $form->getInput('footer_text_right'),
486  'footer_text_spacing' => $form->getInput('footer_text_spacing'),
487  'footer_text_center' => $form->getInput('footer_text_center'),
488  'footer_text_line' => $form->getInput('footer_text_line'),
489  'footer_html' => $form->getInput('footer_html'),
490  'footer_html_spacing' => $form->getInput('footer_html_spacing'),
491  'overwrite_font' => $form->getInput('overwrite_font')
492  ];
493  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

◆ populateForm()

ilWkhtmlToPdfConfigFormGUI::populateForm ( ilPropertyFormGUI  $form,
ilWkhtmlToPdfConfig  $config 
)

Definition at line 495 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ilWkhtmlToPdfConfig\getCheckboxCheckedSvg(), ilWkhtmlToPdfConfig\getCheckboxSvg(), ilWkhtmlToPdfConfig\getEnabledForms(), ilWkhtmlToPdfConfig\getExternalLinks(), ilWkhtmlToPdfConfig\getFooterHtml(), ilWkhtmlToPdfConfig\getFooterHtmlSpacing(), ilWkhtmlToPdfConfig\getFooterTextCenter(), ilWkhtmlToPdfConfig\getFooterTextLeft(), ilWkhtmlToPdfConfig\getFooterTextRight(), ilWkhtmlToPdfConfig\getFooterTextSpacing(), ilWkhtmlToPdfConfig\getFooterType(), ilWkhtmlToPdfConfig\getGreyscale(), ilWkhtmlToPdfConfig\getHeaderHtml(), ilWkhtmlToPdfConfig\getHeaderHtmlSpacing(), ilWkhtmlToPdfConfig\getHeaderTextCenter(), ilWkhtmlToPdfConfig\getHeaderTextLeft(), ilWkhtmlToPdfConfig\getHeaderTextRight(), ilWkhtmlToPdfConfig\getHeaderTextSpacing(), ilWkhtmlToPdfConfig\getHeaderType(), ilPropertyFormGUI\getItemByPostVar(), ilWkhtmlToPdfConfig\getJavascriptDelay(), ilWkhtmlToPdfConfig\getLowQuality(), ilWkhtmlToPdfConfig\getMarginBottom(), ilWkhtmlToPdfConfig\getMarginLeft(), ilWkhtmlToPdfConfig\getMarginRight(), ilWkhtmlToPdfConfig\getMarginTop(), ilWkhtmlToPdfConfig\getOrientation(), ilWkhtmlToPdfConfig\getOverwriteDefaultFont(), ilWkhtmlToPdfConfig\getPageSize(), ilWkhtmlToPdfConfig\getPrintMediaType(), ilWkhtmlToPdfConfig\getRadioButtonCheckedSvg(), ilWkhtmlToPdfConfig\getRadioButtonSvg(), ilWkhtmlToPdfConfig\getWKHTMLToPdfDefaultPath(), ilWkhtmlToPdfConfig\getZoom(), ilWkhtmlToPdfConfig\isFooterHtmlLine(), ilWkhtmlToPdfConfig\isFooterTextLine(), ilWkhtmlToPdfConfig\isHeaderHtmlLine(), and ilWkhtmlToPdfConfig\isHeaderTextLine().

495  : void
496  {
497  $form->getItemByPostVar('path')->setValue($config->getWKHTMLToPdfDefaultPath());
498  $form->getItemByPostVar('zoom')->setValue($config->getZoom());
499  $form->getItemByPostVar('external_links')->setChecked((bool) $config->getExternalLinks());
500  $form->getItemByPostVar('enable_forms')->setChecked((bool) $config->getEnabledForms());
501  $form->getItemByPostVar('low_quality')->setChecked((bool) $config->getLowQuality());
502  $form->getItemByPostVar('greyscale')->setChecked((bool) $config->getGreyscale());
503  $form->getItemByPostVar('orientation')->setValue($config->getOrientation());
504  $form->getItemByPostVar('page_size')->setValue($config->getPageSize());
505  $form->getItemByPostVar('margin_left')->setValue($config->getMarginLeft());
506  $form->getItemByPostVar('margin_right')->setValue($config->getMarginRight());
507  $form->getItemByPostVar('margin_top')->setValue($config->getMarginTop());
508  $form->getItemByPostVar('margin_bottom')->setValue($config->getMarginBottom());
509  $form->getItemByPostVar('print_media_type')->setChecked((bool) $config->getPrintMediaType());
510  $form->getItemByPostVar('javascript_delay')->setValue($config->getJavascriptDelay());
511  $form->getItemByPostVar('checkbox_svg')->setValue($config->getCheckboxSvg());
512  $form->getItemByPostVar('checkbox_checked_svg')->setValue($config->getCheckboxCheckedSvg());
513  $form->getItemByPostVar('radio_button_svg')->setValue($config->getRadioButtonSvg());
514  $form->getItemByPostVar('radio_button_checked_svg')->setValue($config->getRadioButtonCheckedSvg());
515  $form->getItemByPostVar('header_select')->setValue((string) $config->getHeaderType());
516  $form->getItemByPostVar('head_text_left')->setValue($config->getHeaderTextLeft());
517  $form->getItemByPostVar('head_text_center')->setValue($config->getHeaderTextCenter());
518  $form->getItemByPostVar('head_text_right')->setValue($config->getHeaderTextRight());
519  $form->getItemByPostVar('head_text_spacing')->setValue($config->getHeaderTextSpacing());
520 
521  $form->getItemByPostVar('head_text_line')->setChecked((bool) $config->isHeaderTextLine());
522  $form->getItemByPostVar('head_html_line')->setChecked((bool) $config->isHeaderHtmlLine());
523  $form->getItemByPostVar('head_html_spacing')->setValue($config->getHeaderHtmlSpacing());
524  $form->getItemByPostVar('head_html')->setValue($config->getHeaderHtml());
525  $form->getItemByPostVar('footer_select')->setValue((string) $config->getFooterType());
526  $form->getItemByPostVar('footer_text_left')->setValue($config->getFooterTextLeft());
527  $form->getItemByPostVar('footer_text_center')->setValue($config->getFooterTextCenter());
528  $form->getItemByPostVar('footer_text_right')->setValue($config->getFooterTextRight());
529  $form->getItemByPostVar('footer_text_spacing')->setValue($config->getFooterTextSpacing());
530  $form->getItemByPostVar('footer_text_line')->setChecked((bool) $config->isFooterTextLine());
531  $form->getItemByPostVar('footer_html_line')->setChecked((bool) $config->isFooterHtmlLine());
532  $form->getItemByPostVar('footer_html')->setValue($config->getFooterHtml());
533  $form->getItemByPostVar('footer_html_spacing')->setValue($config->getFooterHtmlSpacing());
534  $form->getItemByPostVar('overwrite_font')->setValue($config->getOverwriteDefaultFont(false));
535 
536  }
getItemByPostVar(string $a_post_var)
getOverwriteDefaultFont(bool $renderStyle=false)
+ Here is the call graph for this function:

◆ saveNewDefaultBinaryPath()

ilWkhtmlToPdfConfigFormGUI::saveNewDefaultBinaryPath ( string  $path)
protected

Definition at line 443 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References ILIAS\LTI\ToolProvider\$settings.

Referenced by validateForm().

443  : void
444  {
445  $settings = new ilSetting('wkhtmltopdfrenderer');
446  $settings->set('path', $path);
447  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

◆ translate()

◆ validateForm()

ilWkhtmlToPdfConfigFormGUI::validateForm ( ilPropertyFormGUI  $form)

Definition at line 321 of file class.ilWkhtmlToPdfConfigFormGUI.php.

References $config, $path, ilShellUtil\escapeShellCmd(), ilPDFGenerationConstants\getFontStyles(), ilPropertyFormGUI\getItemByPostVar(), ilPDFGenerationConstants\getOrientations(), ilPDFGenerationConstants\getPageSizesNames(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and saveNewDefaultBinaryPath().

321  : bool
322  {
323  $everything_ok = true;
325  $path = realpath(ilShellUtil::escapeShellCmd($this->request->securedString('path')));
326  $orientation = $this->request->securedString('orientation');
327  $margin_left = $this->request->securedString('margin_left');
328  $margin_right = $this->request->securedString('margin_right');
329  $margin_top = $this->request->securedString('margin_top');
330  $margin_bottom = $this->request->securedString('margin_bottom');
331  $footer_text_spacing = (int) $this->request->securedString('footer_text_spacing');
332  $footer_html_spacing = (int) $this->request->securedString('footer_html_spacing');
333  $footer_html = $this->request->securedString('footer_html');
334  $head_text_spacing = (int) $this->request->securedString('head_text_spacing');
335  $head_html = $this->request->securedString('head_html');
336  $head_html_spacing = (int) $this->request->securedString('head_html_spacing');
337  $footer_text_left = $this->request->securedString('footer_text_left');
338  $footer_text_center = $this->request->securedString('footer_text_center');
339  $footer_text_right = $this->request->securedString('footer_text_right');
340  $header_text_left = $this->request->securedString('header_text_left');
341  $header_text_center = $this->request->securedString('header_text_center');
342  $header_text_right = $this->request->securedString('header_text_right');
343  $overwrite_font = strtolower($this->request->securedString('overwrite_font'));
344 
345  $sizes = [
346  $margin_left,
347  $margin_right,
348  $margin_top,
349  $margin_bottom,
350  $footer_text_spacing,
351  $footer_html_spacing,
352  $head_text_spacing,
353  $head_html_spacing
354  ];
355  $header_footer_texts = [
356  $footer_text_left,
357  $footer_text_center,
358  $footer_text_right,
359  $header_text_left,
360  $header_text_center,
361  $header_text_right,
362  $footer_html,
363  $head_html
364  ];
365  $page_size = $this->request->securedString('page_size');
366  $pre_check_valid = $this->request->validatePathOrUrl(['checkbox_svg',
367  'checkbox_checked_svg',
368  'radio_button_svg',
369  'radio_button_checked_svg'
370  ]);
371  if($pre_check_valid === false) {
372  $everything_ok = false;
373  }
374 
375  if ($path === false) {
376  $everything_ok = false;
377  $path = '';
378  }
379  $config->setPath($path);
380 
381  if (in_array($overwrite_font, ilPDFGenerationConstants::getFontStyles())) {
382  $config->setOverwriteDefaultFont($overwrite_font);
383  } else {
384  $everything_ok = false;
385  }
386 
387  if (mb_stripos($config->getPath(), 'wkhtmlto') === false) {
388  $form->getItemByPostVar('path')->setAlert(
389  $this->lng->txt("file_not_found")
390  );
391  $everything_ok = false;
392  } elseif (!in_array($page_size, ilPDFGenerationConstants::getPageSizesNames())) {
393  $everything_ok = false;
394  } elseif (!in_array($orientation, ilPDFGenerationConstants::getOrientations())) {
395  $everything_ok = false;
396  } elseif ($this->request->isNotValidSize($sizes)) {
397  $everything_ok = false;
398  } elseif ($this->request->isNotValidText($header_footer_texts)) {
399  $everything_ok = false;
400  } elseif ($everything_ok === true && $pre_check_valid) {
401  $config->setZoom($this->request->float('zoom'));
402  $config->setExternalLinks($this->request->bool('external_links'));
403  $config->setEnabledForms($this->request->bool('enable_forms'));
404  $config->setLowQuality($this->request->bool('low_quality'));
405  $config->setGreyscale($this->request->bool('greyscale'));
406  $config->setOrientation($orientation);
407  $config->setPageSize($page_size);
408  $config->setMarginLeft($margin_left);
409  $config->setMarginRight($margin_right);
410  $config->setMarginTop($margin_top);
411  $config->setMarginBottom($margin_bottom);
412  $config->setPrintMediaType($this->request->bool('print_media_type'));
413  $config->setJavascriptDelay($this->request->int('javascript_delay'));
414  $config->setCheckboxSvg($this->request->securedString('checkbox_svg'));
415  $config->setCheckboxCheckedSvg($this->request->securedString('checkbox_checked_svg'));
416  $config->setRadioButtonSvg($this->request->securedString('radio_button_svg'));
417  $config->setRadioButtonCheckedSvg($this->request->securedString('radio_button_checked_svg'));
418  $config->setHeaderType($this->request->int('header_select'));
419  $config->setHeaderTextLeft($this->request->securedString('head_text_left'));
420  $config->setHeaderTextCenter($this->request->securedString('head_text_center'));
421  $config->setHeaderTextRight($this->request->securedString('head_text_right'));
422  $config->setHeaderTextSpacing($head_text_spacing);
423  $config->setHeaderTextLine($this->request->bool('head_text_line'));
424  $config->setHeaderHtmlLine($this->request->bool('head_html_line'));
425  $config->setHeaderHtmlSpacing($head_html_spacing);
426  $config->setHeaderHtml($head_html);
427  $config->setFooterType($this->request->int('footer_select'));
428  $config->setFooterTextLeft($footer_text_left);
429  $config->setFooterTextCenter($footer_text_center);
430  $config->setFooterTextRight($footer_text_right);
431  $config->setFooterTextSpacing($footer_text_spacing);
432  $config->setFooterTextLine($this->request->bool('footer_text_line'));
433  $config->setFooterHtmlLine($this->request->bool('footer_html_line'));
434  $config->setFooterHtmlSpacing($footer_html_spacing);
435  $config->setFooterHtml($footer_html);
436  $config->setOverwriteDefaultFont($this->request->securedString('overwrite_font'));
437  $this->saveNewDefaultBinaryPath($config->getPath());
438  }
439 
440  return $everything_ok;
441  }
getItemByPostVar(string $a_post_var)
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
$path
Definition: ltiservices.php:32
static escapeShellCmd(string $a_arg)
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilWkhtmlToPdfConfigFormGUI::$lng
private

Definition at line 26 of file class.ilWkhtmlToPdfConfigFormGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilWkhtmlToPdfConfigFormGUI::$main_tpl
private

Definition at line 27 of file class.ilWkhtmlToPdfConfigFormGUI.php.

◆ $request

ilPDFGenerationRequest ilWkhtmlToPdfConfigFormGUI::$request
private

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


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