ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilContainerReferenceGUI Class Reference
+ Inheritance diagram for ilContainerReferenceGUI:
+ Collaboration diagram for ilContainerReferenceGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor. More...
 
 redirectObject ()
 redirect to target More...
 
 createObject ()
 Create object. More...
 
 saveObject ()
 save object More...
 
 editObject ($a_show_info_message=true)
 edit object More...
 
 editReferenceObject ()
 
 updateObject ()
 update object More...
 
 getTargetType ()
 get target type More...
 
 getReferenceType ()
 get reference type More...
 
 showTargetSelectionTreeObject ()
 Show target selection. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _prepareSelection ($a_ref_ids, $a_target_type)
 Prepare selection of target objects. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

const MAX_SELECTION_ENTRIES = 50
 
const MODE_CREATE = 1
 
const MODE_EDIT = 2
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 addLocatorItems ()
 Add locator item @global type $ilLocator. More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 firstEditObject ()
 show edit screen without info message More...
 
 editTitleObject (ilPropertyFormGUI $form=null)
 edit title More...
 
 initFormTitle ()
 Init title form. More...
 
 updateTitleObject ()
 update title More...
 
 showSelection ()
 show selection of containers More...
 
 initFormSelection ()
 init form selection More...
 
 initFormEditSelection ()
 init form selection More...
 
 initTargetSelection ($a_mode=self::MODE_CREATE)
 Init copy from repository/search list commands. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_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...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $existing_objects = array()
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ilContainerReferenceGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor.

Parameters

return

Reimplemented in ilObjCategoryReferenceGUI, and ilObjCourseReferenceGUI.

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

50 {
51 global $lng;
52 parent::__construct($a_data, $a_id,$a_call_by_reference,$a_prepare_output);
53
54 $lng->loadLanguageModule('objref');
55 }

References ilObjectGUI\$lng.

Member Function Documentation

◆ _prepareSelection()

static ilContainerReferenceGUI::_prepareSelection (   $a_ref_ids,
  $a_target_type 
)
static

Prepare selection of target objects.

@access public

Parameters
arrayint array of ref ids

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

404 {
405 global $ilDB,$lng;
406
407 $query = "SELECT obj_data.title obj_title,path_data.title path_title,child FROM tree ".
408 "JOIN object_reference obj_ref ON child = obj_ref.ref_id ".
409 "JOIN object_data obj_data ON obj_ref.obj_id = obj_data.obj_id ".
410 "JOIN object_reference path_ref ON parent = path_ref.ref_id ".
411 "JOIN object_data path_data ON path_ref.obj_id = path_data.obj_id ".
412 "WHERE ".$ilDB->in('child',$a_ref_ids,false,'integer').' '.
413 "ORDER BY obj_data.title ";
414 $res = $ilDB->query($query);
415
416 $options[0] = $lng->txt('obj_'.$a_target_type.'_select');
417 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
418 {
419 if(strlen($title = $row->obj_title) > 40)
420 {
421 $title = substr($title,0,40).'...';
422 }
423 if(strlen($path = $row->path_title) > 40)
424 {
425 $path = substr($path,0,40).'...';
426 }
427 $options[$row->child] = ($title.' ('.$lng->txt('path').': '.$path.')');
428 }
429 return $options ? $options : array();
430 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
$path
Definition: index.php:22
global $ilDB
if(!is_array($argv)) $options

References $ilDB, ilObjectGUI\$lng, $options, $path, $query, $res, $row, and DB_FETCHMODE_OBJECT.

◆ addLocatorItems()

ilContainerReferenceGUI::addLocatorItems ( )
protected

Add locator item @global type $ilLocator.

Reimplemented from ilObjectGUI.

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

62 {
63 global $ilLocator;
64
65 if($this->object instanceof ilObject)
66 {
67 $ilLocator->addItem($this->object->getPresentationTitle(),$this->ctrl->getLinkTarget($this));
68 }
69 }
Class ilObject Basic functions for all objects.

◆ afterSave()

ilContainerReferenceGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

139 {
140 $target_obj_id = ilObject::_lookupObjId((int) $_REQUEST['target_id']);
141 $a_new_object->setTargetId($target_obj_id);
142 $a_new_object->update();
143
144 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
145 $this->ctrl->setParameter($this,'ref_id',$a_new_object->getRefId());
146 $this->ctrl->redirect($this,'firstEdit');
147 }
static _lookupObjId($a_id)
update()
update object in db
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_REQUEST, ilObject\_lookupObjId(), ilObject\getRefId(), ilUtil\sendSuccess(), and ilObject\update().

+ Here is the call graph for this function:

◆ createObject()

ilContainerReferenceGUI::createObject ( )

Create object.

Returns
void

Reimplemented from ilObjectGUI.

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

90 {
91 global $ilUser,$ilAccess,$ilErr,$ilSetting;
92
93 $new_type = $_REQUEST["new_type"];
94 if(!$ilAccess->checkAccess("create_".$this->getReferenceType(),'',$_GET["ref_id"], $new_type))
95 {
96 $ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->MESSAGE);
97 }
98
99 $this->initTargetSelection(self::MODE_CREATE);
100 ilUtil::sendInfo($this->lng->txt($this->getReferenceType().'_edit_info'));
101 }
$_GET["client_id"]
initTargetSelection($a_mode=self::MODE_CREATE)
Init copy from repository/search list commands.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilSetting
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

