|
| __construct (ilDBInterface $db, InternalDataService $factory, protected IRSSWrapper $irss) |
|
| readRid (int $style_id) |
|
| createContainerFromLocalZip (int $style_id, string $local_zip_path, ResourceStakeholder $stakeholder) |
|
| createContainerFromLocalDir (int $style_id, string $local_dir_path, ResourceStakeholder $stakeholder, string $container_path="", bool $recursive=true) |
|
| getOrCreateRid (int $style_id, ResourceStakeholder $stakeholder) |
|
| writeCss (int $style_id, string $css, ResourceStakeholder $stakeholder) |
|
| getPath (int $style_id, bool $add_random=true, bool $add_token=true) |
|
| getResourceIdentification (int $style_id) |
|
| cloneResourceContainer (int $from_style_id, int $to_style_id) |
|
Definition at line 29 of file StyleRepo.php.
◆ __construct()
◆ cloneResourceContainer()
ILIAS\Style\Content\Style\StyleRepo::cloneResourceContainer |
( |
int |
$from_style_id, |
|
|
int |
$to_style_id |
|
) |
| |
Definition at line 175 of file StyleRepo.php.
178 : void {
179 $from_rid = $this->
readRid($from_style_id);
180 $to_rid = $this->irss->cloneContainer($from_rid);
181 if ($to_rid !== "") {
182 $this->db->update(
183 "style_data",
184 [
185 "rid" => ["string", $to_rid]
186 ],
187 [
188 "id" => ["integer", $to_style_id]
189 ]
190 );
191 }
192 }
◆ createContainerFromLocalDir()
ILIAS\Style\Content\Style\StyleRepo::createContainerFromLocalDir |
( |
int |
$style_id, |
|
|
string |
$local_dir_path, |
|
|
ResourceStakeholder |
$stakeholder, |
|
|
string |
$container_path = "" , |
|
|
bool |
$recursive = true |
|
) |
| |
Definition at line 92 of file StyleRepo.php.
98 : string {
99 $rid = $this->irss->createContainerFromLocalDir($local_dir_path, $stakeholder, $container_path, $recursive);
100 $this->db->update(
101 "style_data",
102 [
103 "rid" => ["string", $rid]
104 ],
105 [
106 "id" => ["integer", $style_id]
107 ]
108 );
109 return $rid;
110 }
◆ createContainerFromLocalZip()
ILIAS\Style\Content\Style\StyleRepo::createContainerFromLocalZip |
( |
int |
$style_id, |
|
|
string |
$local_zip_path, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 74 of file StyleRepo.php.
78 : string {
79 $rid = $this->irss->createContainerFromLocalZip($local_zip_path, $stakeholder);
80 $this->db->update(
81 "style_data",
82 [
83 "rid" => ["string", $rid]
84 ],
85 [
86 "id" => ["integer", $style_id]
87 ]
88 );
89 return $rid;
90 }
◆ createRid()
ILIAS\Style\Content\Style\StyleRepo::createRid |
( |
int |
$style_id, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
|
protected |
Definition at line 57 of file StyleRepo.php.
60 : string {
61 $rid = $this->irss->createContainer($stakeholder);
62 $this->db->update(
63 "style_data",
64 [
65 "rid" => ["string", $rid]
66 ],
67 [
68 "id" => ["integer", $style_id]
69 ]
70 );
71 return $rid;
72 }
◆ getOrCreateRid()
ILIAS\Style\Content\Style\StyleRepo::getOrCreateRid |
( |
int |
$style_id, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 112 of file StyleRepo.php.
115 : string {
116 $rid = $this->
readRid($style_id);
117 if ($rid === "") {
119 $style_id,
120 $stakeholder
121 );
122 }
123 return $rid;
124 }
createRid(int $style_id, ResourceStakeholder $stakeholder)
◆ getPath()
ILIAS\Style\Content\Style\StyleRepo::getPath |
( |
int |
$style_id, |
|
|
bool |
$add_random = true , |
|
|
bool |
$add_token = true |
|
) |
| |
Definition at line 135 of file StyleRepo.php.
139 : string {
140 $rid = $this->
readRid($style_id);
141
142 if ($rid !== "") {
143 $path = $this->irss->getContainerUri(
144 $rid,
145 "style.css"
146 );
147 if ($add_random) {
148 $random = new \Random\Randomizer();
149 $rand = $random->getInt(1, 999999);
150 $path .=
"?dummy=$rand";
151 }
152 } else {
154 if ($add_random) {
155 $random = new \Random\Randomizer();
156 $rand = $random->getInt(1, 999999);
157 $path .=
"?dummy=$rand";
158 }
159 if ($add_token) {
161 }
162 }
164 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static signFile(string $path_to_file)
References $path.
◆ getResourceIdentification()
ILIAS\Style\Content\Style\StyleRepo::getResourceIdentification |
( |
int |
$style_id | ) |
|
Definition at line 166 of file StyleRepo.php.
166 : ?ResourceIdentification
167 {
168 $rid = $this->
readRid($style_id);
169 if ($rid !== "") {
170 return $this->irss->getResourceIdForIdString($rid);
171 }
172 return null;
173 }
◆ readRid()
ILIAS\Style\Content\Style\StyleRepo::readRid |
( |
int |
$style_id | ) |
|
Definition at line 43 of file StyleRepo.php.
43 : string
44 {
45 $set = $this->db->queryF(
46 "SELECT rid FROM style_data " .
47 " WHERE id = %s ",
48 ["integer"],
49 [$style_id]
50 );
51 while ($rec = $this->db->fetchAssoc($set)) {
52 return (string) $rec["rid"];
53 }
54 return "";
55 }
◆ writeCss()
ILIAS\Style\Content\Style\StyleRepo::writeCss |
( |
int |
$style_id, |
|
|
string |
$css, |
|
|
ResourceStakeholder |
$stakeholder |
|
) |
| |
Definition at line 126 of file StyleRepo.php.
130 : void {
132 $this->irss->addStringToContainer($rid, $css, "style.css");
133 }
getOrCreateRid(int $style_id, ResourceStakeholder $stakeholder)
◆ $db
◆ $factory
The documentation for this class was generated from the following file: