ILIAS  release_8 Revision v8.24
ilOrgUnitDefaultPermissionFormGUI Class Reference

Class ilOrgUnitDefaultPermissionFormGUI. More...

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

Public Member Functions

 __construct (BaseCommands $parent_gui, array $ilOrgUnitPermissionsFilter, ilObjectDefinition $objectDefinition)
 ilOrgUnitDefaultPermissionFormGUI constructor. More...
 
 saveObject ()
 
 fillForm ()
 
 getIlOrgUnitPermissions ()
 
 setIlOrgUnitPermissions (array $ilOrgUnitPermissions)
 
- 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_OPERATIONS = 'operations'
 

Protected Member Functions

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

Protected Attributes

BaseCommands $parent_gui
 
array $ilOrgUnitPermissions = []
 
ilObjectDefinition $objectDefinition
 
ilLanguage $language
 
- 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 ()
 
 initFormElements ()
 
 fillObject ()
 
 dic ()
 
 txt (string $key)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitDefaultPermissionFormGUI::__construct ( BaseCommands  $parent_gui,
array  $ilOrgUnitPermissionsFilter,
ilObjectDefinition  $objectDefinition 
)

ilOrgUnitDefaultPermissionFormGUI constructor.

Parameters
\ILIAS\Modules\OrgUnit\ARHelper\BaseCommands$parent_gui
ilOrgUnitPermission[]$ilOrgUnitPermissionsFilter
ilObjectDefinition$objectDefinition

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

44 {
45 global $DIC;
46 $this->parent_gui = $parent_gui;
47 $this->language = $DIC->language();
48 $this->ilOrgUnitPermissions = $ilOrgUnitPermissionsFilter;
49 $this->dic()->ctrl()->saveParameter($parent_gui, 'arid');
50 $this->setFormAction($this->dic()->ctrl()->getFormAction($this->parent_gui));
52 $this->initFormElements();
53 $this->initButtons();
54 $this->setTarget('_top');
56 }
setFormAction(string $a_formaction)
setTarget(string $a_target)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, $objectDefinition, $parent_gui, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), dic(), ilFormGUI\getFormAction(), initButtons(), initFormElements(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Repository\objectDefinition(), ilFormGUI\setFormAction(), and ilFormGUI\setTarget().

+ Here is the call graph for this function:

Member Function Documentation

◆ dic()

ilOrgUnitDefaultPermissionFormGUI::dic ( )
private

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

158 {
159 return $GLOBALS["DIC"];
160 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32

References $GLOBALS.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ fillForm()

ilOrgUnitDefaultPermissionFormGUI::fillForm ( )

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

101 : void
102 {
103 $operations = array();
104 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
105 $ilOrgUnitPermission->afterObjectLoad();
106 if ($ilOrgUnitPermission->getContext() !== null) {
107 $context = $ilOrgUnitPermission->getContext()->getContext();
108 foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
109 $id = $operation->getOperationId();
110 $operations["operations[{$context}][{$id}]"] = $ilOrgUnitPermission->isOperationIdSelected($operation->getOperationId());
111 }
112 }
113 }
114 $this->setValuesByArray($operations);
115 }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
$context
Definition: webdav.php:29

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

+ Here is the call graph for this function:

◆ fillObject()

ilOrgUnitDefaultPermissionFormGUI::fillObject ( )
private

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

117 : bool
118 {
119 if (!$this->checkInput()) {
120 return false;
121 }
122 $sent_operation_ids = ($this->getInput(self::F_OPERATIONS) != '') ? $this->getInput(self::F_OPERATIONS) : [];
123 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
124 $operations = [];
125 $ilOrgUnitPermission->afterObjectLoad();
126 if ($ilOrgUnitPermission->getContext()) {
127 $context = $ilOrgUnitPermission->getContext()->getContext();
128 foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
129 $id = $operation->getOperationId();
130 if (isset($sent_operation_ids[$context][$id])) {
131 $operations[] = ilOrgUnitOperation::find($id);
132 }
133 }
134 $ilOrgUnitPermission->setOperations($operations);
135 }
136 }
137
138 return true;
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-...

References $context, 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 ( )

◆ getTitleForFormHeaderByContext()

ilOrgUnitDefaultPermissionFormGUI::getTitleForFormHeaderByContext ( string  $context)
protected

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

168 {
169 $lang_code = "obj_{$context}";
170 if ($this->objectDefinition->isPlugin($context)) {
171 return ilObjectPlugin::lookupTxtById($context, $lang_code);
172 }
173
174 return $this->txt($lang_code);
175 }
static lookupTxtById(string $plugin_id, string $lang_var)

References $context, ilObjectPlugin\lookupTxtById(), ILIAS\Repository\objectDefinition(), and txt().

Referenced by initFormElements().

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

◆ initButtons()

ilOrgUnitDefaultPermissionFormGUI::initButtons ( )
private

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

70 : void
71 {
72 $this->setTitle($this->txt("form_title_org_default_permissions_"
73 . BaseCommands::CMD_UPDATE));
74 $this->addCommandButton(BaseCommands::CMD_UPDATE, $this->txt('save', true));
75 $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
76 }
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

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 ( )
private

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

78 : void
79 {
80 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
81 $ilOrgUnitPermission->afterObjectLoad();
82 if ($ilOrgUnitPermission->getContext() !== null) {
83 $header = new ilFormSectionHeaderGUI();
84 $context = $ilOrgUnitPermission->getContext()->getContext();
85 $header->setTitle($this->getTitleForFormHeaderByContext($context));
86 $this->addItem($header);
87 }
88
89
90
91 // Checkboxes
92 foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
93 $title = $this->txt("org_op_{$operation->getOperationString()}");
94 $id = $operation->getOperationId();
95 $cb = new ilCheckboxInputGUI($title, "operations[{$context}][{$id}]");
96 $this->addItem($cb);
97 }
98 }
99 }
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

Referenced by __construct().

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

◆ saveObject()

ilOrgUnitDefaultPermissionFormGUI::saveObject ( )

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

58 : bool
59 {
60 if ($this->fillObject() === false) {
61 return false;
62 }
63 foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
64 $ilOrgUnitPermission->update();
65 }
66
67 return true;
68 }

References fillObject().

+ Here is the call graph for this function:

◆ setIlOrgUnitPermissions()

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

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

152 : void
153 {
154 $this->ilOrgUnitPermissions = $ilOrgUnitPermissions;
155 }

References $ilOrgUnitPermissions.

◆ txt()

ilOrgUnitDefaultPermissionFormGUI::txt ( string  $key)
private

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

162 : string
163 {
164 return $this->language->txt($key);
165 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by getTitleForFormHeaderByContext(), initButtons(), and initFormElements().

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

Field Documentation

◆ $ilOrgUnitPermissions

array ilOrgUnitDefaultPermissionFormGUI::$ilOrgUnitPermissions = []
protected

◆ $language

ilLanguage ilOrgUnitDefaultPermissionFormGUI::$language
protected

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

◆ $objectDefinition

ilObjectDefinition ilOrgUnitDefaultPermissionFormGUI::$objectDefinition
protected

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

Referenced by __construct().

◆ $parent_gui

BaseCommands ilOrgUnitDefaultPermissionFormGUI::$parent_gui
protected

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

Referenced by __construct().

◆ F_OPERATIONS

const ilOrgUnitDefaultPermissionFormGUI::F_OPERATIONS = 'operations'

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


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