3 declare(strict_types=1);
52 $this->
settings = $domain_service->settings();
54 $this->obj_id = ($obj_id > 0)
60 $this->object_repo = $repo_service->
object();
61 $this->log = $this->domain_service->log();
72 $tree = $this->domain_service->repositoryTree();
75 $fixed_style = $settings->
get(
"fixed_content_style_id");
76 if ($fixed_style > 0) {
85 if ($this->ref_id > 0) {
86 $path = $tree->getPathId($this->ref_id);
88 $container_obj_ids = array_map(
function ($ref_id) {
91 foreach ($this->object_repo->getOwnedStyles($container_obj_ids) as $obj_id => $style_id) {
92 $st_styles[$style_id] =
105 if (isset($sel_types[$style_id])) {
131 $this->log->debug(
"Cloning style from ref id: " . $this->ref_id .
132 ", obj id: " . $this->obj_id .
", style id: " . $this->
getStyleId() .
", to new obj id: " .
137 $new_id = $style_obj->ilClone();
150 if ($this->ref_id > 0) {
151 $tree = $this->domain_service->repositoryTree();
152 $parent_ref_id = $tree->getParentId($this->ref_id);
177 $fixed_style = (
int) $settings->
get(
"fixed_content_style_id");
178 if ($fixed_style > 0) {
179 $style_id = $fixed_style;
183 if ($style_id <= 0) {
184 $style_id = (
int) $settings->
get(
"default_content_style_id");
196 return $this->object_repo->isOwned($this->obj_id, $style_id);
201 $fixed_style = (
int) $this->
settings->get(
"fixed_content_style_id");
202 if ($fixed_style > 0) {
211 $fixed_style = (
int) $this->
settings->get(
"fixed_content_style_id");
222 if ($current_style > 0 && $this->
isOwned($current_style)) {
cloneTo(int $obj_id)
Clones a style to a new object (or references the same standard style)
get(string $a_keyword, ?string $a_default_value=null)
get setting
__construct(InternalRepoService $repo_service, InternalDomainService $domain_service, int $ref_id, int $obj_id=0)
static _getStandardStyles(bool $a_exclude_default_style=false, bool $a_include_deactivated=false, int $a_scope=0)
Get standard styles.
ObjectDBRepository $object_repo
object()
Objects without ref id (e.g.
This repo stores infos on repository objects that are using booking managers as a service (resource m...
Manages repository object related content style behaviour.
hasEffectiveIndividualStyle(int $current_style)
updateStyleId(int $style_id)
static _lookupObjId(int $ref_id)
static writeOwner($obj_id, $style_id)
setOwnerOfStyle(int $style_id)
InternalDomainService $domain_service
Content style internal repo service.
static _lookupTitle(int $obj_id)
static _lookupStandard(int $a_id)
Lookup standard flag.
getSelectableStyles()
Get all selectable styles.
InternalRepoService $repo_service
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
filterByReuse(array $ref_ids)
For an array of ref ids, return only the ref ids that have the reuse flag set.
static writeStyleUsage(int $a_obj_id, int $a_style_id)
Write style usage.
static lookupObjectStyle(int $a_obj_id)
Lookup object style.
This repo stores infos on repository objects that are using booking managers as a service (resource m...
canSelectStyle(int $current_style)
static _lookupType(int $id, bool $reference=false)
isSelectable(int $style_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
inheritFromParent()
Inherits a non local style from the parent container.
ContainerDBRepository $container_repo