80 $txt =
function ($id) :
string {
81 return $this->lng->txt($id);
84 return $this->ui_fa->input();
87 $title =
$f()->field()->text(
$txt(
'sub_title_default'),
$txt(
'sub_title_default_byline'));
88 if (!$this->item_facade->isEmpty()) {
89 $title = $title->withValue($this->item_facade->getDefaultTitle());
91 $items[self::F_TITLE] = $title;
94 if (($this->item_facade->isEmpty() || $this->item_facade->isCustom())) {
96 $type =
$f()->field()->switchableGroup($type_groups,
$txt(
'sub_type'),
$txt(
'sub_type_byline'))->withRequired(
true);
97 if (!$this->item_facade->isEmpty()) {
98 $string = $this->item_facade->getType() ===
'' ? Link::class : $this->item_facade->getType();
103 $items[self::F_TYPE] =
$type;
107 if ($this->item_facade->supportsCustomIcon()) {
110 ->withByline(
$txt(
'sub_icon_byline'))
113 if ($this->item_facade->getIconID() !== null) {
114 $icon = $icon->withValue([$this->item_facade->getIconID()]);
117 $items[self::F_ICON] = $icon;
121 $parent =
$f()->field()->select(
$txt(
'sub_parent'), $this->
repository->getPossibleParentsForFormAndTable())
122 ->withRequired(
true);
123 if (!$this->item_facade->isEmpty() && !$this->item_facade->isInLostItem()) {
124 $parent = $parent->withValue($this->item_facade->getParentIdentificationString());
126 $array = array_keys($this->
repository->getPossibleParentsForFormAndTable());
127 $parent = $parent->withValue(reset($array));
129 $items[self::F_PARENT] = $parent;
132 $active =
$f()->field()->checkbox(
$txt(
'sub_active'),
$txt(
'sub_active_byline'));
133 $active = $active->withValue($this->item_facade->isActivated());
134 $items[self::F_ACTIVE] = $active;
137 if($this->item_facade->supportsRoleBasedVisibility()) {
139 $value_role_based_visibility = NULL;
140 $global_roles =
$access->getGlobalRoles();
141 $global_role_ids = $this->item_facade->getGlobalRoleIDs();
142 if($this->item_facade->hasRoleBasedVisibility() && !empty($global_role_ids)) {
144 $value_role_based_visibility[0] = array_intersect(
146 array_keys($global_roles)
149 $role_based_visibility =
$f()->field()->optionalGroup(
151 $f()->field()->multiSelect(
152 $txt(
'sub_global_roles'),
154 )->withRequired(
true)
156 $txt(
'sub_role_based_visibility'),
157 $txt(
'sub_role_based_visibility_byline')
158 )->withValue($value_role_based_visibility);
159 $items[self::F_ROLE_BASED_VISIBILITY] = $role_based_visibility;
163 if ($this->item_facade->isEmpty()) {
165 $this->form =
$f()->container()->form()
169 $this->form =
$f()->container()->form()
Class ilMMUploadHandlerGUI.