ILIAS
trunk Revision v11.0_alpha-1753-gb21ca8c4367
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
class.BlockSettingsGUI.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\InternalDomainService
;
24
use
ILIAS\Blog\InternalGUIService
;
25
use
ILIAS\Repository\Form\FormAdapterGUI
;
26
use
ILIAS\Blog\InternalDataService
;
27
use
ILIAS\UI\URLBuilder
;
28
use
ILIAS\UI\Component\Table\OrderingRetrieval
;
29
use
ILIAS\UI\Component\Table\OrderingRowBuilder
;
30
use
ILIAS\Data\URI
;
31
use
ILIAS\UI\Component\Table\Ordering
;
32
33
class
BlockSettingsGUI
34
{
35
protected
SettingsManager
$settings
;
36
37
public
function
__construct
(
38
protected
InternalDataService
$data
,
39
protected
InternalDomainService
$domain,
40
protected
InternalGUIService $gui,
41
protected
int
$obj_id,
42
protected
bool
$in_repository
43
) {
44
$this->
settings
= $domain->blogSettings();
45
}
46
47
public
function
executeCommand
(): void
48
{
49
$ctrl = $this->gui->ctrl();
50
$next_class = $ctrl->getNextClass($this);
51
$cmd = $ctrl->getCmd(
"edit"
);
52
53
switch
($next_class) {
54
default
:
55
if
(in_array($cmd, [
"edit"
,
"saveOrder"
])) {
56
$this->$cmd();
57
}
58
}
59
}
60
61
protected
function
edit
(): void
62
{
63
$mt = $this->gui->ui()->mainTemplate();
64
$r
= $this->gui->ui()->renderer();
65
$mt->setContent(
$r
->render($this->getTable()));
66
}
67
68
protected
function
getTable
(): Ordering
69
{
70
$f
= $this->gui->ui()->factory();
71
$lng
= $this->domain->lng();
72
$settings =
$this->settings
;
73
$ctrl = $this->gui->ctrl();
74
75
$request = $this->gui->http()->request();
76
77
$columns = [
78
'block'
=>
$f
->table()->column()->text(
$lng
->txt(
"blog_side_blocks"
))
79
->withHighlight(
true
)
80
];
81
82
$actions = [];
83
84
$data_retrieval =
new
class
(
85
$settings
,
86
$this->obj_id,
87
$this->in_repository
88
) implements
OrderingRetrieval
{
89
protected
array $records;
90
91
public
function
__construct
(
92
protected
SettingsManager
$settings,
93
protected
int
$blog_id,
94
protected
bool
$in_repository
95
) {
96
}
97
98
public
function
getRows(
99
OrderingRowBuilder $row_builder,
100
array $visible_column_ids
101
): \Generator {
102
foreach
($this->
settings
->getOrderingOptions(
103
$this->settings->getByObjId(
104
$this->blog_id
105
),
106
$this->in_repository
107
) as
$id
=> $option) {
108
yield $row_builder->buildOrderingRow(
109
$id
,
110
[
"block"
=> $option]
111
);
112
}
113
}
114
};
115
116
$target = $ctrl->getLinkTargetByClass([self::class],
"saveOrder"
);
117
$target = (
new
URI
(ILIAS_HTTP_PATH .
"/"
. $target));
118
$table =
$f
->table()->ordering($data_retrieval, $target,
$lng
->txt(
"blog_nav_sortorder"
), $columns)
119
->withActions($actions)
120
->withRequest($request);
121
122
return
$table;
123
}
124
125
protected
function
saveOrder
(): void
126
{
127
$mt = $this->gui->ui()->mainTemplate();
128
$lng
= $this->domain->lng();
129
$ctrl = $this->gui->ctrl();
130
131
$this->
settings
->saveOrder(
132
$this->obj_id,
133
$this->
getTable
()->getData()
134
);
135
136
$mt->setOnScreenMessage(
"success"
,
$lng
->txt(
"msg_obj_modified"
),
true
);
137
$ctrl->redirectByClass(self::class,
"edit"
);
138
}
139
}
URLBuilder
InternalDataService
$data
$data
Definition:
ltiregistration.php:29
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\saveOrder
saveOrder()
Definition:
class.BlockSettingsGUI.php:125
FormAdapterGUI
InternalGUIService
OrderingRowBuilder
InternalDomainService
ILIAS\Export\InternalDomainService
Definition:
class.InternalDomainService.php:25
ILIAS\Blog\Settings
Definition:
class.BlockSettingsGUI.php:21
OrderingRetrieval
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI
Definition:
class.BlockSettingsGUI.php:33
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsManager
Definition:
SettingsManager.php:27
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
OrderingRetrieval
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\__construct
__construct(protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $obj_id, protected bool $in_repository)
Definition:
class.BlockSettingsGUI.php:37
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\$settings
SettingsManager $settings
Definition:
class.BlockSettingsGUI.php:35
ILIAS\Repository\settings
settings()
Definition:
trait.GlobalDICDomainServices.php:96
ILIAS\Data\URI
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
$lng
global $lng
Definition:
privfeed.php:31
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\executeCommand
executeCommand()
Definition:
class.BlockSettingsGUI.php:47
Ordering
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\getTable
getTable()
Definition:
class.BlockSettingsGUI.php:68
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\edit
edit()
Definition:
class.BlockSettingsGUI.php:61
$r
$r
Definition:
shib_logout.php:140
components
ILIAS
Blog
Settings
class.BlockSettingsGUI.php
Generated on Thu Apr 10 2025 23:02:42 for ILIAS by
1.8.13 (using
Doxyfile
)