ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\Style\Content\Style\StyleManager Class Reference
+ Collaboration diagram for ILIAS\Style\Content\Style\StyleManager:

Public Member Functions

 __construct (protected InternalDataService $data, InternalRepoService $repo, protected InternalDomainService $domain, protected ResourceStakeholder $stakeholder, protected int $style_id)
 
 createRid ()
 
 writeCss ()
 
 getPath (bool $add_random=true, bool $add_token=true)
 
 getResourceIdentification ()
 
 createContainerFromLocalZip (string $local_zip_path)
 
 createContainerFromLocalDir (string $local_dir_path, string $container_path="", bool $recursive=true)
 
 importFromUploadResult (UploadResult $result,)
 
 cloneResourceContainer (int $from_style_id)
 
 isMigrated ()
 
 migrateImages ()
 

Protected Attributes

StyleRepo $repo
 

Detailed Description

Definition at line 30 of file StyleManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Style\Content\Style\StyleManager::__construct ( protected InternalDataService  $data,
InternalRepoService  $repo,
protected InternalDomainService  $domain,
protected ResourceStakeholder  $stakeholder,
protected int  $style_id 
)

Definition at line 33 of file StyleManager.php.

39 {
40 $this->repo = $repo->style();
41 }

References ILIAS\Style\Content\Style\StyleManager\$repo.

Member Function Documentation

◆ cloneResourceContainer()

ILIAS\Style\Content\Style\StyleManager::cloneResourceContainer ( int  $from_style_id)

Definition at line 126 of file StyleManager.php.

128 : void {
129 $this->repo->cloneResourceContainer(
130 $from_style_id,
131 $this->style_id
132 );
133 }

◆ createContainerFromLocalDir()

ILIAS\Style\Content\Style\StyleManager::createContainerFromLocalDir ( string  $local_dir_path,
string  $container_path = "",
bool  $recursive = true 
)

Definition at line 98 of file StyleManager.php.

102 : string {
103 return $this->repo->createContainerFromLocalDir(
104 $this->style_id,
105 $local_dir_path,
106 $this->stakeholder,
107 $container_path,
108 $recursive
109 );
110 }

◆ createContainerFromLocalZip()

ILIAS\Style\Content\Style\StyleManager::createContainerFromLocalZip ( string  $local_zip_path)

Definition at line 88 of file StyleManager.php.

90 : string {
91 return $this->repo->createContainerFromLocalZip(
92 $this->style_id,
93 $local_zip_path,
94 $this->stakeholder
95 );
96 }

◆ createRid()

ILIAS\Style\Content\Style\StyleManager::createRid ( )

Definition at line 43 of file StyleManager.php.

43 : string
44 {
45 return $this->repo->getOrCreateRid(
46 $this->style_id,
47 $this->stakeholder
48 );
49 }

◆ getPath()

ILIAS\Style\Content\Style\StyleManager::getPath ( bool  $add_random = true,
bool  $add_token = true 
)

Definition at line 72 of file StyleManager.php.

75 : string {
76 return $this->repo->getPath(
77 $this->style_id,
78 $add_random,
79 $add_token
80 );
81 }

◆ getResourceIdentification()

ILIAS\Style\Content\Style\StyleManager::getResourceIdentification ( )

Definition at line 83 of file StyleManager.php.

83 : ?ResourceIdentification
84 {
85 return $this->repo->getResourceIdentification($this->style_id);
86 }

◆ importFromUploadResult()

ILIAS\Style\Content\Style\StyleManager::importFromUploadResult ( UploadResult  $result)

Definition at line 112 of file StyleManager.php.

114 : int {
115 $imp = new \ilImport();
116 return $imp->importObject(
117 null,
118 $result->getPath(),
119 $result->getName(),
120 "sty",
121 "",
122 true
123 );
124 }

◆ isMigrated()

ILIAS\Style\Content\Style\StyleManager::isMigrated ( )

Definition at line 135 of file StyleManager.php.

135 : bool
136 {
137 return ((string) $this->repo->getResourceIdentification($this->style_id)
138 !== "");
139 }

Referenced by ILIAS\Style\Content\Style\StyleManager\writeCss().

+ Here is the caller graph for this function:

◆ migrateImages()

ILIAS\Style\Content\Style\StyleManager::migrateImages ( )

Definition at line 141 of file StyleManager.php.

142 : void {
143 $this->repo->migrateImages($this->style_id);
144 }

◆ writeCss()

ILIAS\Style\Content\Style\StyleManager::writeCss ( )

Definition at line 51 of file StyleManager.php.

51 : bool
52 {
53 if ($this->isMigrated()) {
54 $builder = $this->domain->cssBuilder(
55 new \ilObjStyleSheet($this->style_id)
56 );
57 $css = $builder->getCss();
58 $this->repo->writeCss(
59 $this->style_id,
60 $css,
61 $this->stakeholder
62 );
63 $this->repo->saveUpToDate(
64 $this->style_id,
65 true
66 );
67 return true;
68 }
69 return false;
70 }
Class ilObjStyleSheet.

References ILIAS\Style\Content\Style\StyleManager\isMigrated().

+ Here is the call graph for this function:

Field Documentation

◆ $repo

StyleRepo ILIAS\Style\Content\Style\StyleManager::$repo
protected

Definition at line 32 of file StyleManager.php.

Referenced by ILIAS\Style\Content\Style\StyleManager\__construct().


The documentation for this class was generated from the following file: