3 declare(strict_types=1);
32 protected \ILIAS\GlobalScreen\Services
$gs;
42 protected \ilLanguage
$lng;
58 string $body_class = null
66 $this->body_class = $body_class ??
"ilPrtfPdfBody";
67 $this->
lng->loadLanguageModule(
"exp");
68 $this->gs = $DIC->globalScreen();
77 $this->provider->setOffline($offline);
83 $this->injectors[] =
$f;
87 string $selection_action
92 $ui->
mainTemplate()->addJavaScript(
"./Services/Form/js/Form.js");
93 $modal = $ui->
factory()->modal()->roundtrip(
94 $this->
lng->txt(
"exp_print_pdf"),
95 $ui->
factory()->legacy(
'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,
"Services/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(
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 "Services/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();
198 protected function send(
string $output)
200 $this->
http->saveResponse($this->
http->response()->withBody(
203 $this->
http->sendResponse();
204 $this->
http->close();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renderPrintView(int $content_style_id=0)
static getContentPrintStyle()
ILIAS GlobalScreen Services $gs
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides fluid interface to RBAC services.
static http()
Fetches the global http state from ILIAS.
setOffline(bool $offline)
Set output mode.
getModalElements(string $selection_action)
send(string $output)
Send.
__construct(PrintViewProvider $provider, \ILIAS\HTTP\Services $http, UIServices $ui, \ilLanguage $lng, string $body_class=null)
PrintViewGUI constructor.
static getSyntaxStylePath()
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static ofString(string $string)
Creates a new stream with an initial value.
ilGlobalTemplateInterface $main_tpl
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
sendPrintView(int $content_style_id=0)
factory()
Get the factory that crafts UI components.
PrintViewProvider $provider
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
addTemplateInjector(callable $f)
mainTemplate()
Get the ILIAS main template.