ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilOrgUnitPositionFormGUI Class Reference

Class ilOrgUnitPositionFormGUI. More...

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

Public Member Functions

 __construct (protected ?BaseCommands $parent_gui, protected \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

ilOrgUnitPositionDBRepository $positionRepo
 
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 ( protected ?BaseCommands  $parent_gui,
protected \ilOrgUnitPosition  $object 
)

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

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 $this->ctrl = $DIC->ctrl();
50
51 $action_cmd = $object->getId() > 0 ? BaseCommands::CMD_UPDATE : BaseCommands::CMD_CREATE;
52 $form_action = $parent_gui->getSinglePosLinkTarget($action_cmd, $object->getId());
53 $this->setFormAction($form_action);
54
55 $this->initFormElements();
56 $this->initButtons();
57 $this->setTarget('_top');
58
60 }
setFormAction(string $a_formaction)
setTarget(string $a_target)
$dic
Definition: ltiresult.php:33
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $dic, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilOrgUnitLocalDIC\dic(), ilOrgUnitPosition\getId(), initButtons(), initFormElements(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), and ilFormGUI\setTarget().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilOrgUnitPositionFormGUI::fillForm ( )

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

116 : void
117 {
118 $array = [
119 self::F_TITLE => $this->object->getTitle(),
120 self::F_DESCRIPTION => $this->object->getDescription(),
121 self::F_AUTHORITIES => $this->object->getAuthoritiesAsArray()
122 ];
123 $this->setValuesByArray($array);
124 }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)

References ilPropertyFormGUI\setValuesByArray().

+ Here is the call graph for this function:

◆ infoTxt()

ilOrgUnitPositionFormGUI::infoTxt ( string  $key)
private

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

178 : string
179 {
180 return $this->lng->txt($key . '_info');
181 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initButtons()

ilOrgUnitPositionFormGUI::initButtons ( )
private

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

103 : void
104 {
105 if (!$this->object->getId()) {
106 $this->setTitle($this->txt('create'));
107 $this->addCommandButton(BaseCommands::CMD_CREATE, $this->txt(BaseCommands::CMD_CREATE));
108 $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
109 } else {
110 $this->setTitle($this->txt('update'));
111 $this->addCommandButton(BaseCommands::CMD_UPDATE, $this->txt(BaseCommands::CMD_UPDATE));
112 $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
113 }
114 }
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormElements()

ilOrgUnitPositionFormGUI::initFormElements ( )
protected

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

62 : void
63 {
64 global $DIC;
65 $lng = $DIC->language();
66
67 $te = new ilTextInputGUI($lng->txt(self::F_TITLE), self::F_TITLE);
68 $te->setRequired(true);
69 $this->addItem($te);
70
71 $te = new ilTextAreaInputGUI($lng->txt(self::F_DESCRIPTION), self::F_DESCRIPTION);
72 $this->addItem($te);
73
74 $m = new ilOrgUnitGenericMultiInputGUI($lng->txt(self::F_AUTHORITIES), self::F_AUTHORITIES);
75 $m->setShowLabel(true);
76 $m->setRenderOneForEmptyValue(false);
77 $m->setMulti(true);
78
80 $m->addInput($id);
81
83 $over_options = [];
84 $over_options[ilOrgUnitAuthority::OVER_EVERYONE] = $lng->txt('over_'
86 $over_options += $this->positionRepo->getArray('id', 'title');
87 $over->setOptions($over_options);
88 $m->addInput($over);
89
90 $available_scopes = [];
92 $txt = $lng->txt('scope_' . $scope);
93 $available_scopes[$scope] = $txt;
94 }
95
97 $scopes->setOptions($available_scopes);
98 $m->addInput($scopes);
99
100 $this->addItem($m);
101 }
This class represents a hidden form 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...
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.
$txt
Definition: error.php:31
$scope
Definition: ltiregstart.php:51
$scopes
Definition: ltitoken.php:96

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilOrgUnitPositionFormGUI::saveObject ( )

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

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

◆ txt()

ilOrgUnitPositionFormGUI::txt ( string  $key)
private

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

173 : string
174 {
175 return $this->lng->txt($key);
176 }

References ILIAS\Repository\lng().

Referenced by initButtons().

+ 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 35 of file class.ilOrgUnitPositionFormGUI.php.

◆ $DIC

ILIAS DI Container ilOrgUnitPositionFormGUI::$DIC
protected

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

Referenced by __construct(), and initFormElements().

◆ $lng

ilLanguage ilOrgUnitPositionFormGUI::$lng
protected

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

Referenced by initFormElements().

◆ $positionRepo

ilOrgUnitPositionDBRepository ilOrgUnitPositionFormGUI::$positionRepo
protected

Definition at line 31 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 30 of file class.ilOrgUnitPositionFormGUI.php.

◆ F_TITLE

const ilOrgUnitPositionFormGUI::F_TITLE = 'title'

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


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