ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
StyleManager.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
29 
31 {
32  protected StyleRepo $repo;
33  public function __construct(
34  protected InternalDataService $data,
35  InternalRepoService $repo,
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 
72  public function createContainerFromLocalZip(
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 
82  public function createContainerFromLocalDir(
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 }
createContainerFromLocalZip(string $local_zip_path)
getPath(bool $add_random=true, bool $add_token=true)
createContainerFromLocalDir(string $local_dir_path, string $container_path="", bool $recursive=true)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
cloneResourceContainer(int $from_style_id)
__construct(protected InternalDataService $data, InternalRepoService $repo, protected InternalDomainService $domain, protected ResourceStakeholder $stakeholder, protected int $style_id)
importFromUploadResult(UploadResult $result,)