ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLanguageSetupAgent.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
7use ILIAS\UI;
8
10{
14 protected $refinery;
15
20
21 public function __construct(
22 Refinery\Factory $refinery,
23 $_, // this is Data\Factory, but we do not need it...
25 ) {
26 $this->refinery = $refinery;
27 $this->il_setup_language = $il_setup_language;
28 }
29
33 public function hasConfig() : bool
34 {
35 return true;
36 }
37
41 public function getConfigInput(Setup\Config $config = null) : UI\Component\Input\Field\Input
42 {
43 throw new \LogicException("Not yet implemented.");
44 }
45
50 {
51 return $this->refinery->custom()->transformation(function ($data) {
52 if (!isset($data["default_language"])) {
53 $data["default_language"] = "en";
54 }
55 return new \ilLanguageSetupConfig(
56 $data["default_language"],
57 $data["install_languages"] ?? [$data["default_language"]],
58 $data["install_local_languages"] ?? []
59 );
60 });
61 }
62
66 public function getInstallObjective(Setup\Config $config = null) : Setup\Objective
67 {
69 "Complete objectives from Services/Language",
70 false,
72 new ilLanguagesInstalledObjective($config, $this->il_setup_language),
74 );
75 }
76
80 public function getUpdateObjective(Setup\Config $config = null) : Setup\Objective
81 {
82 return new Setup\NullObjective();
83 }
84
88 public function getBuildArtifactObjective() : Setup\Objective
89 {
90 return new Setup\NullObjective();
91 }
92}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
A non-objective, nothing to do to achieve it...
A objective collection is a objective that is achieved once all subobjectives are achieved.
__construct(Refinery\Factory $refinery, $_, \ilSetupLanguage $il_setup_language)
getInstallObjective(Setup\Config $config=null)
getUpdateObjective(Setup\Config $config=null)
getConfigInput(Setup\Config $config=null)
language handling for setup
A transformation is a function from one datatype to another.
A agent is some component that performs part of the setup process.
Definition: Agent.php:14
A configuration for the setup.
Definition: Config.php:11
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:15
A component is the most general form of an entity in the UI.
Definition: Component.php:14
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class Factory.
$data
Definition: storeScorm.php:23