ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.GUIService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Style\Content;
22 
25 use ilObjStyleSheet;
26 
32 {
34 
35  public function __construct(
36  InternalService $internal_service
37  ) {
38  $this->internal = $internal_service;
39  }
40 
41  public function objectSettingsClass(bool $lower = true): string
42  {
43  return $this->internal->gui()->objectSettingsClass($lower);
44  }
45 
46  public function objectSettingsGUIForRefId(
47  ?int $selected_style_id,
48  int $ref_id
50  return $this->internal->gui()->objectSettingsGUI(
51  $selected_style_id,
52  $ref_id
53  );
54  }
55 
56  public function objectSettingsGUIForObjId(
57  ?int $selected_style_id,
58  int $obj_id
60  return $this->internal->gui()->objectSettingsGUI(
61  $selected_style_id,
62  0,
63  $obj_id
64  );
65  }
66 
67 
68  public function redirectToObjectSettings(): void
69  {
70  $this->internal->gui()->ctrl()->redirectByClass(
71  $this->objectSettingsClass(),
72  ""
73  );
74  }
75 
76  // add effective style sheet path to global template
77  public function addCss(ilGlobalTemplateInterface $tpl, int $ref_id, int $obj_id = 0): void
78  {
79  $eff_style_id = $this->internal->domain()->object($ref_id, $obj_id)->getEffectiveStyleId();
80  $tpl->addCss(ilObjStyleSheet::getContentStylePath($eff_style_id));
81  }
82 }
objectSettingsGUIForRefId(?int $selected_style_id, int $ref_id)
addCss(ilGlobalTemplateInterface $tpl, int $ref_id, int $obj_id=0)
Facade for consumer gui interface.
$ref_id
Definition: ltiauth.php:65
__construct(InternalService $internal_service)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
objectSettingsClass(bool $lower=true)
objectSettingsGUIForObjId(?int $selected_style_id, int $obj_id)