References $_GET, $_REQUEST, $ilErr, $ilSetting, $ilUser, initTargetSelection(), and ilUtil\sendInfo().

Referenced by saveObject().

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

◆ editObject()

ilContainerReferenceGUI::editObject (   $a_show_info_message = true)

edit object

@access public

Parameters

return

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

166 {
167 global $ilUser,$ilSetting,$ilTabs;
168
169 $ilTabs->setTabActive('edit');
170 $ilTabs->addSubTab('edit',$this->lng->txt('objref_edit_ref'),$this->ctrl->getLinkTarget($this,'edit'));
171 $ilTabs->addSubTab('editTitle',$this->lng->txt('objref_edit_title'),$this->ctrl->getLinkTarget($this,'editTitle'));
172 $ilTabs->setTabActive('edit');
173 $ilTabs->activateSubTab('edit');
174 $this->initTargetSelection(self::MODE_EDIT);
175
176 if($a_show_info_message)
177 {
178 ilUtil::sendInfo($this->lng->txt($this->getReferenceType().'_edit_info'));
179 }
180 }

References $ilSetting, $ilUser, initTargetSelection(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ editReferenceObject()

ilContainerReferenceGUI::editReferenceObject ( )

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

183 {
184 $this->editObject();
185 }
editObject()
edit object

References ilObjectGUI\editObject().

+ Here is the call graph for this function:

◆ editTitleObject()

ilContainerReferenceGUI::editTitleObject ( ilPropertyFormGUI  $form = null)
protected

edit title

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

191 {
192 global $ilTabs;
193
194 $ilTabs->addSubTab('edit',$this->lng->txt('objref_edit_ref'),$this->ctrl->getLinkTarget($this,'edit'));
195 $ilTabs->addSubTab('editTitle',$this->lng->txt('objref_edit_title'),$this->ctrl->getLinkTarget($this,'editTitle'));
196 $ilTabs->setTabActive('edit');
197 $ilTabs->activateSubTab('editTitle');
198
199 if(!$form instanceof ilPropertyFormGUI)
200 {
201 $form = $this->initFormTitle();
202 }
203 $GLOBALS['tpl']->setContent($form->getHTML());
204 }
This class represents a property form user interface.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, and initFormTitle().

Referenced by updateTitleObject().

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

◆ firstEditObject()

ilContainerReferenceGUI::firstEditObject ( )
protected

show edit screen without info message

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

153 {
154 $this->editObject(false);
155 }

References ilObjectGUI\editObject().

+ Here is the call graph for this function:

◆ getReferenceType()

ilContainerReferenceGUI::getReferenceType ( )

get reference type

@access public

Parameters

return

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

391 {
392 return $this->reference_type;
393 }

Referenced by initFormEditSelection(), initFormSelection(), and showTargetSelectionTreeObject().

+ Here is the caller graph for this function:

◆ getTargetType()

ilContainerReferenceGUI::getTargetType ( )

get target type

@access public

Parameters

return

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

379 {
380 return $this->target_type;
381 }
$target_type
Definition: goto.php:87

References $target_type.

Referenced by initFormEditSelection(), initFormSelection(), and showTargetSelectionTreeObject().

+ Here is the caller graph for this function:

◆ initCreateForm()

ilContainerReferenceGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

132 {
133 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
134 $form = new ilPropertyFormGUI();
135 return $form;
136 }

◆ initFormEditSelection()

ilContainerReferenceGUI::initFormEditSelection ( )
protected

init form selection

@access protected

Returns

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

348 {
349 if(is_object($this->form))
350 {
351 return true;
352 }
353 include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
354 $this->form = new ilPropertyFormGUI();
355 $this->form->setFormAction($this->ctrl->getFormAction($this));
356 $this->form->setTitle($this->lng->txt($this->getReferenceType().'_edit'));
357 $this->form->setTitleIcon(ilUtil::getImagePath('icon_'.$this->getReferenceType().'.svg'));
358
359 // Show selection
360 $select = new ilSelectInputGUI($this->lng->txt('objs_'.$this->getTargetType()),'target_id');
361 $select->setValue($this->object->getTargetRefId());
362 $select->setOptions(self::_prepareSelection($this->existing_objects,$this->getTargetType()));
363 $select->setInfo($this->lng->txt($this->object->getType().'_edit_info'));
364 $this->form->addItem($select);
365
366 $this->form->addCommandButton('update',$this->lng->txt('save'));
367 #$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
368 }
This class represents a selection list property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath(), getReferenceType(), and getTargetType().

+ Here is the call graph for this function:

◆ initFormSelection()

ilContainerReferenceGUI::initFormSelection ( )
protected

init form selection

@access protected

Returns

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

319 {
320 if(is_object($this->form))
321 {
322 return true;
323 }
324 include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
325 $this->form = new ilPropertyFormGUI();
326 $this->ctrl->setParameter($this,'new_type',$this->getReferenceType());
327 $this->form->setFormAction($this->ctrl->getFormAction($this));
328 $this->form->setTitle($this->lng->txt($this->getReferenceType().'_new'));
329 $this->form->setTitleIcon(ilUtil::getImagePath('icon_'.$this->getReferenceType().'.svg'));
330
331 // Show selection
332 $select = new ilSelectInputGUI($this->lng->txt('objs_'.$this->getTargetType()),'target_id');
333 $select->setOptions(self::_prepareSelection($this->existing_objects,$this->getTargetType()));
334 $select->setInfo($this->lng->txt($_POST['new_type'].'_edit_info'));
335 $this->form->addItem($select);
336
337 $this->form->addCommandButton('save',$this->lng->txt('save'));
338 $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
339 }
$_POST['username']
Definition: cron.php:12

References $_POST, ilUtil\getImagePath(), getReferenceType(), and getTargetType().

Referenced by showSelection().

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

◆ initFormTitle()

ilContainerReferenceGUI::initFormTitle ( )
protected

Init title form.

Returns
ilPropertyFormGUI

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

211 {
212 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
213 $form = new ilPropertyFormGUI();
214 $form->setTitle($this->lng->txt('objref_title_settings'));
215 $form->setFormAction($this->ctrl->getFormAction($this));
216 $form->addCommandButton('updateTitle', $this->lng->txt('save'));
217
218 // title type
219 $ttype = new ilRadioGroupInputGUI($this->lng->txt('title'), 'title_type');
220 $ttype->setValue($this->object->getTitleType());
221 $reuse = new ilRadioOption($this->lng->txt('objref_reuse_title'));
223 $ttype->addOption($reuse);
224
225 $custom = new ilRadioOption($this->lng->txt('objref_custom_title'));
227
228 // title
229 $title = new ilTextInputGUI($this->lng->txt('title'),'title');
230 $title->setSize(min(40, ilObject::TITLE_LENGTH));
231 $title->setMaxLength(ilObject::TITLE_LENGTH);
232 $title->setRequired(true);
233 $title->setValue($this->object->getTitle());
234 $custom->addSubItem($title);
235
236 $ttype->addOption($custom);
237
238 $form->addItem($ttype);
239
240 return $form;
241 }
const TITLE_LENGTH
max length of object title
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text property in a property form.

References ilObject\TITLE_LENGTH, ilContainerReference\TITLE_TYPE_CUSTOM, and ilContainerReference\TITLE_TYPE_REUSE.

Referenced by editTitleObject(), and updateTitleObject().

+ Here is the caller graph for this function:

◆ initTargetSelection()

ilContainerReferenceGUI::initTargetSelection (   $a_mode = self::MODE_CREATE)
protected

Init copy from repository/search list commands.

Returns

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

437 {
438 global $ilCtrl, $tree;
439
440 // empty session on init
441 $_SESSION['ref_repexpand'] = array();
442
443 // copy opened nodes from repository explorer
444 $_SESSION['ref_repexpand'] = is_array($_SESSION['repexpand']) ? $_SESSION['repexpand'] : array();
445
446 // open current position
447
448 if($a_mode == self::MODE_CREATE)
449 {
450 $target = (int) $_GET['ref_id'];
451 }
452 else
453 {
454 $target = (int) $this->object->getTargetRefId();
455 }
456
457 $path = $tree->getPathId($target);
458 foreach((array) $path as $node_id)
459 {
460 if(!in_array($node_id, $_SESSION['ref_repexpand']))
461 {
462 $_SESSION['ref_repexpand'][] = $node_id;
463 }
464 }
465
466 $_SESSION['ref_mode'] = $a_mode;
467
469 }
$_SESSION["AccountId"]
showTargetSelectionTreeObject()
Show target selection.
global $ilCtrl
Definition: ilias.php:18

References $_GET, $_SESSION, $ilCtrl, $path, ilObjectGUI\$tree, and showTargetSelectionTreeObject().

Referenced by createObject(), and editObject().

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

◆ redirectObject()

ilContainerReferenceGUI::redirectObject ( )

redirect to target

Parameters

return

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

77 {
78 global $ilCtrl;
79
80 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->object->getTargetRefId());
81 $ilCtrl->redirectByClass("ilrepositorygui", "");
82 }

