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

Class ilStudyProgrammeTypeAdvancedMetaDataFormGUI. More...

+ Inheritance diagram for ilStudyProgrammeTypeAdvancedMetaDataFormGUI:
+ Collaboration diagram for ilStudyProgrammeTypeAdvancedMetaDataFormGUI:

Public Member Functions

 __construct (string $form_action, protected ilStudyProgrammeTypeRepository $type_repository, ilGlobalTemplateInterface $tpl, protected ilLanguage $lng)
 
 saveObject (ilStudyProgrammeType $type)
 
 fillForm (ilStudyProgrammeType $type)
 Add all fields to the form. 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 Member Functions

 fillObject (ilStudyProgrammeType $type)
 Check validity of form and pass values from form to object. More...
 
- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 
 checkForRequiredField ()
 

Additional Inherited Members

- 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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeTypeAdvancedMetaDataFormGUI::__construct ( string  $form_action,
protected ilStudyProgrammeTypeRepository  $type_repository,
ilGlobalTemplateInterface  $tpl,
protected ilLanguage  $lng 
)

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

33 {
35
36 $this->global_tpl = $tpl;
37 $this->lng->loadLanguageModule('meta');
38 $this->initForm($form_action);
39 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilPropertyFormGUI\$tpl, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilStudyProgrammeTypeAdvancedMetaDataFormGUI::fillForm ( ilStudyProgrammeType  $type)

Add all fields to the form.

Definition at line 72 of file class.ilStudyProgrammeTypeAdvancedMetaDataFormGUI.php.

72 : void
73 {
74 $records_selected = $this->type_repository->getAssignedAMDRecordIdsByType($type->getId());
75 $item = $this->getItemByPostVar('amd_records');
76 $item->setValue($records_selected);
77 }
getItemByPostVar(string $a_post_var)

References ilStudyProgrammeType\getId(), and ilPropertyFormGUI\getItemByPostVar().

+ Here is the call graph for this function:

◆ fillObject()

ilStudyProgrammeTypeAdvancedMetaDataFormGUI::fillObject ( ilStudyProgrammeType  $type)
protected

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

Definition at line 82 of file class.ilStudyProgrammeTypeAdvancedMetaDataFormGUI.php.

83 {
84 $this->setValuesByPost();
85 if (!$this->checkInput()) {
86 return null;
87 }
88 try {
89 // Assign and deassign amd records. A plugin could prevent those actions.
90 $record_ids_selected = (array) $this->getInput('amd_records');
91 $record_ids = $this->type_repository->getAssignedAMDRecordIdsByType($type->getId(), true);
92 $record_ids_removed = array_diff($record_ids, $record_ids_selected);
93 $record_ids_added = array_diff($record_ids_selected, $record_ids);
94 foreach ($record_ids_added as $record_id) {
95 $type->assignAdvancedMDRecord((int) $record_id);
96 }
97 foreach ($record_ids_removed as $record_id) {
98 $type->deassignAdvancedMdRecord((int) $record_id);
99 }
100 } catch (ilException $e) {
101 $this->global_tpl->setOnScreenMessage("failure", $e->getMessage());
102 return null;
103 }
104 return $type;
105 }
Base class for ILIAS Exception handling.
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-...
Class ilStudyProgrammeType.

References Vendor\Package\$e, ilPropertyFormGUI\checkInput(), ilStudyProgrammeType\getId(), ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\setValuesByPost().

Referenced by saveObject().

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

◆ saveObject()

ilStudyProgrammeTypeAdvancedMetaDataFormGUI::saveObject ( ilStudyProgrammeType  $type)

Definition at line 41 of file class.ilStudyProgrammeTypeAdvancedMetaDataFormGUI.php.

41 : bool
42 {
43 $type = $this->fillObject($type);
44 if (!$type) {
45 return false;
46 }
47 $this->type_repository->updateType($type);
48 return true;
49 }
fillObject(ilStudyProgrammeType $type)
Check validity of form and pass values from form to object.

References fillObject().

+ Here is the call graph for this function:

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