19declare(strict_types=1);
32 protected \ILIAS\GlobalScreen\Services
$gs;
42 protected \ilLanguage
$lng;
67 $this->
lng->loadLanguageModule(
"exp");
68 $this->gs =
$DIC->globalScreen();
77 $this->provider->setOffline($offline);
83 $this->injectors[] =
$f;
87 string $selection_action
94 $this->
lng->txt(
"exp_print_pdf"),
95 $ui->
factory()->legacy()->content(
'some modal')
96 )->withAsyncRenderUrl($selection_action);
97 $print_button =
$ui->
factory()->button()->standard(
98 $this->
lng->txt(
"exp_print_pdf"),
99 $modal->getShowSignal()
101 $elements = new \stdClass();
102 $elements->button = $print_button;
103 $elements->modal = $modal;
114 $form = $this->provider->getSelectionForm();
115 $mb = $this->
ui->factory()->messageBox()->info($this->
lng->txt(
"exp_print_pdf_info"));
116 $tpl = new \ilTemplate(
"tpl.print_view_selection.html",
true,
true,
"components/ILIAS/Export/Print");
117 $form->setTarget(
"print_view");
118 $tpl->setVariable(
"FORM", $form->getHTML());
119 $tpl->setVariable(
"ON_SUBMIT_CODE", $this->provider->getOnSubmitCode());
120 $modal = $this->
ui->factory()->modal()->roundtrip(
121 $this->
lng->txt(
"exp_print_pdf"),
122 $this->ui->factory()->legacy()->content(
123 $this->ui->renderer()->render($mb) .
128 $this->
send($this->
ui->renderer()->render($modal));
134 $pages = $this->provider->getPages();
135 $tpl = new \ilGlobalTemplate(
136 "tpl.print_view.html",
139 "components/ILIAS/Export/Print"
143 foreach ($this->gs->layout()->meta()->getJs()->getItemsInOrderOfDelivery() as $js) {
144 $path = explode(
"?", $js->getContent());
146 $tpl->addJavaScript($file, $js->addVersionNumber());
148 foreach ($this->gs->layout()->meta()->getOnLoadCode()->getItemsInOrderOfDelivery() as $code) {
149 $tpl->addOnLoadCode($code->getContent());
154 foreach ($this->provider->getTemplateInjectors() as
$f) {
158 $tpl->setBodyClass($this->body_class);
169 $pb = ($this->provider->autoPageBreak())
170 ?
'<div style="page-break-after:always;"></div>'
178 $content =
'<div class="ilInvisibleBorder">' . $content .
'</div>';
179 $tpl->addOnLoadCode(
"il.Util.print();");
181 $tpl->setVariable(
"CONTENT", $content);
182 return $tpl->printToString();
190 $this->
send($this->renderPrintView($content_style_id));
198 protected function send(
string $output)
200 $this->
http->saveResponse($this->
http->response()->withBody(
203 $this->
http->sendResponse();
204 $this->
http->close();
Provides fluid interface to RBAC services.
mainTemplate()
Get the ILIAS main template.
factory()
Get the factory that crafts UI components.
__construct(PrintViewProvider $provider, \ILIAS\HTTP\Services $http, UIServices $ui, \ilLanguage $lng, ?string $body_class=null)
PrintViewGUI constructor.
ilGlobalTemplateInterface $main_tpl
ILIAS GlobalScreen Services $gs
getModalElements(string $selection_action)
PrintViewProvider $provider
sendPrintView(int $content_style_id=0)
send(string $output)
Send.
addTemplateInjector(callable $f)
renderPrintView(int $content_style_id=0)
setOffline(bool $offline)
Set output mode.
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static ofString(string $string)
Creates a new stream with an initial value.
static getContentPrintStyle()
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getSyntaxStylePath()
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
catch(ilCmiXapiException $e) send($response)