ILIAS  release_8 Revision v8.23
ilContainerReferenceGUI Class Reference
+ Inheritance diagram for ilContainerReferenceGUI:
+ Collaboration diagram for ilContainerReferenceGUI:

Public Member Functions

 executeCommand ()
 
 redirectObject ()
 
 createObject ()
 
 saveObject ()
 
 editReferenceObject ()
 
 editObject (ilPropertyFormGUI $form=null)
 
 updateObject ()
 
 getTargetType ()
 
 getReferenceType ()
 
 getId ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

const MAX_SELECTION_ENTRIES = 50
 
const MODE_CREATE = 1
 
const MODE_EDIT = 2
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 addLocatorItems ()
 
 initCreateForm (string $new_type)
 
 afterSave (ilObject $new_object)
 
 firstEditObject ()
 
 initForm (int $a_mode=self::MODE_EDIT)
 
 loadPropertiesFromSettingsForm (ilPropertyFormGUI $form)
 
 getTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ilTabsGUI $tabs
 
ilErrorHandling $error
 
array $existing_objects = []
 
string $target_type
 
string $reference_type
 
ilPropertyFormGUI $form
 
StandardGUIRequest $cont_request
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ addLocatorItems()

ilContainerReferenceGUI::addLocatorItems ( )
protected

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

References ilObjectGUI\$locator, ilLocatorGUI\addItem(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

101  : void
102  {
103  $ilLocator = $this->locator;
104 
105  if ($this->object instanceof ilObject) {
106  $ilLocator->addItem($this->object->getPresentationTitle(), $this->ctrl->getLinkTarget($this));
107  }
108  }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilContainerReferenceGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 165 of file class.ilContainerReferenceGUI.php.

References ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObject\getRefId(), ILIAS\Repository\lng(), ilObject\setTitle(), ilContainerReference\TITLE_TYPE_CUSTOM, ilContainerReference\TITLE_TYPE_REUSE, and ilObject\update().

165  : void
166  {
167  $target_obj_id = ilObject::_lookupObjId((int) $this->form->getInput('target_id'));
168  $new_object->setTargetId($target_obj_id);
169  $new_object->setTitleType((int) $this->form->getInput('title_type'));
170 
171  if ((int) $this->form->getInput('title_type') === ilContainerReference::TITLE_TYPE_CUSTOM) {
172  $new_object->setTitle($this->form->getInput('title'));
173  } elseif ((int) $this->form->getInput('title_type') === ilContainerReference::TITLE_TYPE_REUSE) {
174  $new_object->setTitle(ilObject::_lookupTitle($new_object->getTargetId()));
175  }
176 
177  $new_object->update();
178 
179  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
180  $this->ctrl->setParameter($this, 'ref_id', $new_object->getRefId());
181  $this->ctrl->setParameter($this, 'creation_mode', 0);
182  $this->ctrl->redirect($this, 'firstEdit');
183  }
setTitle(string $title)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ createObject()

ilContainerReferenceGUI::createObject ( )

Definition at line 118 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\$access, $error, $ilErr, ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), initForm(), and ILIAS\Repository\lng().

Referenced by ilObjStudyProgrammeReferenceGUI\saveObject(), and saveObject().

118  : void
119  {
120  $ilAccess = $this->access;
122 
123  $new_type = $this->cont_request->getNewType();
124  if (!$ilAccess->checkAccess(
125  "create_" . $this->getReferenceType(),
126  '',
127  $this->cont_request->getRefId(),
128  $new_type
129  )) {
130  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
131  }
132  $this->ctrl->saveParameter($this, "crtptrefid");
133  $this->ctrl->saveParameter($this, "crtcb");
134  $form = $this->initForm(self::MODE_CREATE);
135  $this->tpl->setContent($form->getHTML());
136  }
initForm(int $a_mode=self::MODE_EDIT)
$ilErr
Definition: raiseError.php:17
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editObject()

ilContainerReferenceGUI::editObject ( ilPropertyFormGUI  $form = null)

Definition at line 195 of file class.ilContainerReferenceGUI.php.

References $DIC, $tabs, ilPropertyFormGUI\getHTML(), initForm(), and ilTabsGUI\setTabActive().

195  : void
196  {
197  global $DIC;
198 
199  $main_tpl = $DIC->ui()->mainTemplate();
200 
201  $ilTabs = $this->tabs;
202 
203  $ilTabs->setTabActive('settings');
204 
205  if (!$form instanceof ilPropertyFormGUI) {
206  $form = $this->initForm();
207  }
208  $main_tpl->setContent($form->getHTML());
209  }
initForm(int $a_mode=self::MODE_EDIT)
setTabActive(string $a_id)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ editReferenceObject()

