ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ($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...
 
 setForceTopButtons ($a_val)
 Set force top buttons. More...
 
 getForceTopButtons ()
 Get force 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 ()
 
 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)
 
 getTitleForFormHeaderByContext (string $context)
 
- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Protected Attributes

 $parent_gui
 
 $ilOrgUnitPermissions = []
 
 $objectDefinition
 
- 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
 
 $force_top_buttons = 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  $ilOrgUnitPermissionsFilter,
ilObjectDefinition  $objectDefinition 
)

ilOrgUnitDefaultPermissionFormGUI constructor.

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

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

References $objectDefinition, $parent_gui, ILIAS\GlobalScreen\Provider\__construct(), dic(), ilFormGUI\getFormAction(), initButtons(), initFormElements(), ilFormGUI\setFormAction(), and ilFormGUI\setTarget().

37  {
38  $this->parent_gui = $parent_gui;
39  $this->ilOrgUnitPermissions = $ilOrgUnitPermissionsFilter;
40  $this->dic()->ctrl()->saveParameter($parent_gui, 'arid');
41  $this->setFormAction($this->dic()->ctrl()->getFormAction($this->parent_gui));
42  $this->objectDefinition = $objectDefinition;
43  $this->initFormElements();
44  $this->initButtons();
45  $this->setTarget('_top');
47  }
getFormAction()
Get FormAction.
setFormAction($a_formaction)
Set FormAction.
setTarget($a_target)
Set Target.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ dic()

ilOrgUnitDefaultPermissionFormGUI::dic ( )
protected
Returns

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

References $GLOBALS.

Referenced by __construct().

152  {
153  return $GLOBALS["DIC"];
154  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ fillForm()

ilOrgUnitDefaultPermissionFormGUI::fillForm ( )

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

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

95  {
96  $operations = array();
97  foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
98  $context = $ilOrgUnitPermission->getContext()->getContext();
99  foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
100  $id = $operation->getOperationId();
101  $operations["operations[{$context}][{$id}]"] = $ilOrgUnitPermission->isOperationIdSelected($operation->getOperationId());
102  }
103  }
104  $this->setValuesByArray($operations);
105  }
$context
Definition: webdav.php:26
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:

◆ fillObject()

ilOrgUnitDefaultPermissionFormGUI::fillObject ( )
protected

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

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

Referenced by saveObject().

109  {
110  if (!$this->checkInput()) {
111  return false;
112  }
113  $sent_operation_ids = $this->getInput(self::F_OPERATIONS);
114  foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
115  $operations = [];
116  $context = $ilOrgUnitPermission->getContext()->getContext();
117  foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
118  $id = $operation->getOperationId();
119  if ($sent_operation_ids[$context][$id]) {
120  $operations[] = ilOrgUnitOperation::find($id);
121  }
122  }
123  $ilOrgUnitPermission->setOperations($operations);
124  }
125 
126  return true;
127  }
$context
Definition: webdav.php:26
checkInput()
Check Post Input.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ 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.

References ilObjectPlugin\lookupTxtById(), and txt().

Referenced by initFormElements().

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  }
$context
Definition: webdav.php:26
static lookupTxtById($plugin_id, $lang_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initButtons()

ilOrgUnitDefaultPermissionFormGUI::initButtons ( )
protected

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

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

Referenced by __construct().

67  {
68  $this->setTitle($this->txt("form_title_org_default_permissions_"
69  . BaseCommands::CMD_UPDATE));
70  $this->addCommandButton(BaseCommands::CMD_UPDATE, $this->txt('save', true));
71  $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL));
72  }
setTitle($a_title)
Set Title.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormElements()

ilOrgUnitDefaultPermissionFormGUI::initFormElements ( )
protected

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

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

Referenced by __construct().

76  {
77  foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
78  $header = new ilFormSectionHeaderGUI();
79  $context = $ilOrgUnitPermission->getContext()->getContext();
80  $header->setTitle($this->getTitleForFormHeaderByContext($context));
81  $this->addItem($header);
82 
83  // Checkboxes
84  foreach ($ilOrgUnitPermission->getPossibleOperations() as $operation) {
85  $title = $this->txt("org_op_{$operation->getOperationString()}");
86  $id = $operation->getOperationId();
87  $cb = new ilCheckboxInputGUI($title, "operations[{$context}][{$id}]");
88  $this->addItem($cb);
89  }
90  }
91  }
$context
Definition: webdav.php:26
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
+ 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 53 of file class.ilOrgUnitDefaultPermissionFormGUI.php.

References fillObject().

54  {
55  if (!$this->fillObject()) {
56  return false;
57  }
58  foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) {
59  $ilOrgUnitPermission->update();
60  }
61 
62  return true;
63  }
+ Here is the call graph for this function:

◆ setIlOrgUnitPermissions()

ilOrgUnitDefaultPermissionFormGUI::setIlOrgUnitPermissions (   $ilOrgUnitPermissions)
Parameters

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

References $ilOrgUnitPermissions.

143  {
144  $this->ilOrgUnitPermissions = $ilOrgUnitPermissions;
145  }

◆ txt()

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

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

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

163  {
164  return $this->parent_gui->txt($key);
165  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ilOrgUnitPermissions

ilOrgUnitDefaultPermissionFormGUI::$ilOrgUnitPermissions = []
protected

◆ $objectDefinition

ilOrgUnitDefaultPermissionFormGUI::$objectDefinition
protected

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

Referenced by __construct().

◆ $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: