Skip to content

Commit

Permalink
Cron: Support KS/UI forms
Browse files Browse the repository at this point in the history
With this commit cron job implementations
are allowed to migrate from legacy forms
to the UI/KS forms.

An instance of `ilCronJob` can provide a
boolean `false` when overriding `usesLegacyForms`
and then simply provide own implementations of
`getCustomConfigurationSections` and
`saveCustomConfiguration`.
  • Loading branch information
mjansenDatabay committed Dec 16, 2024
1 parent 7933da7 commit d6f0951
Show file tree
Hide file tree
Showing 2 changed files with 283 additions and 62 deletions.
35 changes: 35 additions & 0 deletions components/ILIAS/Cron/classes/class.ilCronJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,45 @@ public function hasCustomSettings(): bool
return false;
}

/**
* @deprecated
*/
#[\Deprecated('Will be removed without any alternative, KS/UI forms will be expected', since: '13.0')]
public function usesLegacyForms(): bool
{
return true;
}

/**
* @return array<string, \ILIAS\UI\Component\Input\Field\Section> A map of sections to be added to the configuratio form
*/
public function getCustomConfigurationSections(
\ILIAS\UI\Factory $ui_factory,
\ILIAS\Refinery\Factory $factory,
ilLanguage $lng
): array {
return [];
}

/**
* @deprecated
*/
#[\Deprecated('Will be removed without any alternative, KS/UI forms will be expected', since: '13.0')]
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form): void
{
}

/**
* @param array<string, mixed> $group_data data of the that group as array, as processed by the KS
*/
public function saveCustomConfiguration(array $form_data): void
{
}

/**
* @deprecated
*/
#[\Deprecated('Will be removed without any alternative, KS/UI forms will be expected', since: '13.0')]
public function saveCustomSettings(ilPropertyFormGUI $a_form): bool
{
return true;
Expand Down
Loading

0 comments on commit d6f0951

Please sign in to comment.