ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjOrgUnitSettingsFormGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjOrgUnitSettingsFormGUI:
+ Collaboration diagram for ilObjOrgUnitSettingsFormGUI:

Public Member Functions

 __construct (ilObjectGUI $parent_gui, ilObjOrgUnit $obj_orgu)
 
 saveObject ()
 Update object. More...
 
- 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 ()
 

Protected Attributes

ilObjOrgUnit $obj_orgu
 
ilObjectGUI $parent_gui
 
- 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

 fillObject ()
 Check validity of form and pass values from form to object. More...
 
 updateTranslation ()
 Update title and description for the default language of translation. More...
 

Additional Inherited Members

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

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjOrgUnitSettingsFormGUI

Author
Stefan Wanzenried sw@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 23 of file class.ilObjOrgUnitSettingsFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjOrgUnitSettingsFormGUI::__construct ( ilObjectGUI  $parent_gui,
ilObjOrgUnit  $obj_orgu 
)

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

References $DIC, ilPropertyFormGUI\$lng, $obj_orgu, $parent_gui, ilPropertyFormGUI\$tpl, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

29  {
30  global $DIC;
31 
33  $tpl = $DIC['tpl'];
34  $ilCtrl = $DIC['ilCtrl'];
35  $lng = $DIC['lng'];
36  $ilUser = $DIC['ilUser'];
37  $this->parent_gui = $parent_gui;
38  $this->obj_orgu = $obj_orgu;
39 
40  //$this->tpl = $tpl;
41  $this->ctrl = $ilCtrl;
42  $this->lng = $lng;
43  $this->user = $ilUser;
44  $this->initForm();
45  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillObject()

ilObjOrgUnitSettingsFormGUI::fillObject ( )
private

Check validity of form and pass values from form to object.

Returns
bool

Definition at line 109 of file class.ilObjOrgUnitSettingsFormGUI.php.

References ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\setValuesByPost().

Referenced by saveObject().

109  : bool
110  {
111  $this->setValuesByPost();
112  if (!$this->checkInput()) {
113  return false;
114  }
115  $this->obj_orgu->setOrgUnitTypeId($this->getInput('orgu_type'));
116  $this->obj_orgu->setImportId($this->getInput('ext_id'));
117  $this->obj_orgu->setTitle($this->getInput('title'));
118  $this->obj_orgu->setDescription($this->getInput('description'));
119 
120  return true;
121  }
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-...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilObjOrgUnitSettingsFormGUI::saveObject ( )

Update object.

Returns
bool

Definition at line 51 of file class.ilObjOrgUnitSettingsFormGUI.php.

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), fillObject(), ilOrgUnitType\getAllTypes(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilSelectInputGUI\setOptions(), ilPropertyFormGUI\setTitle(), ilTextAreaInputGUI\setValue(), and updateTranslation().

52  {
53  if (!$this->fillObject()) {
54  return false;
55  }
56  $this->obj_orgu->update();
57  $this->updateTranslation();
58 
59  return true;
60  }
fillObject()
Check validity of form and pass values from form to object.
updateTranslation()
Update title and description for the default language of translation.
+ Here is the call graph for this function:

◆ updateTranslation()

ilObjOrgUnitSettingsFormGUI::updateTranslation ( )
private

Update title and description for the default language of translation.

Definition at line 126 of file class.ilObjOrgUnitSettingsFormGUI.php.

References ilPropertyFormGUI\getInput(), and ILIAS\Repository\user().

Referenced by saveObject().

126  : void
127  {
128  $translations = $this->obj_orgu->getTranslations();
129  $lang_code_default = '';
130  $lang_codes = array();
131  foreach ($translations as $translation) {
132  if ($translation['default']) {
133  $lang_code_default = $translation['lang'];
134  }
135  $lang_codes[] = $translation['lang'];
136  }
137  $lang_code = (in_array($this->user->getLanguage(), $lang_codes, true)) ? $this->user->getLanguage() : $lang_code_default;
138  $this->obj_orgu->updateTranslation($this->getInput('title'), $this->getInput('description'), $lang_code, 0);
139  }
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-...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $obj_orgu

ilObjOrgUnit ilObjOrgUnitSettingsFormGUI::$obj_orgu
protected

Definition at line 25 of file class.ilObjOrgUnitSettingsFormGUI.php.

Referenced by __construct().

◆ $parent_gui

ilObjectGUI ilObjOrgUnitSettingsFormGUI::$parent_gui
protected

Definition at line 26 of file class.ilObjOrgUnitSettingsFormGUI.php.

Referenced by __construct().


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