19declare(strict_types=1);
43 public function readRid(
int $style_id): string
45 $set = $this->db->queryF(
46 "SELECT rid FROM style_data " .
51 while ($rec = $this->db->fetchAssoc($set)) {
52 return (
string) $rec[
"rid"];
61 $rid = $this->irss->createContainer($stakeholder);
65 "rid" => [
"string", $rid]
68 "id" => [
"integer", $style_id]
76 string $local_zip_path,
79 $rid = $this->irss->createContainerFromLocalZip($local_zip_path, $stakeholder);
83 "rid" => [
"string", $rid]
86 "id" => [
"integer", $style_id]
94 string $local_dir_path,
96 string $container_path =
"",
97 bool $recursive =
true
99 $rid = $this->irss->createContainerFromLocalDir($local_dir_path, $stakeholder, $container_path, $recursive);
103 "rid" => [
"string", $rid]
106 "id" => [
"integer", $style_id]
116 $rid = $this->readRid($style_id);
118 $rid = $this->createRid(
131 $rid = $this->readRid($style_id);
133 $this->irss->addStringToContainer($rid, $css,
"style.css");
139 bool $add_random =
true,
140 bool $add_token =
true
142 $rid = $this->readRid($style_id);
145 $path = $this->irss->getContainerUri(
150 $random = new \Random\Randomizer();
151 $rand = $random->getInt(1, 999999);
152 $path .=
"?dummy=$rand";
157 $random = new \Random\Randomizer();
158 $rand = $random->getInt(1, 999999);
159 $path .=
"?dummy=$rand";
170 $rid = $this->readRid($style_id);
172 return $this->irss->getResourceIdForIdString($rid);
181 $from_rid = $this->readRid($from_style_id);
182 $to_rid = $this->irss->cloneContainer($from_rid);
183 if ($to_rid !==
"") {
187 "rid" => [
"string", $to_rid]
190 "id" => [
"integer", $to_style_id]
203 "uptodate" => [
"integer", (
int) $up_to_date]
206 "id" => [
"integer", $style_id]
214 $source_dir =
CLIENT_WEB_DIR .
'/sty/sty_' . $style_id .
"/images";
215 $rid = $this->readRid($style_id);
216 if (is_dir($source_dir) && $rid !==
"") {
217 $this->irss->addDirectoryToContainer(
Class ResourceIdentification.
Content style data object factory.
createContainerFromLocalZip(int $style_id, string $local_zip_path, ResourceStakeholder $stakeholder)
migrateImages(int $style_id)
InternalDataService $factory
createRid(int $style_id, ResourceStakeholder $stakeholder)
cloneResourceContainer(int $from_style_id, int $to_style_id)
createContainerFromLocalDir(int $style_id, string $local_dir_path, ResourceStakeholder $stakeholder, string $container_path="", bool $recursive=true)
getResourceIdentification(int $style_id)
saveUpToDate(int $style_id, bool $up_to_date)
writeCss(int $style_id, string $css, ResourceStakeholder $stakeholder)
getPath(int $style_id, bool $add_random=true, bool $add_token=true)
__construct(ilDBInterface $db, InternalDataService $factory, protected IRSSWrapper $irss)
getOrCreateRid(int $style_id, ResourceStakeholder $stakeholder)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static signFile(string $path_to_file)
Interface ResourceStakeholder.