ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.PrintViewProvider.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Notes;
22 
23 use ILIAS\Export;
25 
30 {
31  protected \ilLanguage $lng;
32  protected \ilCtrl $ctrl;
33 
34  public function __construct(
35  ) {
36  global $DIC;
37 
38  $this->ctrl = $DIC->ctrl();
39  $this->lng = $DIC->language();
40  }
41 
42  public function getTemplateInjectors(): array
43  {
44  return [
45  static function (\ilGlobalTemplate $tpl): void {
46  //$tpl add js/css
47  }
48  ];
49  }
50 
51  public function getSelectionForm(): ?ilPropertyFormGUI
52  {
53  $lng = $this->lng;
54  $ilCtrl = $this->ctrl;
55 
56  $form = new \ilPropertyFormGUI();
57 
58  $form->addCommandButton("printView", $lng->txt("print_view"));
59 
60  //$form->setTitle($lng->txt("svy_print_selection"));
61  $form->setFormAction("#");
62 
63  return $form;
64  }
65 
66  public function getOnSubmitCode(): string
67  {
68  return "event.preventDefault(); " .
69  "window.setTimeout(() => { window.print();}, 500);";
70  }
71 }
special template class to simplify handling of ITX/PEAR
$lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSelectionForm()
form which is featured in the modal form target is modified to open in new window (not yet possible w...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41