ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilOrgUnitPositionFormGUI Class Reference

Class ilOrgUnitPositionFormGUI. More...

+ Inheritance diagram for ilOrgUnitPositionFormGUI:
+ Collaboration diagram for ilOrgUnitPositionFormGUI:

Public Member Functions

 __construct (BaseCommands $parent_gui, \ilOrgUnitPosition $object)
 
 fillForm ()
 
 saveObject ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Data Fields

const F_AUTHORITIES = "authorities"
 
const F_TITLE = 'title'
 
const F_DESCRIPTION = 'description'
 

Protected Member Functions

 initFormElements ()
 
- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 
 checkForRequiredField ()
 

Protected Attributes

ilOrgUnitPosition $object
 
ilOrgUnitPositionDBRepository $positionRepo
 
BaseCommands $parent_gui
 
ILIAS DI Container $DIC
 
ilLanguage $lng
 
ilCtrl $ctrl
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Private Member Functions

 initButtons ()
 
 txt (string $key)
 
 infoTxt (string $key)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitPositionFormGUI::__construct ( BaseCommands  $parent_gui,
\ilOrgUnitPosition  $object 
)

Definition at line 39 of file class.ilOrgUnitPositionFormGUI.php.

References $dic, $DIC, $object, $parent_gui, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ilOrgUnitLocalDIC\dic(), initButtons(), initFormElements(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), and ilFormGUI\setTarget().

40  {
41  global $DIC;
42 
44  $this->positionRepo = $dic["repo.Positions"];
45 
46  $this->parent_gui = $parent_gui;
47  $this->object = $object;
48  $this->lng = $DIC->language();
49 
50  $this->ctrl = $DIC->ctrl();
51  $this->ctrl->saveParameter($parent_gui, 'arid');
52  $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
53  $this->initFormElements();
54  $this->initButtons();
55  $this->setTarget('_top');
56 
58  }
setTarget(string $a_target)
__construct(VocabulariesInterface $vocabularies)
setFormAction(string $a_formaction)
$dic
Definition: result.php:32
+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilOrgUnitPositionFormGUI::fillForm ( )

Definition at line 114 of file class.ilOrgUnitPositionFormGUI.php.

References ilFormGUI\$id, ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ILIAS\Repository\object(), and ilPropertyFormGUI\setValuesByArray().

114  : void
115  {
116  $array = [
117  self::F_TITLE => $this->object->getTitle(),
118  self::F_DESCRIPTION => $this->object->getDescription(),
119  self::F_AUTHORITIES => $this->object->getAuthoritiesAsArray()
120  ];
121  $this->setValuesByArray($array);
122  }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
+ Here is the call graph for this function:

◆ infoTxt()

ilOrgUnitPositionFormGUI::infoTxt ( string  $key)
private

Definition at line 176 of file class.ilOrgUnitPositionFormGUI.php.

References ILIAS\Repository\lng().