ilContainerReferenceGUI::editReferenceObject ( )

Definition at line 190 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\editObject().

190  : void
191  {
192  $this->editObject();
193  }
+ Here is the call graph for this function:

◆ executeCommand()

ilContainerReferenceGUI::executeCommand ( )

Definition at line 65 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\$ctrl, $tabs, ILIAS\Repository\ctrl(), initForm(), ilObjectGUI\prepareOutput(), and ilObjectGUI\setCreationMode().

65  : void
66  {
67  $ilCtrl = $this->ctrl;
68  $ilTabs = $this->tabs;
69 
70  if ($this->cont_request->getCreationMode() === self::MODE_CREATE) {
71  $this->setCreationMode(true);
72  }
73 
74  $next_class = $ilCtrl->getNextClass($this);
75  $cmd = $ilCtrl->getCmd();
76 
77  $this->prepareOutput();
78 
79  switch ($next_class) {
80  case "ilpropertyformgui":
81  $form = $this->initForm($this->creation_mode ? self::MODE_CREATE : self::MODE_EDIT);
82  $this->ctrl->forwardCommand($form);
83  break;
84 
85  case 'ilpermissiongui':
86  $ilTabs->setTabActive('perm_settings');
87  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
88  $ilCtrl->forwardCommand(new ilPermissionGUI($this));
89  break;
90 
91  default:
92  if ($cmd === null || $cmd === '' || $cmd === 'view') {
93  $cmd = "edit";
94  }
95  $cmd .= "Object";
96  $this->$cmd();
97  break;
98  }
99  }
prepareOutput(bool $show_sub_objects=true)
initForm(int $a_mode=self::MODE_EDIT)
setCreationMode(bool $mode=true)
if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The m...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ firstEditObject()

ilContainerReferenceGUI::firstEditObject ( )
protected

Definition at line 185 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\editObject().

185  : void
186  {
187  $this->editObject();
188  }
+ Here is the call graph for this function:

◆ getId()

ilContainerReferenceGUI::getId ( )

Definition at line 380 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\$obj_id.

380  : int
381  {
382  return $this->obj_id;
383  }

◆ getReferenceType()

ilContainerReferenceGUI::getReferenceType ( )

Definition at line 350 of file class.ilContainerReferenceGUI.php.

References $reference_type.

Referenced by ilObjCourseReferenceGUI\getTabs(), and getTabs().

350  : string
351  {
352  return $this->reference_type;
353  }
+ Here is the caller graph for this function:

◆ getTabs()

ilContainerReferenceGUI::getTabs ( )
protected

Definition at line 355 of file class.ilContainerReferenceGUI.php.

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), and getReferenceType().

355  : void
356  {
357  global $DIC;
358 
359  $ilHelp = $DIC['ilHelp'];
360  $ilHelp->setScreenIdComponent($this->getReferenceType());
361 
362  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
363  $this->tabs_gui->addTarget(
364  "settings",
365  $this->ctrl->getLinkTarget($this, "edit"),
366  [],
367  ""
368  );
369  }
370  if ($this->access->checkAccess('edit_permission', '', $this->object->getRefId())) {
371  $this->tabs_gui->addTarget(
372  "perm_settings",
373  $this->ctrl->getLinkTargetByClass([get_class($this), 'ilpermissiongui'], "perm"),
374  ["perm", "info", "owner"],
375  'ilpermissiongui'
376  );
377  }
378  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getTargetType()

ilContainerReferenceGUI::getTargetType ( )

Definition at line 345 of file class.ilContainerReferenceGUI.php.

References $target_type.

Referenced by initForm().

345  : string
346  {
347  return $this->target_type;
348  }
+ Here is the caller graph for this function:

◆ initCreateForm()

ilContainerReferenceGUI::initCreateForm ( string  $new_type)
protected

Definition at line 160 of file class.ilContainerReferenceGUI.php.

References initForm().

161  {
162  return $this->initForm(self::MODE_CREATE);
163  }
initForm(int $a_mode=self::MODE_EDIT)
+ Here is the call graph for this function:

◆ initForm()

ilContainerReferenceGUI::initForm ( int  $a_mode = self::MODE_EDIT)
protected

Definition at line 211 of file class.ilContainerReferenceGUI.php.

