19declare(strict_types=1);
29 protected \ILIAS\ILIASObject\Properties\Aggregator $object_prop;
33 $this->object_prop =
LocalDIC::dic()[
'properties.aggregator'];
40 $obj_prop = $this->object_prop->getFor($obj_id, $type);
42 ->getPropertyTitleAndDescription()
43 ->toForm($this->
lng, $this->
ui->factory()->input()->field(), $this->refinery)->getInputs();
44 $this->addField(
"title",
$inputs[0]);
45 $this->addField(
"description",
$inputs[1]);
53 $obj_prop = $this->object_prop->getFor($obj_id, $type);
55 ->getPropertyTitleAndDescription()
56 ->toForm($this->
lng, $this->
ui->factory()->input()->field(), $this->refinery)->getInputs();
57 $this->addField(
"title",
$inputs[0]);
65 $obj_prop = $this->object_prop->getFor($obj_id, $type);
66 $obj_prop->storePropertyTitleAndDescription(
68 $this->getData(
"title"),
69 $this->getData(
"description")
78 $obj_prop = $this->object_prop->getFor($obj_id, $type);
79 $obj_prop->storePropertyTitleAndDescription(
81 $this->getData(
"title"),
91 $obj_prop = $this->object_prop->getFor($obj_id, $type);
92 $input = $obj_prop->getPropertyTileImage()
93 ->toForm($this->
lng, $this->
ui->factory()->input()->field(), $this->refinery);
94 $this->addField(
"tile", $input,
true);
102 $obj_prop = $this->object_prop->getFor($obj_id, $type);
103 $tile = $this->getData(
"tile");
104 if (!is_null($tile)) {
105 $obj_prop->storePropertyTileImage($this->getData(
"tile"));
113 $obj_prop = $this->object_prop->getFor($obj_id, $type);
114 $input = $obj_prop->getPropertyIsOnline()
115 ->toForm($this->
lng, $this->
ui->factory()->input()->field(), $this->refinery);
116 $this->addField(
"is_online", $input,
true);
124 $obj_prop = $this->object_prop->getFor($obj_id, $type);
125 $obj_prop->storePropertyIsOnline($this->getData(
"is_online"));
132 $start = $end = $visibility =
null;
134 $start = (
int) $activation[
"timing_start"];
135 $end = (
int) $activation[
"timing_end"];
136 $visibility = (bool) $activation[
"visible"];
138 $enabled = ($end > 0) || ($start > 0);
142 $lng->txt(
"rep_time_based_availability"),
148 $this->
lng->txt(
"rep_time_period"),
155 $this->
lng->txt(
"rep_activation_limited_visibility"),
165 $item = new \ilObjectActivation();
166 if (!$this->getData(
"limited")) {
169 $avail = $this->getData(
"availability");
171 if (!is_null($avail) && !is_null($avail[0])) {
172 $from = $avail[0]->getUnixTime();
174 if (!is_null($avail) && !is_null($avail[1])) {
175 $to = $avail[1]->getUnixTime();
177 if ($from > 0 || $to > 0) {
179 $item->setTimingStart($from);
180 $item->setTimingEnd($to);
181 $item->toggleVisible($this->getData(
"visibility"));
198 $lng->loadLanguageModule(
"obj");
200 $form = $this->section(
"add",
$lng->txt(
"obj_features"));
204 $form = $this->checkbox(
206 $lng->txt(
'obj_tool_setting_custom_metadata'),
207 $lng->txt(
'obj_tool_setting_custom_metadata_info'),
217 $form = $this->checkbox(
219 $lng->txt(
'obj_tool_setting_taxonomies'),
238 if (in_array($key, $services)) {
243 if (in_array($key, $services)) {
252 array $additional_template_options = []
257 $additional_template_options
264 if (!$creation_mode) {
270 ) || ($existing_exclusive && $current_value ==
"dtpl_0")) {
272 $options[$current_value] = [$this->
lng->txt(
'not_available')];
275 if ($existing_exclusive) {
278 $current_value = $keys[1];
280 $current_value =
'dtpl_0';
284 $form = $this->radio(
286 $this->
lng->txt(
'type'),
297 $form = $this->radioOption(
309 array $additional_template_options = []
311 $this->
lng->loadLanguageModule(
'didactic');
312 $existing_exclusive =
false;
315 $this->
lng->txt(
'didactic_default_type'),
317 $this->
lng->txt(
'didactic_default_type_info'),
318 $this->lng->txt(
'objs_' . $type)
324 foreach ($templates as $template) {
325 if ($template->isEffective((
int)
$ref_id)) {
326 $options[
"dtpl_" . $template->getId()] = [
327 $template->getPresentationTitle(),
328 $template->getPresentationDescription()
331 if ($template->isExclusive()) {
332 $existing_exclusive =
true;
338 return [$existing_exclusive, array_merge(
$options, $additional_template_options)];
345 array $additional_template_options = []
350 $additional_template_options
360 $new_tpl_id = (
int) substr($this->getData(
'didactic_type'), 5);
362 if ($new_tpl_id !== $current_tpl_id) {
364 $this->
ctrl->setParameterByClass(\ilDidacticTemplateGUI::class,
"didactic_template_id", $new_tpl_id);
365 $this->
ctrl->redirectByClass([$gui_class, \ilDidacticTemplateGUI::class],
"confirmTemplateSwitch");
373 if ($this->
http->wrapper()->query()->has(
'didactic_template_id')) {
374 $new_tpl_id = $this->
http->wrapper()->query()->retrieve(
375 'didactic_template_id',
378 $this->
ctrl->saveParameterByClass(\ilDidacticTemplateGUI::class,
"didactic_template_id", $new_tpl_id);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Customizing of pimple-DIC for ILIAS.
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static lookupTemplateId(int $a_ref_id)
static getInstanceByObjectType(string $a_obj_type)
const TIMINGS_DEACTIVATED
static getItem(int $ref_id)
GUI class for service settings (calendar, notes, comments)
static http()
Fetches the global http state from ILIAS.