ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilOrgUnitDefaultPermissionFormGUI Class Reference

Class ilOrgUnitDefaultPermissionFormGUI. More...

+ Inheritance diagram for ilOrgUnitDefaultPermissionFormGUI:
+ Collaboration diagram for ilOrgUnitDefaultPermissionFormGUI:

Public Member Functions

 __construct (BaseCommands $parent_gui, array $ilOrgUnitPermissions)
 ilOrgUnitDefaultPermissionFormGUI constructor. More...
 
 saveObject ()
 
 fillForm ()
 
 getIlOrgUnitPermissions ()
 
 setIlOrgUnitPermissions ($ilOrgUnitPermissions)
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var, $a_remove_unused_headers=false)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ( $a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 Get HTML. More...
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Data Fields

const F_OPERATIONS = 'operations'
 

Protected Member Functions

 initButtons ()
 
 initFormElements ()
 
 fillObject ()
 
 dic ()
 
 txt ($key)
 
- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Protected Attributes

 $parent_gui
 
 $ilOrgUnitPermissions = []
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitDefaultPermissionFormGUI::__construct ( BaseCommands  $parent_gui,
array  $ilOrgUnitPermissions 
)

ilOrgUnitDefaultPermissionFormGUI constructor.

Parameters
\ILIAS\Modules\OrgUnit\ARHelper\BaseCommands$parent_gui
ilOrgUnitPermission[]$ilOrgUnitPermissions

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

30 {
31 $this->parent_gui = $parent_gui;
32 $this->ilOrgUnitPermissions = $ilOrgUnitPermissions;
33 $this->dic()->ctrl()->saveParameter($parent_gui, 'arid');
34 $this->setFormAction($this->dic()->ctrl()->getFormAction($this->parent_gui));
35 $this->initFormElements();
36 $this->initButtons();
37 $this->setTarget('_top');
38 parent::__construct();
39 }
setTarget($a_target)
Set Target.
setFormAction($a_formaction)
Set FormAction.
getFormAction()
Get FormAction.

References $ilOrgUnitPermissions, $parent_gui, dic(), ilFormGUI\getFormAction(), initButtons(), initFormElements(), ilFormGUI\setFormAction(), and ilFormGUI\setTarget().

+ Here is the call graph for this function:

Member Function Documentation

◆ dic()

ilOrgUnitDefaultPermissionFormGUI::dic ( )
protected
Returns
\ILIAS\DI\Container

Definition at line 143 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

144 {
145 return $GLOBALS["DIC"];
146 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ fillForm()

ilOrgUnitDefaultPermissionFormGUI::fillForm ( )

Definition at line 86 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

87 {
88 $operations = array();
89 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
90 $context = $ilOrgUnitPermission->getContext()->getContext();
91 foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
92 $id = $operation->getOperationId();
93 $operations["operations[{$context}][{$id}]"] = $ilOrgUnitPermission->isOperationIdSelected($operation->getOperationId());
94 }
95 }
96 $this->setValuesByArray($operations);
97 }
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.

References ilFormGUI\$id, and ilPropertyFormGUI\setValuesByArray().

+ Here is the call graph for this function:

◆ fillObject()

ilOrgUnitDefaultPermissionFormGUI::fillObject ( )
protected

Definition at line 100 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

101 {
102 if (!$this->checkInput()) {
103 return false;
104 }
105 $sent_operation_ids = $this->getInput(self::F_OPERATIONS);
106 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
107 $operations = [];
108 $context = $ilOrgUnitPermission->getContext()->getContext();
109 foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
110 $id = $operation->getOperationId();
111 if ($sent_operation_ids[$context][$id]) {
112 $operations[] = ilOrgUnitOperation::find($id);
113 }
114 }
115 $ilOrgUnitPermission->setOperations($operations);
116 }
117
118 return true;
119 }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
checkInput()
Check Post Input.

References ilFormGUI\$id, ilPropertyFormGUI\checkInput(), and ilPropertyFormGUI\getInput().

Referenced by saveObject().

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

◆ getIlOrgUnitPermissions()

ilOrgUnitDefaultPermissionFormGUI::getIlOrgUnitPermissions ( )
Returns
\ilOrgUnitPermission[]

Definition at line 125 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

126 {
128 }

References $ilOrgUnitPermissions.

◆ initButtons()

ilOrgUnitDefaultPermissionFormGUI::initButtons ( )
protected

Definition at line 58 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

59 {
60 $this->setTitle($this->txt("form_title_org_default_permissions_"
61 . BaseCommands::CMD_UPDATE));
62 $this->addCommandButton(BaseCommands::CMD_UPDATE, $this->txt('save', true));
63 $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
64 }
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
setTitle($a_title)
Set Title.

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\setTitle(), and txt().

Referenced by __construct().

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

◆ initFormElements()

ilOrgUnitDefaultPermissionFormGUI::initFormElements ( )
protected

Definition at line 67 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

68 {
69 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
71 $context = $ilOrgUnitPermission->getContext()->getContext();
72 $header->setTitle($this->txt("obj_{$context}", false));
73 $this->addItem($header);
74
75 // Checkboxes
76 foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
77 $title = $this->txt("org_op_{$operation->getOperationString()}", false);
78 $id = $operation->getOperationId();
79 $cb = new ilCheckboxInputGUI($title, "operations[{$context}][{$id}]");
80 $this->addItem($cb);
81 }
82 }
83 }
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).

References $header, ilFormGUI\$id, $title, ilPropertyFormGUI\addItem(), and txt().

Referenced by __construct().

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

◆ saveObject()

ilOrgUnitDefaultPermissionFormGUI::saveObject ( )
Returns
int ID of the object

Definition at line 45 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

46 {
47 if (!$this->fillObject()) {
48 return false;
49 }
50 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
51 $ilOrgUnitPermission->update();
52 }
53
54 return true;
55 }

References fillObject().

+ Here is the call graph for this function:

◆ setIlOrgUnitPermissions()

ilOrgUnitDefaultPermissionFormGUI::setIlOrgUnitPermissions (   $ilOrgUnitPermissions)
Parameters
\ilOrgUnitPermission[]$ilOrgUnitPermissions

Definition at line 134 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

135 {
136 $this->ilOrgUnitPermissions = $ilOrgUnitPermissions;
137 }

References $ilOrgUnitPermissions.

◆ txt()

ilOrgUnitDefaultPermissionFormGUI::txt (   $key)
protected
Parameters
$key
Returns
mixed

Definition at line 154 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

155 {
156 return $this->parent_gui->txt($key);
157 }
$key
Definition: croninfo.php:18

References $key.

Referenced by initButtons(), and initFormElements().

+ Here is the caller graph for this function:

Field Documentation

◆ $ilOrgUnitPermissions

ilOrgUnitDefaultPermissionFormGUI::$ilOrgUnitPermissions = []
protected

◆ $parent_gui

ilOrgUnitDefaultPermissionFormGUI::$parent_gui
protected

Definition at line 16 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

Referenced by __construct().

◆ F_OPERATIONS

const ilOrgUnitDefaultPermissionFormGUI::F_OPERATIONS = 'operations'

Definition at line 12 of file class.ilOrgUnitDefaultPermissionFormGUI.php.


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