ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWkhtmlToPdfConfigFormGUI Class Reference
+ Collaboration diagram for ilWkhtmlToPdfConfigFormGUI:

Public Member Functions

 __construct ()
 ilWkhtmlToPdfConfigFormGUI constructor. More...
 
 addConfigForm ($form)
 
 validateForm ()
 
 getConfigFromForm (ilPropertyFormGUI $form)
 
 populateForm ($form, $config)
 

Protected Member Functions

 setLanguage ($lng)
 
 translate ($txt)
 
 appendOutputOptionsForm (ilPropertyFormGUI $form)
 
 buildExternalLinksForm ()
 
 buildEnableFormsForm ()
 
 buildUserStylesheetForm ()
 
 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 ($path)
 

Protected Attributes

 $lng
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilWkhtmlToPdfConfigFormGUI::__construct ( )

ilWkhtmlToPdfConfigFormGUI constructor.

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

14 {
15 global $DIC;
16 $this->setLanguage($DIC['lng']);
17 }
$DIC
Definition: xapitoken.php:46

References $DIC, and setLanguage().

+ Here is the call graph for this function:

Member Function Documentation

◆ addConfigForm()

ilWkhtmlToPdfConfigFormGUI::addConfigForm (   $form)
Parameters
ilPropertyFormGUI$form

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

31 {
32 $path = new ilTextInputGUI($this->translate('path'), 'path');
33 $form->addItem($path);
34
35 $this->appendOutputOptionsForm($form);
36 $this->appendPageSettingsForm($form);
37 }
This class represents a text property in a property form.
appendOutputOptionsForm(ilPropertyFormGUI $form)

References appendOutputOptionsForm(), appendPageSettingsForm(), and translate().

+ Here is the call graph for this function:

◆ appendOutputOptionsForm()

ilWkhtmlToPdfConfigFormGUI::appendOutputOptionsForm ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

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

52 {
53 $section_header = new ilFormSectionHeaderGUI();
54 $section_header->setTitle($this->translate('output_options'));
55 $form->addItem($section_header);
56
57 $form->addItem($this->buildExternalLinksForm());
58 $form->addItem($this->buildEnableFormsForm());
59 $form->addItem($this->buildUserStylesheetForm());
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());
68 $form->addItem($this->buildOverwriteDefaultFont());
69 }
This class represents a section header in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).

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

Referenced by addConfigForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendPageSettingsForm()

ilWkhtmlToPdfConfigFormGUI::appendPageSettingsForm ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

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

186 {
187 $section_header = new ilFormSectionHeaderGUI();
188 $section_header->setTitle($this->translate('page_settings'));
189 $form->addItem($section_header);
190
191 $form->addItem($this->buildZoomForm());
192 $form->addItem($this->buildOrientationsForm());
193 $form->addItem($this->buildPageSizesForm());
194 $form->addItem($this->buildMarginLeftForm());
195 $form->addItem($this->buildMarginRightForm());
196 $form->addItem($this->buildMarginTopForm());
197 $form->addItem($this->buildMarginBottomForm());
198 $form->addItem($this->buildHeaderForm());
199 $form->addItem($this->buildFooterForm());
200 }

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

Referenced by addConfigForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCheckboxSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildCheckboxSvgForm ( )
protected
Returns
ilTextInputGUI

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

144 {
145 return new ilTextInputGUI($this->translate('checkbox_svg'), 'checkbox_svg');
146 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCheckedCheckboxSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildCheckedCheckboxSvgForm ( )
protected
Returns
ilTextInputGUI

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

152 {
153 return new ilTextInputGUI($this->translate('checkbox_checked_svg'), 'checkbox_checked_svg');
154 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCheckedRadiobuttonSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildCheckedRadiobuttonSvgForm ( )
protected
Returns
ilTextInputGUI

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

168 {
169 return new ilTextInputGUI($this->translate('radio_button_checked_svg'), 'radio_button_checked_svg');
170 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEnableFormsForm()

ilWkhtmlToPdfConfigFormGUI::buildEnableFormsForm ( )
protected
Returns
ilCheckboxInputGUI

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

85 {
86 $enable_forms = new ilCheckboxInputGUI($this->translate('enable_forms'), 'enable_forms');
87 $enable_forms->setInfo($this->translate('enable_forms_info'));
88 return $enable_forms;
89 }
This class represents a checkbox property in a property form.

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildExternalLinksForm()

ilWkhtmlToPdfConfigFormGUI::buildExternalLinksForm ( )
protected
Returns
ilCheckboxInputGUI

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

75 {
76 $external_links = new ilCheckboxInputGUI($this->translate('external_links'), 'external_links');
77 $external_links->setInfo($this->translate('external_links_info'));
78 return $external_links;
79 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooterForm()

ilWkhtmlToPdfConfigFormGUI::buildFooterForm ( )
protected
Returns
ilRadioGroupInputGUI

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

330 {
331 $footer_select = new ilRadioGroupInputGUI($this->translate('footer_type'), 'footer_select');
332 $footer_select->addOption(new ilRadioOption($this->translate("none"), ilPDFGenerationConstants::FOOTER_NONE, ''));
333 $footer_select->addOption($this->buildFooterTextForm());
334 $footer_select->addOption($this->buildFooterHtmlForm());
335
336 return $footer_select;
337 }
This class represents a property in a property form.
This class represents an option in a radio group.

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

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooterHtmlForm()

ilWkhtmlToPdfConfigFormGUI::buildFooterHtmlForm ( )
protected
Returns
ilRadioOption

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

368 {
369 $footer_html_option = new ilRadioOption($this->translate('html'), ilPDFGenerationConstants::FOOTER_HTML, '');
370
371 $footer_html = new ilTextInputGUI($this->translate('footer_html'), 'footer_html');
372 $footer_html_option->addSubItem($footer_html);
373
374 $footer_html_spacing = new ilTextInputGUI($this->translate('spacing'), 'footer_html_spacing');
375 $footer_html_option->addSubItem($footer_html_spacing);
376
377 $footer_html_line = new ilCheckboxInputGUI($this->translate('footer_line'), 'footer_html_line');
378 $footer_html_option->addSubItem($footer_html_line);
379 return $footer_html_option;
380 }

References ilPDFGenerationConstants\FOOTER_HTML, and translate().

Referenced by buildFooterForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooterTextForm()

ilWkhtmlToPdfConfigFormGUI::buildFooterTextForm ( )
protected
Returns
ilRadioOption

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

343 {
344 $footer_text_option = new ilRadioOption($this->translate('text'), ilPDFGenerationConstants::FOOTER_TEXT, '');
345
346 $footer_text_left = new ilTextInputGUI($this->translate('footer_text_left'), 'footer_text_left');
347 $footer_text_option->addSubItem($footer_text_left);
348
349 $footer_text_center = new ilTextInputGUI($this->translate('footer_text_center'), 'footer_text_center');
350 $footer_text_option->addSubItem($footer_text_center);
351
352 $footer_text_right = new ilTextInputGUI($this->translate('footer_text_right'), 'footer_text_right');
353 $footer_text_option->addSubItem($footer_text_right);
354
355 $footer_text_spacing = new ilTextInputGUI($this->translate('spacing'), 'footer_text_spacing');
356 $footer_text_option->addSubItem($footer_text_spacing);
357
358 $footer_text_line = new ilCheckboxInputGUI($this->translate('footer_line'), 'footer_text_line');
359
360 $footer_text_option->addSubItem($footer_text_line);
361 return $footer_text_option;
362 }

References ilPDFGenerationConstants\FOOTER_TEXT, and translate().

Referenced by buildFooterForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildGreyScaleForm()

ilWkhtmlToPdfConfigFormGUI::buildGreyScaleForm ( )
protected
Returns
ilCheckboxInputGUI

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

114 {
115 $grey_scale = new ilCheckboxInputGUI($this->translate('greyscale'), 'greyscale');
116 $grey_scale->setInfo($this->translate('greyscale_info'));
117 return $grey_scale;
118 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeaderForm()

ilWkhtmlToPdfConfigFormGUI::buildHeaderForm ( )
protected
Returns
ilRadioGroupInputGUI

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

274 {
275 $header_select = new ilRadioGroupInputGUI($this->translate('header_type'), 'header_select');
276 $header_select->addOption(new ilRadioOption($this->translate('none'), ilPDFGenerationConstants::HEADER_NONE, ''));
277 $header_select->addOption($this->buildHeaderTextForm());
278 $header_select->addOption($this->buildHeaderHtmlForm());
279
280 return $header_select;
281 }

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

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeaderHtmlForm()

ilWkhtmlToPdfConfigFormGUI::buildHeaderHtmlForm ( )
protected
Returns
ilRadioOption

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

312 {
313 $header_html_option = new ilRadioOption($this->translate("html"), ilPDFGenerationConstants::HEADER_HTML, '');
314
315 $header_html = new ilTextInputGUI($this->translate('html'), 'head_html');
316 $header_html_option->addSubItem($header_html);
317
318 $head_html_spacing = new ilTextInputGUI($this->translate('spacing'), 'head_html_spacing');
319 $header_html_option->addSubItem($head_html_spacing);
320
321 $head_html_line = new ilCheckboxInputGUI($this->translate('header_line'), 'head_html_line');
322 $header_html_option->addSubItem($head_html_line);
323 return $header_html_option;
324 }

References ilPDFGenerationConstants\HEADER_HTML, and translate().

Referenced by buildHeaderForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeaderTextForm()

ilWkhtmlToPdfConfigFormGUI::buildHeaderTextForm ( )
protected
Returns
ilRadioOption

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

287 {
288 $header_text_option = new ilRadioOption($this->translate('text'), ilPDFGenerationConstants::HEADER_TEXT, '');
289
290 $header_text_left = new ilTextInputGUI($this->translate('header_text_left'), 'head_text_left');
291 $header_text_option->addSubItem($header_text_left);
292
293 $header_text_center = new ilTextInputGUI($this->translate('header_text_center'), 'head_text_center');
294 $header_text_option->addSubItem($header_text_center);
295
296 $header_text_right = new ilTextInputGUI($this->translate('header_text_right'), 'head_text_right');
297 $header_text_option->addSubItem($header_text_right);
298
299 $head_text_spacing = new ilTextInputGUI($this->translate('spacing'), 'head_text_spacing');
300 $header_text_option->addSubItem($head_text_spacing);
301
302 $head_text_line = new ilCheckboxInputGUI($this->translate('header_line'), 'head_text_line');
303
304 $header_text_option->addSubItem($head_text_line);
305 return $header_text_option;
306 }

References ilPDFGenerationConstants\HEADER_TEXT, and translate().

Referenced by buildHeaderForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildJavascriptDelayForm()

ilWkhtmlToPdfConfigFormGUI::buildJavascriptDelayForm ( )
protected
Returns
ilTextInputGUI

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

134 {
135 $javascript_delay = new ilTextInputGUI($this->translate('javascript_delay'), 'javascript_delay');
136 $javascript_delay->setInfo($this->translate('javascript_delay_info'));
137 return $javascript_delay;
138 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildLowQualityForm()

ilWkhtmlToPdfConfigFormGUI::buildLowQualityForm ( )
protected
Returns
ilCheckboxInputGUI

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

104 {
105 $low_quality = new ilCheckboxInputGUI($this->translate('low_quality'), 'low_quality');
106 $low_quality->setInfo($this->translate('low_quality_info'));
107 return $low_quality;
108 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginBottomForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginBottomForm ( )
protected
Returns
ilTextInputGUI

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

264 {
265 $margin_bottom = new ilTextInputGUI($this->translate('margin_bottom'), 'margin_bottom');
266 $margin_bottom->setInfo($this->translate('margin_info'));
267 return $margin_bottom;
268 }

References translate().

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginLeftForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginLeftForm ( )
protected
Returns
ilTextInputGUI

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

234 {
235 $margin_left = new ilTextInputGUI($this->translate('margin_left'), 'margin_left');
236 $margin_left->setInfo($this->translate('margin_info'));
237 return $margin_left;
238 }

References translate().

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginRightForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginRightForm ( )
protected
Returns
ilTextInputGUI

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

244 {
245 $margin_right = new ilTextInputGUI($this->translate('margin_right'), 'margin_right');
246 $margin_right->setInfo($this->translate('margin_info'));
247 return $margin_right;
248 }

References translate().

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMarginTopForm()

ilWkhtmlToPdfConfigFormGUI::buildMarginTopForm ( )
protected
Returns
ilTextInputGUI

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

254 {
255 $margin_top = new ilTextInputGUI($this->translate('margin_top'), 'margin_top');
256 $margin_top->setInfo($this->translate('margin_info'));
257 return $margin_top;
258 }

References translate().

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOrientationsForm()

ilWkhtmlToPdfConfigFormGUI::buildOrientationsForm ( )
protected
Returns
ilSelectInputGUI

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

214 {
215 $orientation = new ilSelectInputGUI($this->translate('orientation'), 'orientation');
216 $orientation->setOptions(ilPDFGenerationConstants::getOrientations());
217 return $orientation;
218 }
This class represents a selection list property in a property form.

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

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOverwriteDefaultFont()

ilWkhtmlToPdfConfigFormGUI::buildOverwriteDefaultFont ( )
protected
Returns
ilTextInputGUI

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

176 {
177 $overwrite_font = new ilTextInputGUI($this->translate('overwrite_font'), 'overwrite_font');
178 $overwrite_font->setInfo($this->translate('overwrite_font_info'));
179 return $overwrite_font;
180 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPageSizesForm()

ilWkhtmlToPdfConfigFormGUI::buildPageSizesForm ( )
protected
Returns
ilSelectInputGUI

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

224 {
225 $page_size = new ilSelectInputGUI($this->translate('page_size'), 'page_size');
226 $page_size->setOptions(ilPDFGenerationConstants::getPageSizesNames());
227 return $page_size;
228 }

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

Referenced by appendPageSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPrintMediaTypeForm()

ilWkhtmlToPdfConfigFormGUI::buildPrintMediaTypeForm ( )
protected
Returns
ilCheckboxInputGUI

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

124 {
125 $print_media = new ilCheckboxInputGUI($this->translate('print_media_type'), 'print_media_type');
126 $print_media->setInfo($this->translate('print_media_info'));
127 return $print_media;
128 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildRadiobuttonSvgForm()

ilWkhtmlToPdfConfigFormGUI::buildRadiobuttonSvgForm ( )
protected
Returns
ilTextInputGUI

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

160 {
161 return new ilTextInputGUI($this->translate('radio_button_svg'), 'radio_button_svg');
162 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildUserStylesheetForm()

ilWkhtmlToPdfConfigFormGUI::buildUserStylesheetForm ( )
protected
Returns
ilTextInputGUI

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

95 {
96 $user_stylesheet = new ilTextInputGUI($this->translate('user_stylesheet'), 'user_stylesheet');
97 return $user_stylesheet;
98 }

References translate().

Referenced by appendOutputOptionsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildZoomForm()

ilWkhtmlToPdfConfigFormGUI::buildZoomForm ( )
protected
Returns
ilTextInputGUI

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

206 {
207 return new ilTextInputGUI($this->translate('zoom'), 'zoom');
208 }

References translate().

Referenced by appendPageSettingsForm().

+ 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

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

451 {
452 return array(
453 'path' => $form->getItemByPostVar('path')->getValue(),
454 'zoom' => $form->getItemByPostVar('zoom')->getValue(),
455 'external_links' => $form->getItemByPostVar('external_links')->getChecked(),
456 'enable_forms' => $form->getItemByPostVar('enable_forms')->getChecked(),
457 'user_stylesheet' => $form->getItemByPostVar('user_stylesheet')->getValue(),
458 'low_quality' => $form->getItemByPostVar('low_quality')->getChecked(),
459 'greyscale' => $form->getItemByPostVar('greyscale')->getChecked(),
460 'orientation' => $form->getItemByPostVar('orientation')->getValue(),
461 'page_size' => $form->getItemByPostVar('page_size')->getValue(),
462 'margin_left' => $form->getItemByPostVar('margin_left')->getValue(),
463 'margin_right' => $form->getItemByPostVar('margin_right')->getValue(),
464 'margin_top' => $form->getItemByPostVar('margin_top')->getValue(),
465 'margin_bottom' => $form->getItemByPostVar('margin_bottom')->getValue(),
466 'print_media_type' => $form->getItemByPostVar('print_media_type')->getChecked(),
467 'javascript_delay' => $form->getItemByPostVar('javascript_delay')->getValue(),
468 'checkbox_svg' => $form->getItemByPostVar('checkbox_svg')->getValue(),
469 'checkbox_checked_svg' => $form->getItemByPostVar('checkbox_checked_svg')->getValue(),
470 'radio_button_svg' => $form->getItemByPostVar('radio_button_svg')->getValue(),
471 'radio_button_checked_svg' => $form->getItemByPostVar('radio_button_checked_svg')->getValue(),
472 'header_select' => $form->getItemByPostVar('header_select')->getValue(),
473 'head_text_left' => $form->getItemByPostVar('head_text_left')->getValue(),
474 'head_text_center' => $form->getItemByPostVar('head_text_center')->getValue(),
475 'head_text_right' => $form->getItemByPostVar('head_text_right')->getValue(),
476 'head_text_spacing' => $form->getItemByPostVar('head_text_spacing')->getValue(),
477 'head_text_line' => $form->getItemByPostVar('head_text_line')->getValue(),
478 'head_html_line' => $form->getItemByPostVar('head_html_line')->getValue(),
479 'head_html_spacing' => $form->getItemByPostVar('head_html_spacing')->getValue(),
480 'head_html' => $form->getItemByPostVar('head_html')->getValue(),
481 'footer_select' => $form->getItemByPostVar('footer_select')->getValue(),
482 'footer_text_left' => $form->getItemByPostVar('footer_text_left')->getValue(),
483 'footer_text_right' => $form->getItemByPostVar('footer_text_right')->getValue(),
484 'footer_text_spacing' => $form->getItemByPostVar('footer_text_spacing')->getValue(),
485 'footer_text_center' => $form->getItemByPostVar('footer_text_center')->getValue(),
486 'footer_text_line' => $form->getItemByPostVar('footer_text_line')->getValue(),
487 'footer_html' => $form->getItemByPostVar('footer_html')->getValue(),
488 'footer_html_spacing' => $form->getItemByPostVar('footer_html_spacing')->getValue(),
489 'overwrite_font' => $form->getItemByPostVar('overwrite_font')->getValue()
490 );
491 }
getItemByPostVar($a_post_var)
Get Item by POST variable.

References ilPropertyFormGUI\getItemByPostVar().

+ Here is the call graph for this function:

◆ populateForm()

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

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

498 {
499 $form->getItemByPostVar('path')->setValue($config->getWKHTMLToPdfDefaultPath());
500 $form->getItemByPostVar('zoom')->setValue($config->getZoom());
501 $form->getItemByPostVar('external_links')->setValue(1);
502 $form->getItemByPostVar('external_links')->setChecked($config->getExternalLinks());
503 $form->getItemByPostVar('enable_forms')->setValue(1);
504 $form->getItemByPostVar('enable_forms')->setChecked($config->getEnabledForms());
505 $form->getItemByPostVar('user_stylesheet')->setValue($config->getUserStylesheet());
506 $form->getItemByPostVar('low_quality')->setValue(1);
507 $form->getItemByPostVar('low_quality')->setChecked($config->getLowQuality());
508 $form->getItemByPostVar('greyscale')->setValue(1);
509 $form->getItemByPostVar('greyscale')->setChecked($config->getGreyscale());
510 $form->getItemByPostVar('orientation')->setValue($config->getOrientation());
511 $form->getItemByPostVar('page_size')->setValue($config->getPageSize());
512 $form->getItemByPostVar('margin_left')->setValue($config->getMarginLeft());
513 $form->getItemByPostVar('margin_right')->setValue($config->getMarginRight());
514 $form->getItemByPostVar('margin_top')->setValue($config->getMarginTop());
515 $form->getItemByPostVar('margin_bottom')->setValue($config->getMarginBottom());
516 $form->getItemByPostVar('print_media_type')->setValue(1);
517 $form->getItemByPostVar('print_media_type')->setChecked($config->getPrintMediaType());
518 $form->getItemByPostVar('javascript_delay')->setValue($config->getJavascriptDelay());
519 $form->getItemByPostVar('checkbox_svg')->setValue($config->getCheckboxSvg());
520 $form->getItemByPostVar('checkbox_checked_svg')->setValue($config->getCheckboxCheckedSvg());
521 $form->getItemByPostVar('radio_button_svg')->setValue($config->getRadioButtonSvg());
522 $form->getItemByPostVar('radio_button_checked_svg')->setValue($config->getRadioButtonCheckedSvg());
523 $form->getItemByPostVar('header_select')->setValue($config->getHeaderType());
524 $form->getItemByPostVar('head_text_left')->setValue($config->getHeaderTextLeft());
525 $form->getItemByPostVar('head_text_center')->setValue($config->getHeaderTextCenter());
526 $form->getItemByPostVar('head_text_right')->setValue($config->getHeaderTextRight());
527 $form->getItemByPostVar('head_text_spacing')->setValue($config->getHeaderTextSpacing());
528 $form->getItemByPostVar('head_text_line')->setValue(1);
529 $form->getItemByPostVar('head_text_line')->setChecked($config->isHeaderTextLine());
530 $form->getItemByPostVar('head_html_line')->setValue(1);
531 $form->getItemByPostVar('head_html_line')->setChecked($config->isHeaderHtmlLine());
532 $form->getItemByPostVar('head_html_spacing')->setValue($config->getHeaderHtmlSpacing());
533 $form->getItemByPostVar('head_html')->setValue($config->getHeaderHtml());
534 $form->getItemByPostVar('footer_select')->setValue($config->getFooterType());
535 $form->getItemByPostVar('footer_text_left')->setValue($config->getFooterTextLeft());
536 $form->getItemByPostVar('footer_text_center')->setValue($config->getFooterTextCenter());
537 $form->getItemByPostVar('footer_text_right')->setValue($config->getFooterTextRight());
538 $form->getItemByPostVar('footer_text_spacing')->setValue($config->getFooterTextSpacing());
539 $form->getItemByPostVar('footer_text_line')->setValue(1);
540 $form->getItemByPostVar('footer_text_line')->setChecked($config->isFooterTextLine());
541 $form->getItemByPostVar('footer_html_line')->setValue(1);
542 $form->getItemByPostVar('footer_html_line')->setChecked($config->isFooterHtmlLine());
543 $form->getItemByPostVar('footer_html')->setValue($config->getFooterHtml());
544 $form->getItemByPostVar('footer_html_spacing')->setValue($config->getFooterHtmlSpacing());
545 $form->getItemByPostVar('overwrite_font')->setValue($config->getOverwriteDefaultFont(false));
546
548 }
static setCheckedIfTrue(\ilPropertyFormGUI $form)
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $config, and ilPDFGeneratorUtils\setCheckedIfTrue().

+ Here is the call graph for this function:

◆ saveNewDefaultBinaryPath()

ilWkhtmlToPdfConfigFormGUI::saveNewDefaultBinaryPath (   $path)
protected
Parameters
$path

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

441 {
442 $settings = new ilSetting('wkhtmltopdfrenderer');
443 $settings->set('path', $path);
444 }
ILIAS Setting Class.

Referenced by validateForm().

+ Here is the caller graph for this function:

◆ setLanguage()

ilWkhtmlToPdfConfigFormGUI::setLanguage (   $lng)
protected
Parameters
$lng

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

References $lng.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ translate()

◆ validateForm()

ilWkhtmlToPdfConfigFormGUI::validateForm ( )
Returns
bool

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

386 {
387 $everything_ok = true;
389 $path = realpath(ilUtil::escapeShellCmd($_POST['path']));
390 $config->setPath($path);
391 if (mb_stripos($config->getPath(), 'wkhtmlto') === false) {
392 ilUtil::sendFailure($this->lng->txt("file_not_found"), true);
393 $everything_ok = false;
394 } else {
395 $config->setZoom((float) $_POST['zoom']);
396 $config->setExternalLinks((int) $_POST['external_links']);
397 $config->setEnabledForms((int) $_POST['enable_forms']);
398 $config->setUserStylesheet(ilUtil::stripSlashes($_POST['user_stylesheet']));
399 $config->setLowQuality((int) $_POST['low_quality']);
400 $config->setGreyscale((int) $_POST['greyscale']);
401 $config->setOrientation(ilUtil::stripSlashes($_POST['orientation']));
402 $config->setPageSize(ilUtil::stripSlashes($_POST['page_size']));
403 $config->setMarginLeft(ilUtil::stripSlashes($_POST['margin_left']));
404 $config->setMarginRight(ilUtil::stripSlashes($_POST['margin_right']));
405 $config->setMarginTop(ilUtil::stripSlashes($_POST['margin_top']));
406 $config->setMarginBottom(ilUtil::stripSlashes($_POST['margin_bottom']));
407 $config->setPrintMediaType((int) $_POST['print_media_type']);
408 $config->setJavascriptDelay((int) $_POST['javascript_delay']);
409 $config->setCheckboxSvg(ilUtil::stripSlashes($_POST['checkbox_svg']));
410 $config->setCheckboxCheckedSvg(ilUtil::stripSlashes($_POST['checkbox_checked_svg']));
411 $config->setRadioButtonSvg(ilUtil::stripSlashes($_POST['radio_button_svg']));
412 $config->setRadioButtonCheckedSvg(ilUtil::stripSlashes($_POST['radio_button_checked_svg']));
413 $config->setHeaderType((int) $_POST['header_select']);
414 $config->setHeaderTextLeft(ilUtil::stripSlashes($_POST['head_text_left']));
415 $config->setHeaderTextCenter(ilUtil::stripSlashes($_POST['head_text_center']));
416 $config->setHeaderTextRight(ilUtil::stripSlashes($_POST['head_text_right']));
417 $config->setHeaderTextSpacing((int) $_POST['head_text_spacing']);
418 $config->setHeaderTextLine((int) $_POST['head_text_line']);
419 $config->setHeaderHtmlLine((int) $_POST['head_html_line']);
420 $config->setHeaderHtmlSpacing((int) $_POST['head_html_spacing']);
421 $config->setHeaderHtml(ilUtil::stripSlashes($_POST['head_html']));
422 $config->setFooterType((int) $_POST['footer_select']);
423 $config->setFooterTextLeft(ilUtil::stripSlashes($_POST['footer_text_left']));
424 $config->setFooterTextCenter(ilUtil::stripSlashes($_POST['footer_text_center']));
425 $config->setFooterTextRight(ilUtil::stripSlashes($_POST['footer_text_right']));
426 $config->setFooterTextSpacing((int) $_POST['footer_text_spacing']);
427 $config->setFooterTextLine((int) $_POST['footer_text_line']);
428 $config->setFooterHtmlLine((int) $_POST['footer_html_line']);
429 $config->setFooterHtmlSpacing((int) $_POST['footer_html_spacing']);
430 $config->setFooterHtml(ilUtil::stripSlashes($_POST['footer_html']));
431 $config->setOverwriteDefaultFont(ilUtil::stripSlashes($_POST['overwrite_font']));
432 $this->saveNewDefaultBinaryPath($config->getPath());
433 }
434
435 return $everything_ok;
436 }
$_POST["username"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static escapeShellCmd($a_arg)
escape shell cmd
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $config, ilUtil\escapeShellCmd(), saveNewDefaultBinaryPath(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilWkhtmlToPdfConfigFormGUI::$lng
protected

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

Referenced by setLanguage().


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