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

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 
 executeCommand ()
 
 showObject ()
 show remote object More...
 
 callObject ()
 call remote object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 show info screen More...
 
 editObject (ilPropertyFormGUI $form=null)
 Edit settings. More...
 
 updateObject ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 cancelDelete ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- 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)
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- 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)
 

Data Fields

const TAB_ID_PERMISSIONS = "id_permissions"
 
- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- 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

 setTabs ()
 get tabs More...
 
 addCustomInfoFields (ilInfoScreenGUI $a_info)
 Add custom fields to info screen. More...
 
 initEditForm ()
 Init edit settings form. More...
 
 addCustomEditForm (ilPropertyFormGUI $a_form)
 Add custom fields to edit form. More...
 
 updateCustomValues (ilPropertyFormGUI $a_form)
 Update object custom values. More...
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 fillCloneTemplate (?string $tpl_varname, string $type)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget (string $append=null, bool $center=false)
 
- 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...
 

Private Attributes

ilLogger $logger
 

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilObjectService $object_service
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = array()
 
 $access_handler
 
- 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 = ""
 

Detailed Description

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

Definition at line 23 of file class.ilRemoteObjectBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRemoteObjectBaseGUI::__construct (   $a_id = 0,
  $a_id_type = self::REPOSITORY_NODE_ID,
  $a_parent_node_id = 0 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\logger().

30  {
31  global $DIC;
32 
33  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
34 
35  $this->logger = $DIC->logger()->wsrv();
36 
37  $this->lng->loadLanguageModule('ecs');
38  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilRemoteObjectBaseGUI::_goto ( string  $a_target)
static

Definition at line 337 of file class.ilRemoteObjectBaseGUI.php.

References $DIC, $ilErr, ilObject2GUI\$lng, ilObjectGUI\_gotoRepositoryNode(), and ilLanguage\txt().

337  : void
338  {
339  global $DIC;
340 
341  $ilAccess = $DIC->access();
342  $ilErr = $DIC["ilErr"];
343  $lng = $DIC->language();
344  if ($ilAccess->checkAccess("read", "", (int) $a_target)) {
345  ilObjectGUI::_gotoRepositoryNode((int) $a_target);
346  }
347 
348  if ($ilAccess->checkAccess("visible", "", (int) $a_target)) {
349  ilObjectGUI::_gotoRepositoryNode((int) $a_target, "infoScreen");
350  }
351  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
352  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _gotoRepositoryNode(int $ref_id, string $cmd="")
$ilErr
Definition: raiseError.php:17
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ addCustomEditForm()

ilRemoteObjectBaseGUI::addCustomEditForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to edit form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 293 of file class.ilRemoteObjectBaseGUI.php.

Referenced by initEditForm().

293  : void
294  {
295  }
+ Here is the caller graph for this function:

◆ addCustomInfoFields()

ilRemoteObjectBaseGUI::addCustomInfoFields ( ilInfoScreenGUI  $a_info)
protected

Add custom fields to info screen.

Parameters
ilInfoScreenGUI$a_info

Definition at line 222 of file class.ilRemoteObjectBaseGUI.php.

Referenced by infoScreen().

222  : void
223  {
224  // can be overwritten by subclasses
225  }
+ Here is the caller graph for this function:

◆ callObject()

ilRemoteObjectBaseGUI::callObject ( )

call remote object

Returns
bool

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

References ilChangeEvent\_recordReadEvent(), ILIAS\Repository\ctrl(), ilObject2GUI\getType(), infoScreenObject(), ILIAS\Repository\object(), and ILIAS\Repository\user().

134  : bool
135  {
137  $this->getType(),
138  $this->object->getRefId(),
139  $this->object->getId(),
140  $this->user->getId()
141  );
142 
143 
144  // check if the assigned object is hosted on the same installation
145  $link = $this->object->getFullRemoteLink();
146  if ($link) {
147  $this->ctrl->redirectToURL($link);
148  return true;
149  }
150 
151  $this->tpl->setOnScreenMessage('failure', 'Cannot call remote object.');
152  $this->infoScreenObject();
153  return false;
154  }
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
getType()
Functions that must be overwritten.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
+ Here is the call graph for this function:

◆ editObject()

ilRemoteObjectBaseGUI::editObject ( ilPropertyFormGUI  $form = null)

Edit settings.

Definition at line 230 of file class.ilRemoteObjectBaseGUI.php.

References ILIAS\Repository\access(), ilObject2GUI\checkPermissionBool(), initEditForm(), ILIAS\Repository\lng(), and ILIAS\Repository\logger().

230  : void
231  {
232  if (!$this->access->checkAccess("write", "", $this->object->getRefId())) {
233  $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->MESSAGE);
234  }
235  $this->logger->info("Can write:" . print_r($this->checkPermissionBool('write'), true));
236  $this->tabs_gui->activateTab('edit');
237 
238  if (!$form) {
239  $form = $this->initEditForm();
240  }
241  $this->tpl->setContent($form->getHTML());
242  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
initEditForm()
Init edit settings form.
+ Here is the call graph for this function:

◆ executeCommand()

ilRemoteObjectBaseGUI::executeCommand ( )

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

References ilObjectGUI\$ref_id, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), ILIAS\Repository\logger(), ilObject2GUI\prepareOutput(), and ILIAS\Repository\user().

40  : void
41  {
42  $next_class = $this->ctrl->getNextClass($this);
43  $cmd = $this->ctrl->getCmd();
44 
45  $this->prepareOutput();
46  $this->logger->info("Can write:" . print_r($this->checkPermissionBool('write'), true));
47 
48  switch ($next_class) {
49  case 'ilinfoscreengui':
50  // forwards command
51  $this->infoScreen();
52  break;
53 
54  case 'ilpermissiongui':
55  $this->tabs_gui->activateTab('id_permissions');
56  $this->ctrl->forwardCommand(new ilPermissionGUI($this));
57  break;
58 
59  case "ilcommonactiondispatchergui":
61  $this->ctrl->forwardCommand($gui);
62  break;
63 
64  case strtolower(ilECSUserConsentModalGUI::class):
65  $consent_gui = new ilECSUserConsentModalGUI(
66  $this->user->getId(),
67  $this->ref_id,
68  $this
69  );
70  $this->ctrl->setReturn($this, 'call');
71  $this->ctrl->forwardCommand($consent_gui);
72  break;
73 
74  default:
75  if (!$cmd || $cmd === 'view') {
76  $cmd = "infoScreen";
77  }
78  $cmd .= "Object";
79  $this->logger->info("cmd before call:" . print_r($cmd, true));
80  $this->$cmd();
81  break;
82  }
83  $this->logger->info("cmd:" . print_r($cmd, true));
84  }
prepareOutput(bool $show_sub_objects=true)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ infoScreen()

ilRemoteObjectBaseGUI::infoScreen ( )

show info screen

Definition at line 171 of file class.ilRemoteObjectBaseGUI.php.

References ilObjectGUI\$ref_id, ILIAS\Repository\access(), addCustomInfoFields(), ilECSUserConsentModalGUI\addLinkToToolbar(), ILIAS\Repository\ctrl(), ilObject2GUI\getType(), ILIAS\Repository\lng(), ilAdvancedMDRecordGUI\MODE_INFO, ILIAS\Repository\object(), ilAdvancedMDRecordGUI\setInfoObject(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

Referenced by executeCommand(), and infoScreenObject().

171  : void
172  {
173  if (!$this->access->checkAccess("visible", "", $this->object->getRefId())) {
174  $this->error->raiseError(
175  $this->lng->txt('msg_no_perm_read'),
176  $this->error->MESSAGE
177  );
178  }
179 
180  $this->ctrl->setReturn($this, 'call');
181  $consent_gui = new ilECSUserConsentModalGUI(
182  $this->user->getId(),
184  $this
185  );
186  $consent_gui->addLinkToToolbar($this->toolbar);
187 
188  $this->tabs_gui->activateTab('info');
189 
190  $info = new ilInfoScreenGUI($this);
191 
192  $info->addSection($this->lng->txt('ecs_general_info'));
193  $info->addProperty($this->lng->txt('title'), $this->object->getTitle());
194  if ($this->object->getOrganization()) {
195  $info->addProperty($this->lng->txt('organization'), $this->object->getOrganization());
196  }
197  if ($this->object->getDescription()) {
198  $info->addProperty($this->lng->txt('description'), $this->object->getDescription());
199  }
200  if ($this->object->getLocalInformation()) {
201  $info->addProperty($this->lng->txt('ecs_local_information'), $this->object->getLocalInformation());
202  }
203 
204  $this->addCustomInfoFields($info);
205 
206  $record_gui = new ilAdvancedMDRecordGUI(
208  $this->getType(),
209  $this->object->getId()
210  );
211  $record_gui->setInfoObject($info);
212  $record_gui->parse();
213 
214  $this->ctrl->forwardCommand($info);
215  }
Class ilInfoScreenGUI.
addCustomInfoFields(ilInfoScreenGUI $a_info)
Add custom fields to info screen.
getType()
Functions that must be overwritten.
setInfoObject(ilInfoScreenGUI $info)
get info sections
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilRemoteObjectBaseGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 161 of file class.ilRemoteObjectBaseGUI.php.

References ILIAS\Repository\ctrl(), and infoScreen().

Referenced by callObject().

161  : void
162  {
163  $this->ctrl->setCmd("showSummary");
164  $this->ctrl->setCmdClass("ilinfoscreengui");
165  $this->infoScreen();
166  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditForm()

ilRemoteObjectBaseGUI::initEditForm ( )
protected

Init edit settings form.

Definition at line 247 of file class.ilRemoteObjectBaseGUI.php.

References addCustomEditForm(), ILIAS\Repository\ctrl(), ilObject2GUI\getType(), ILIAS\Repository\lng(), ilAdvancedMDRecordGUI\MODE_EDITOR, ILIAS\Repository\object(), ilAdvancedMDRecordGUI\setPropertyForm(), ilTextAreaInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by editObject(), and updateObject().

248  {
249  $form = new ilPropertyFormGUI();
250  $form->setFormAction($this->ctrl->getFormAction($this));
251  $form->setTitle($this->lng->txt('ecs_general_info'));
252  $form->addCommandButton('update', $this->lng->txt('save'));
253  $form->addCommandButton('edit', $this->lng->txt('cancel'));
254 
255  $text = new ilTextInputGUI($this->lng->txt('title'), 'title');
256  $text->setValue($this->object->getTitle());
257  $text->setSize(min(40, ilObject::TITLE_LENGTH));
258  $text->setMaxLength(ilObject::TITLE_LENGTH);
259  $text->setDisabled(true);
260  $form->addItem($text);
261 
262  $area = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
263  $area->setValue($this->object->getDescription());
264  $area->setRows(3);
265  $area->setCols(80);
266  $area->setDisabled(true);
267  $form->addItem($area);
268 
269  $area = new ilTextAreaInputGUI($this->lng->txt('ecs_local_information'), 'local_info');
270  $area->setValue($this->object->getLocalInformation());
271  $area->setRows(3);
272  $area->setCols(80);
273  $form->addItem($area);
274 
275  $this->addCustomEditForm($form);
276 
277  $record_gui = new ilAdvancedMDRecordGUI(
279  $this->getType(),
280  $this->object->getId()
281  );
282  $record_gui->setPropertyForm($form);
283  $record_gui->parse();
284 
285  return $form;
286  }
setPropertyForm(ilPropertyFormGUI $form)
const TITLE_LENGTH
getType()
Functions that must be overwritten.
This class represents a text area property in a property form.
addCustomEditForm(ilPropertyFormGUI $a_form)
Add custom fields to edit form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilRemoteObjectBaseGUI::setTabs ( )
protected

get tabs

Definition at line 103 of file class.ilRemoteObjectBaseGUI.php.

References ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

103  : void
104  {
105  if ($this->checkPermissionBool('visible')) {
106  $this->tabs_gui->addTab(
107  "info",
108  $this->lng->txt("info_short"),
109  $this->ctrl->getLinkTarget($this, "infoScreen")
110  );
111  }
112 
113  if ($this->checkPermissionBool('write')) {
114  $this->tabs_gui->addTab(
115  "edit",
116  $this->lng->txt("edit"),
117  $this->ctrl->getLinkTarget($this, "edit")
118  );
119  }
120  if ($this->checkPermissionBool("edit_permission")) {
121  $this->tabs_gui->addTab(
122  self::TAB_ID_PERMISSIONS,
123  $this->lng->txt("perm_settings"),
124  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm")
125  );
126  }
127  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:

◆ showObject()

ilRemoteObjectBaseGUI::showObject ( )

show remote object

Definition at line 89 of file class.ilRemoteObjectBaseGUI.php.

References ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ILIAS\Repository\user().

89  : void
90  {
91  if ($this->user->getId() === ANONYMOUS_USER_ID ||
92  $this->object->isLocalObject()) {
93  $this->ctrl->redirectToURL($this->object->getRemoteLink());
94  } else {
95  $link = $this->object->getFullRemoteLink();
96  $this->ctrl->redirectToURL($link);
97  }
98  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
+ Here is the call graph for this function:

◆ updateCustomValues()

ilRemoteObjectBaseGUI::updateCustomValues ( ilPropertyFormGUI  $a_form)
protected

Update object custom values.

Parameters
ilPropertyFormGUI$a_form

Definition at line 333 of file class.ilRemoteObjectBaseGUI.php.

Referenced by updateObject().

333  : void
334  {
335  }
+ Here is the caller graph for this function:

◆ updateObject()

ilRemoteObjectBaseGUI::updateObject ( )

Definition at line 297 of file class.ilRemoteObjectBaseGUI.php.

References ilObject2GUI\checkPermissionBool(), ilObjectGUI\editObject(), ilObject2GUI\getType(), ilAdvancedMDRecordGUI\importEditFormPostValues(), initEditForm(), ILIAS\Repository\lng(), ilAdvancedMDRecordGUI\MODE_EDITOR, ILIAS\Repository\object(), and updateCustomValues().

297  : void
298  {
299  if (!$this->checkPermissionBool('write')) {
300  $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->MESSAGE);
301  }
302 
303  $form = $this->initEditForm();
304  if ($form->checkInput()) {
305  $this->object->setLocalInformation($form->getInput('local_info'));
306 
307  $this->updateCustomValues($form);
308 
309  $this->object->update();
310 
311  // Save advanced meta data
312  $record_gui = new ilAdvancedMDRecordGUI(
314  $this->getType(),
315  $this->object->getId()
316  );
317  $record_gui->importEditFormPostValues();
318  $record_gui->writeEditForm();
319 
320  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"));
321  $this->editObject();
322  }
323 
324  $form->setValuesByPost();
325  $this->editObject($form);
326  }
importEditFormPostValues()
Load edit form values from post.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
getType()
Functions that must be overwritten.
updateCustomValues(ilPropertyFormGUI $a_form)
Update object custom values.
initEditForm()
Init edit settings form.
+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger ilRemoteObjectBaseGUI::$logger
private

Definition at line 25 of file class.ilRemoteObjectBaseGUI.php.

◆ TAB_ID_PERMISSIONS

const ilRemoteObjectBaseGUI::TAB_ID_PERMISSIONS = "id_permissions"

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


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