19declare(strict_types=1);
34 public const ARTIFACT =
"./Services/Help/artifacts/screen_id_map.php";
43 return "screen_id_map";
49 $finder =
new Setup\UsageOfAttributeFinder();
51 $get_name =
function (
string $class_name,
string $attribute_name): ?
string {
52 $reflection = new \ReflectionClass($class_name);
53 $attributes = $reflection->getAttributes($attribute_name);
54 if (empty($attributes) || !isset($attributes[0])) {
58 $attribute = $attributes[0]->newInstance();
59 return $attribute->getScreenId();
63 foreach ($finder->getMatchingClassNames(SilentHelpScreenId::class) as $matching_class_name) {
64 $map[$matching_class_name] =
null;
67 foreach ($finder->getMatchingClassNames(RecurringHelpScreenId::class) as $matching_class_name) {
68 $map[$matching_class_name] =
'*' . $get_name($matching_class_name, RecurringHelpScreenId::class);
71 foreach ($finder->getMatchingClassNames(HelpScreenId::class) as $matching_class_name) {
72 $map[$matching_class_name] = $get_name($matching_class_name, HelpScreenId::class);
76 $check = array_filter(array_diff_assoc($map, array_unique($map)),
function ($v):
bool {
80 throw new Setup\UnachievableException(
"Duplicate screen ids found: " . implode(
', ',
$check));
83 return new Setup\Artifact\ArrayArtifact($map);
Interface ModificationProvider.
Interface StaticMainMenuProvider.
Interface NotificationProvider.
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...