ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StyleManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
31{
32 protected StyleRepo $repo;
33 public function __construct(
34 protected InternalDataService $data,
36 protected InternalDomainService $domain,
37 protected ResourceStakeholder $stakeholder,
38 protected int $style_id
39 ) {
40 $this->repo = $repo->style();
41 }
42
43 public function writeCss(): void
44 {
45 $builder = $this->domain->cssBuilder(
46 new \ilObjStyleSheet($this->style_id)
47 );
48 $css = $builder->getCss();
49 $this->repo->writeCss(
50 $this->style_id,
51 $css,
52 $this->stakeholder
53 );
54 }
55
56 public function getPath(
57 bool $add_random = true,
58 bool $add_token = true
59 ): string {
60 return $this->repo->getPath(
61 $this->style_id,
62 $add_random,
63 $add_token
64 );
65 }
66
68 {
69 return $this->repo->getResourceIdentification($this->style_id);
70 }
71
73 string $local_zip_path
74 ): string {
75 return $this->repo->createContainerFromLocalZip(
76 $this->style_id,
77 $local_zip_path,
78 $this->stakeholder
79 );
80 }
81
83 string $local_dir_path,
84 string $container_path = "",
85 bool $recursive = true
86 ): string {
87 return $this->repo->createContainerFromLocalDir(
88 $this->style_id,
89 $local_dir_path,
90 $this->stakeholder,
91 $container_path,
92 $recursive
93 );
94 }
95
96 public function importFromUploadResult(
97 UploadResult $result,
98 ): int {
99 $imp = new \ilImport();
100 return $imp->importObject(
101 null,
102 $result->getPath(),
103 $result->getName(),
104 "sty",
105 "",
106 true
107 );
108 }
109
110 public function cloneResourceContainer(
111 int $from_style_id
112 ): void {
113 $this->repo->cloneResourceContainer(
114 $from_style_id,
115 $this->style_id
116 );
117 }
118
119}
getPath(bool $add_random=true, bool $add_token=true)
importFromUploadResult(UploadResult $result,)
createContainerFromLocalZip(string $local_zip_path)
createContainerFromLocalDir(string $local_dir_path, string $container_path="", bool $recursive=true)
cloneResourceContainer(int $from_style_id)
__construct(protected InternalDataService $data, InternalRepoService $repo, protected InternalDomainService $domain, protected ResourceStakeholder $stakeholder, protected int $style_id)
Import class.
importObject(?object $a_new_obj, string $a_tmp_file, string $a_filename, string $a_type, string $a_comp="", bool $a_copy_file=false)
Class ilObjStyleSheet.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...