19declare(strict_types=1);
55 $this->co_page_html_export = new \ilCOPageHTMLExport($this->target_dir,
null, 0, $export_collector);
56 $this->global_screen =
$DIC->globalScreen();
63 array $standard_icons = []
66 if (is_null($this->export_collector)) {
67 $sys_style_html_export = new \ilSystemStyleHTMLExport($this->target_dir);
68 $sys_style_html_export->export();
71 $asset_dirs = [
"css",
"fonts",
"images/logo",
"images/standard"];
72 foreach ($asset_dirs as $asset_dir) {
74 $asset_dir =
"./assets/" . $asset_dir;
77 $iterator = new \RecursiveIteratorIterator(
78 new \RecursiveDirectoryIterator($asset_dir, \FilesystemIterator::SKIP_DOTS),
79 \RecursiveIteratorIterator::SELF_FIRST
81 foreach ($iterator as $item) {
82 if (!$item->isDir()) {
83 if ($asset_dir ===
"./assets/images/standard" &&
84 !in_array($iterator->getSubPathname(), $standard_icons)) {
87 $this->export_collector->addFile(
89 $asset_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathname()
128 $this->co_page_html_export->setContentStyleId($style_sheet_id);
129 if (is_null($this->export_collector)) {
130 $this->co_page_html_export->createDirectories();
132 $this->co_page_html_export->exportStyles();
133 $this->co_page_html_export->exportSupportScripts();
142 $this->global_screen->tool()->context()->current()->addAdditionalData(
153 $global_screen = $this->global_screen;
154 $target_dir = $this->target_dir;
155 $css = $global_screen->
layout()->meta()->getCss();
156 foreach ($css->getItemsInOrderOfDelivery() as $item) {
157 $this->exportResourceFile($target_dir, $item->getContent());
159 $js = $global_screen->
layout()->meta()->getJs();
160 foreach ($js->getItemsInOrderOfDelivery() as $item) {
161 $this->exportResourceFile($target_dir, $item->getContent());
170 if (is_int(strpos($file,
"?"))) {
171 $file = substr($file, 0, strpos($file,
"?"));
173 if (is_file($file)) {
174 $dir = dirname($file);
175 if (is_null($this->export_collector)) {
177 if (!is_file($target_dir .
"/" . $file)) {
178 copy($file, $target_dir .
"/" . $file);
181 $this->export_collector->addFile($file, $file);
Util This class is an interim solution for the HTML export handling with 6.0.
ilCOPageHTMLExport $co_page_html_export
exportResourceFile(string $target_dir, string $file)
Export resource file.
exportResourceFiles()
Export resource files collected by global screen service.
initGlobalScreen()
Init global screen.
__construct(string $export_dir, string $sub_dir, protected ?ExportCollector $export_collector=null)
Constructor.
exportCOPageFiles(int $style_sheet_id=0, string $obj_type="")
Export content style.
exportSystemStyle(array $standard_icons=[])
Export system style.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
const HTML_EXPORT_RENDERING
if(!file_exists('../ilias.ini.php'))