References $form, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), getTargetType(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setRequired(), ilPropertyFormGUI\setTitle(), ilRadioGroupInputGUI\setValue(), ilRadioOption\setValue(), ilObject\TITLE_LENGTH, ilContainerReference\TITLE_TYPE_CUSTOM, and ilContainerReference\TITLE_TYPE_REUSE.

Referenced by createObject(), editObject(), executeCommand(), initCreateForm(), and updateObject().

212  {
213  $form = new ilPropertyFormGUI();
214 
215  if ($a_mode === self::MODE_CREATE) {
216  $form->setTitle($this->lng->txt($this->getReferenceType() . '_new'));
217 
218  $this->ctrl->setParameter($this, 'creation_mode', $a_mode);
219  $this->ctrl->setParameter(
220  $this,
221  'new_type',
222  $this->cont_request->getNewType()
223  );
224  } else {
225  $form->setTitle($this->lng->txt($this->reference_type . '_settings'));
226  }
227 
228  $form->setFormAction($this->ctrl->getFormAction($this));
229  if ($a_mode === self::MODE_CREATE) {
230  $lv = $this->getTargetType() . "r_add"; // see also https://mantis.ilias.de/view.php?id=31863
231  $form->addCommandButton('save', $this->lng->txt($lv));
232  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
233  } else {
234  $form->addCommandButton('update', $this->lng->txt('save'));
235  }
236 
237  // title type
238  $ttype = new ilRadioGroupInputGUI($this->lng->txt('title'), 'title_type');
239  if ($a_mode === self::MODE_EDIT) {
240  $ttype->setValue((string) $this->object->getTitleType());
241  } else {
242  $ttype->setValue((string) ilContainerReference::TITLE_TYPE_REUSE);
243  }
244 
245  $reuse = new ilRadioOption($this->lng->txt('objref_reuse_title'));
247  $ttype->addOption($reuse);
248 
249  $custom = new ilRadioOption($this->lng->txt('objref_custom_title'));
251 
252  // title
253  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
254  $title->setSize(min(40, ilObject::TITLE_LENGTH));
255  $title->setMaxLength(ilObject::TITLE_LENGTH);
256  $title->setRequired(true);
257 
258  if ($a_mode === self::MODE_EDIT) {
259  $title->setValue($this->object->getTitle());
260  }
261 
262  $custom->addSubItem($title);
263  $ttype->addOption($custom);
264  $form->addItem($ttype);
265 
266  $repo = new ilRepositorySelector2InputGUI($this->lng->txt("objref_edit_ref"), "target_id");
267  $repo->setRequired(true);
268  $repo->getExplorerGUI()->setSelectableTypes([$this->getTargetType()]);
269  $repo->getExplorerGUI()->setTypeWhiteList(
270  array_merge(
271  [$this->getTargetType()],
272  ["root", "cat", "grp", "fold", "crs"]
273  )
274  );
275  $repo->getExplorerGUI()->setClickablePermission('visible');
276  $repo->setInfo($this->lng->txt($this->getReferenceType() . '_edit_info'));
277 
278  if ($a_mode === self::MODE_EDIT) {
279  $repo->getExplorerGUI()->setPathOpen($this->object->getTargetRefId());
280  $repo->setValue($this->object->getTargetRefId());
281  }
282 
283  $form->addItem($repo);
284  $this->form = $form;
285  return $form;
286  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TITLE_LENGTH
This class represents a property in a property form.
setFormAction(string $a_formaction)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValue(string $a_value)
setRequired(bool $a_required)
form( $class_path, string $cmd)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadPropertiesFromSettingsForm()

ilContainerReferenceGUI::loadPropertiesFromSettingsForm ( ilPropertyFormGUI  $form)
protected

Definition at line 288 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\$access, $DIC, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilRBACAccessHandler\checkAccess(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilContainerReference\TITLE_TYPE_CUSTOM, and ilContainerReference\TITLE_TYPE_REUSE.

Referenced by updateObject().

288  : bool
289  {
290  global $DIC;
291 
292  $ok = true;
293  $access = $DIC->access();
294 
295  // check access
296  if (
297  !$access->checkAccess('visible', '', (int) $form->getInput('target_id'))
298  ) {
299  $ok = false;
300  $form->getItemByPostVar('target_id')->setAlert($this->lng->txt('permission_denied'));
301  }
302  // check target type
303  if (ilObject::_lookupType((int) $form->getInput('target_id'), true) !== $this->target_type) {
304  $ok = false;
305  $form->getItemByPostVar('target_id')->setAlert(
306  $this->lng->txt('objref_failure_target_type') .
307  ': ' .
308  $this->lng->txt('obj_' . $this->target_type)
309  );
310  }
311 
312  $this->object->setTargetId(
313  ilObject::_lookupObjId((int) $form->getInput('target_id'))
314  );
315 
316  // set title after target id, so that the title can be reused immediately
317  $this->object->setTitleType((int) $form->getInput('title_type'));
318  if ((int) $form->getInput('title_type') === ilContainerReference::TITLE_TYPE_CUSTOM) {
319  $this->object->setTitle($form->getInput('title'));
320  } elseif ((int) $form->getInput('title_type') === ilContainerReference::TITLE_TYPE_REUSE) {
321  $this->object->setTitle(ilObject::_lookupTitle($this->object->getTargetId()));
322  }
323 
324  return $ok;
325  }
getItemByPostVar(string $a_post_var)
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
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-...
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
ilAccessHandler $access
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectObject()

ilContainerReferenceGUI::redirectObject ( )

Definition at line 110 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\$ctrl, ILIAS\Repository\object(), and ilCtrl\setParameterByClass().

110  : void
111  {
112  $ilCtrl = $this->ctrl;
113 
114  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->object->getTargetRefId());
115  $ilCtrl->redirectByClass("ilrepositorygui", "");
116  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ saveObject()

ilContainerReferenceGUI::saveObject ( )

Definition at line 138 of file class.ilContainerReferenceGUI.php.

References ilObjectGUI\$access, createObject(), and ILIAS\Repository\lng().

138  : void
139  {
140  $ilAccess = $this->access;
141 
142  if ($this->cont_request->getTargetId() === 0) {
143  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
144  $this->createObject();
145  return;
146  }
147  if (!$ilAccess->checkAccess(
148  'visible',
149  '',
150  $this->cont_request->getTargetId()
151  )) {
152  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
153  $this->createObject();
154  return;
155  }
156 
157  parent::saveObject();
158  }
ilAccessHandler $access
+ Here is the call graph for this function:

◆ updateObject()

ilContainerReferenceGUI::updateObject ( )

Definition at line 327 of file class.ilContainerReferenceGUI.php.

References ilPropertyFormGUI\checkInput(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilObjectGUI\editObject(), initForm(), ILIAS\Repository\lng(), loadPropertiesFromSettingsForm(), and ilPropertyFormGUI\setValuesByPost().

327  : void
328  {
329  $this->checkPermission('write');
330 
331  $form = $this->initForm();
332  if (
333  $form->checkInput() &&
335  ) {
336  $this->object->update();
337  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
338  $this->ctrl->redirect($this, 'edit');
339  }
341  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
342  $this->editObject($form);
343  }
loadPropertiesFromSettingsForm(ilPropertyFormGUI $form)
initForm(int $a_mode=self::MODE_EDIT)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

Field Documentation

◆ $cont_request

StandardGUIRequest ilContainerReferenceGUI::$cont_request
protected

Definition at line 39 of file class.ilContainerReferenceGUI.php.

◆ $error

ilErrorHandling ilContainerReferenceGUI::$error
protected

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

Referenced by createObject().

◆ $existing_objects

array ilContainerReferenceGUI::$existing_objects = []
protected

Definition at line 34 of file class.ilContainerReferenceGUI.php.

◆ $form

ilPropertyFormGUI ilContainerReferenceGUI::$form
protected

Definition at line 38 of file class.ilContainerReferenceGUI.php.

Referenced by ilObjCourseReferenceGUI\initForm(), and initForm().

◆ $reference_type

string ilContainerReferenceGUI::$reference_type
protected

Definition at line 37 of file class.ilContainerReferenceGUI.php.

Referenced by getReferenceType().

◆ $tabs

ilTabsGUI ilContainerReferenceGUI::$tabs
protected

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

Referenced by editObject(), and executeCommand().

◆ $target_type

string ilContainerReferenceGUI::$target_type
protected

Definition at line 36 of file class.ilContainerReferenceGUI.php.

Referenced by getTargetType().

◆ MAX_SELECTION_ENTRIES

const ilContainerReferenceGUI::MAX_SELECTION_ENTRIES = 50

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

◆ MODE_CREATE

const ilContainerReferenceGUI::MODE_CREATE = 1

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

◆ MODE_EDIT

const ilContainerReferenceGUI::MODE_EDIT = 2

Definition at line 30 of file class.ilContainerReferenceGUI.php.


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