References $ilCtrl.

◆ saveObject()

ilContainerReferenceGUI::saveObject ( )

save object

@access public

Parameters

return

Reimplemented from ilObjectGUI.

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

112 {
113 global $ilAccess;
114
115 if(!(int) $_REQUEST['target_id'])
116 {
117 ilUtil::sendFailure($this->lng->txt('select_one'));
118 $this->createObject();
119 return false;
120 }
121 if(!$ilAccess->checkAccess('visible','',(int) $_REQUEST['target_id']))
122 {
123 ilUtil::sendFailure($this->lng->txt('permission_denied'));
124 $this->createObject();
125 return false;
126 }
127
128 parent::saveObject();
129 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_REQUEST, createObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ showSelection()

ilContainerReferenceGUI::showSelection ( )
protected

show selection of containers

@access protected

Returns

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

306 {
307 $this->initFormSelection();
308 $this->tpl->setContent($this->form->getHTML());
309 return true;
310 }

References initFormSelection().

+ Here is the call graph for this function:

◆ showTargetSelectionTreeObject()

ilContainerReferenceGUI::showTargetSelectionTreeObject ( )

Show target selection.

Returns

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

476 {
477 global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition;
478
479 include_once './Services/ContainerReference/classes/class.ilContainerSelectionExplorer.php';
480
481 if($_SESSION['ref_mode'] == self::MODE_CREATE)
482 {
483 $ilToolbar->addButton($this->lng->txt('back'), $ilCtrl->getLinkTarget($this,'cancel'));
484 $this->ctrl->setParameter($this,'new_type',$this->getReferenceType());
485 $cmd = 'save';
486 }
487 else
488 {
489 $ilTabs->setTabActive('edit');
490 $cmd = 'update';
491 }
492 $explorer = new ilContainerSelectionExplorer($this->ctrl->getLinkTarget($this,$cmd));
493
494 if(isset($_GET['ref_repexpand']))
495 {
496 $explorer->setExpand((int) $_GET['ref_repexpand']);
497 }
498 else
499 {
500 $explorer->setExpand(ROOT_FOLDER_ID);
501 }
502 $explorer->setFrameTarget('_self');
503 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'showTargetSelectionTree'));
504 $explorer->setTargetGet('target_id');
505 $explorer->setTargetType($this->getTargetType());
506 $explorer->setOutput(0);
507 $this->tpl->setContent($explorer->getOutput());
508 }
$cmd
Definition: sahs_server.php:35

References $_GET, $_SESSION, $cmd, $ilCtrl, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, ilObjectGUI\$tree, getReferenceType(), and getTargetType().

Referenced by initTargetSelection().

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

◆ updateObject()

ilContainerReferenceGUI::updateObject ( )

update object

@access public

Parameters

return

Reimplemented from ilObjectGUI.

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

273 {
274 global $ilAccess;
275
276 if(!(int) $_REQUEST['target_id'])
277 {
278 ilUtil::sendFailure($this->lng->txt('select_one'));
279 $this->editObject();
280 return false;
281 }
282 if(!$ilAccess->checkAccess('visible','',(int) $_REQUEST['target_id']))
283 {
284 ilUtil::sendFailure($this->lng->txt('permission_denied'));
285 $this->editObject();
286 return false;
287 }
288 $this->checkPermission('write');
289
290 $target_obj_id = ilObject::_lookupObjId((int) $_REQUEST['target_id']);
291 $this->object->setTargetId($target_obj_id);
292 $this->object->update();
293
294 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
295 $this->ctrl->redirect($this,'edit');
296 }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

References $_REQUEST, ilObject\_lookupObjId(), ilObjectGUI\checkPermission(), ilObjectGUI\editObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ updateTitleObject()

ilContainerReferenceGUI::updateTitleObject ( )
protected

update title

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

247 {
248 $form = $this->initFormTitle();
249 if($form->checkInput())
250 {
251 $this->object->setTitleType($form->getInput('title_type'));
252 if($form->getInput('title_type') == ilContainerReference::TITLE_TYPE_CUSTOM)
253 {
254 $this->object->setTitle($form->getInput('title'));
255 }
256 $this->object->update();
257 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
258 $this->ctrl->redirect($this,'editTitle');
259 }
260 $form->setValuesByPost();
261 ilUtil::sendFailure($this->lng->txt('err_check_input'));
262 $this->editTitleObject($form);
263 }
editTitleObject(ilPropertyFormGUI $form=null)
edit title

References editTitleObject(), initFormTitle(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilContainerReference\TITLE_TYPE_CUSTOM.

+ Here is the call graph for this function:

Field Documentation

◆ $existing_objects

ilContainerReferenceGUI::$existing_objects = array()
protected

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

◆ MAX_SELECTION_ENTRIES

const ilContainerReferenceGUI::MAX_SELECTION_ENTRIES = 50

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

◆ MODE_CREATE

const ilContainerReferenceGUI::MODE_CREATE = 1

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

◆ MODE_EDIT

const ilContainerReferenceGUI::MODE_EDIT = 2

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


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