ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
SettingsManager.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Blog\Settings
;
22
23
use
ILIAS\Blog\InternalDataService
;
24
use
ILIAS\Blog\InternalRepoService
;
25
use
ILIAS\Blog\InternalDomainService
;
26
27
class
SettingsManager
28
{
29
public
function
__construct
(
30
protected
InternalDataService
$data
,
31
protected
InternalRepoService $repo,
32
protected
InternalDomainService
$domain
33
) {
34
}
35
36
37
public
function
create
(
Settings
$settings): void
38
{
39
$this->repo->settings()->create($settings);
40
}
41
42
public
function
update
(
Settings
$settings): void
43
{
44
$this->repo->settings()->update($settings);
45
}
46
47
public
function
getByObjId
(
int
$id
): ?
Settings
48
{
49
return
$this->repo->settings()->getByObjId($id);
50
}
51
52
public
function
clone
($from_id, $to_id): void
53
{
54
$settings = $this->repo->settings()->getByObjId($from_id);
55
$settings = $settings->withId($to_id);
56
$this->
update
($settings);
57
}
58
59
public
function
saveOrder
(
int
$id
, array $order): void
60
{
61
$this->repo->settings()->saveOrder($id, $order);
62
}
63
64
public
function
getOrderingOptions
(
65
Settings
$settings,
66
bool
$in_repository
67
): array {
68
$lng
= $this->domain->lng();
69
$order_options = [];
70
foreach
($settings->
getOrder
() as $item) {
71
$order_options[$item] =
$lng
->txt(
"blog_"
. $item);
72
}
73
74
$type =
"navigation"
;
75
if
(!isset($order_options[$type])) {
76
$order_options[$type] =
$lng
->txt(
"blog_"
. $type);
77
}
78
79
if
($in_repository) {
80
$type =
"authors"
;
81
if
(!isset($order_options[$type])) {
82
$order_options[$type] =
$lng
->txt(
"blog_"
. $type);
83
}
84
}
85
86
$type =
"keywords"
;
87
if
(!isset($order_options[$type])) {
88
$order_options[$type] =
$lng
->txt(
"blog_"
. $type);
89
}
90
91
return
$order_options;
92
}
93
}
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getOrder
getOrder()
Definition:
Settings.php:139
InternalDataService
$data
$data
Definition:
ltiregistration.php:29
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\create
create(Settings $settings)
Definition:
SettingsManager.php:37
InternalDomainService
ILIAS\Export\InternalDomainService
Definition:
class.InternalDomainService.php:25
InternalRepoService
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\clone
clone($from_id, $to_id)
Definition:
SettingsManager.php:52
ILIAS\Blog\Settings
Definition:
class.BlockSettingsGUI.php:21
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\__construct
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
Definition:
SettingsManager.php:29
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\update
update(Settings $settings)
Definition:
SettingsManager.php:42
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager
Definition:
SettingsManager.php:27
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\saveOrder
saveOrder(int $id, array $order)
Definition:
SettingsManager.php:59
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\getOrderingOptions
getOrderingOptions(Settings $settings, bool $in_repository)
Definition:
SettingsManager.php:64
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager\getByObjId
getByObjId(int $id)
Definition:
SettingsManager.php:47
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:24
$lng
global $lng
Definition:
privfeed.php:32
SettingsInterface
components
ILIAS
Blog
Settings
SettingsManager.php
Generated on Wed Sep 10 2025 15:15:08 for ILIAS by
1.8.13 (using
Doxyfile
)