176  : string
177  {
178  return $this->lng->txt($key . '_info');
179  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ initButtons()

ilOrgUnitPositionFormGUI::initButtons ( )
private

Definition at line 101 of file class.ilOrgUnitPositionFormGUI.php.

References ilPropertyFormGUI\addCommandButton(), ILIAS\Repository\object(), ilPropertyFormGUI\setTitle(), and txt().

Referenced by __construct().

101  : void
102  {
103  if (!$this->object->getId()) {
104  $this->setTitle($this->txt('create'));
105  $this->addCommandButton(BaseCommands::CMD_CREATE, $this->txt(BaseCommands::CMD_CREATE));
106  $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
107  } else {
108  $this->setTitle($this->txt('update'));
109  $this->addCommandButton(BaseCommands::CMD_UPDATE, $this->txt(BaseCommands::CMD_UPDATE));
110  $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
111  }
112  }
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormElements()

ilOrgUnitPositionFormGUI::initFormElements ( )
protected

Definition at line 60 of file class.ilOrgUnitPositionFormGUI.php.

References $DIC, ilFormGUI\$id, $scope, $scopes, $txt, ilPropertyFormGUI\addItem(), ilOrgUnitAuthority\getScopes(), ilOrgUnitGenericMultiInputGUI\MULTI_FIELD_ID, ilOrgUnitGenericMultiInputGUI\MULTI_FIELD_OVER, ilOrgUnitGenericMultiInputGUI\MULTI_FIELD_SCOPE, ilOrgUnitAuthority\OVER_EVERYONE, ilSelectInputGUI\setOptions(), and ilOrgUnitGenericMultiInputGUI\setShowLabel().

Referenced by __construct().

60  : void
61  {
62  global $DIC;
63  $lng = $DIC->language();
64 
65  $te = new ilTextInputGUI($lng->txt(self::F_TITLE), self::F_TITLE);
66  $te->setRequired(true);
67  $this->addItem($te);
68 
69  $te = new ilTextAreaInputGUI($lng->txt(self::F_DESCRIPTION), self::F_DESCRIPTION);
70  $this->addItem($te);
71 
72  $m = new ilOrgUnitGenericMultiInputGUI($lng->txt(self::F_AUTHORITIES), self::F_AUTHORITIES);
73  $m->setShowLabel(true);
74  $m->setRenderOneForEmptyValue(false);
75  $m->setMulti(true);
76 
78  $m->addInput($id);
79 
81  $over_options = [];
82  $over_options[ilOrgUnitAuthority::OVER_EVERYONE] = $lng->txt('over_'
84  $over_options += $this->positionRepo->getArray('id', 'title');
85  $over->setOptions($over_options);
86  $m->addInput($over);
87 
88  $available_scopes = [];
89  foreach (ilOrgUnitAuthority::getScopes() as $scope) {
90  $txt = $lng->txt('scope_' . $scope);
91  $available_scopes[$scope] = $txt;
92  }
93 
95  $scopes->setOptions($available_scopes);
96  $m->addInput($scopes);
97 
98  $this->addItem($m);
99  }
$scope
Definition: ltiregstart.php:53
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$scopes
Definition: ltitoken.php:99
setOptions(array $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$txt
Definition: error.php:14
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilOrgUnitPositionFormGUI::saveObject ( )

Definition at line 161 of file class.ilOrgUnitPositionFormGUI.php.

161  : bool
162  {
163  if ($this->fillObject() === false) {
164  return false;
165  }
166 
167  $this->object = $this->positionRepo->store($this->object);
168  return true;
169  }

◆ txt()

ilOrgUnitPositionFormGUI::txt ( string  $key)
private

Definition at line 171 of file class.ilOrgUnitPositionFormGUI.php.

References ILIAS\Repository\lng().

Referenced by initButtons().

171  : string
172  {
173  return $this->lng->txt($key);
174  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilOrgUnitPositionFormGUI::$ctrl
protected

Definition at line 37 of file class.ilOrgUnitPositionFormGUI.php.

◆ $DIC

ILIAS DI Container ilOrgUnitPositionFormGUI::$DIC
protected

Definition at line 35 of file class.ilOrgUnitPositionFormGUI.php.

Referenced by __construct(), and initFormElements().

◆ $lng

ilLanguage ilOrgUnitPositionFormGUI::$lng
protected

Definition at line 36 of file class.ilOrgUnitPositionFormGUI.php.

◆ $object

ilOrgUnitPosition ilOrgUnitPositionFormGUI::$object
protected

Definition at line 29 of file class.ilOrgUnitPositionFormGUI.php.

Referenced by __construct().

◆ $parent_gui

BaseCommands ilOrgUnitPositionFormGUI::$parent_gui
protected

Definition at line 34 of file class.ilOrgUnitPositionFormGUI.php.

Referenced by __construct().

◆ $positionRepo

ilOrgUnitPositionDBRepository ilOrgUnitPositionFormGUI::$positionRepo
protected

Definition at line 32 of file class.ilOrgUnitPositionFormGUI.php.

◆ F_AUTHORITIES

const ilOrgUnitPositionFormGUI::F_AUTHORITIES = "authorities"

Definition at line 28 of file class.ilOrgUnitPositionFormGUI.php.

◆ F_DESCRIPTION

const ilOrgUnitPositionFormGUI::F_DESCRIPTION = 'description'

Definition at line 31 of file class.ilOrgUnitPositionFormGUI.php.

◆ F_TITLE

const ilOrgUnitPositionFormGUI::F_TITLE = 'title'

Definition at line 30 of file class.ilOrgUnitPositionFormGUI.php.


The documentation for this class was generated from the following file: