19 declare(strict_types=1);
45 if (!isset($this->positionRepo)) {
47 $this->positionRepo =
$dic[
"repo.Positions"];
58 $html = $this->render();
71 if (!is_array($authorities)) {
74 foreach ($authorities as $authority) {
85 $this->value = $a_value;
99 protected function render():
string 101 $tpl =
new ilTemplate(
"tpl.authority_input.html",
true,
true,
"components/ILIAS/OrgUnit");
115 $tpl->setVariable(
"POST_VAR",
$postvar);
120 $txt = $this->
dic()->language()->txt(
'scope_' . $scope);
121 $scope_html .=
"<option value='{$scope}'>{$txt}</option>";
123 $tpl->setVariable(
"SCOPE_OPTIONS", $scope_html);
127 $title = $this->
lang()->txt(
'over_' . $over_everyone);
128 $over_html =
"<option value='{$over_everyone}'>{$title}</option>";
130 $over_html .=
"<option value='{$id}'>{$title}</option>";
132 $tpl->setVariable(
"OVER_OPTIONS", $over_html);
146 $tpl->touchBlock(
"inline_in_bl");
163 $lang->loadLanguageModule(
'orgu');
175 protected function initJS():
void 182 $globalTpl->addJavascript(
"assets/js/authority.js");
184 $config = json_encode(array());
188 foreach ($authorities as $authority) {
190 'id' => $authority->getId(),
191 'over' => $authority->getOver(),
192 'scope' => $authority->getScope()
195 $data = json_encode($auth);
197 $globalTpl->addOnLoadCode(
"ilOrgUnitAuthorityInput.init({$config}, {$data});");
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Interface Observer Contains several chained tasks and infos about them.
setVariable($variable, $value='')
Sets a variable value.
Interface for multi values support.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)