ILIAS  release_4-4 Revision
ilObjItemGroupGUI Class Reference

User Interface class for item groups. More...

+ Inheritance diagram for ilObjItemGroupGUI:
+ Collaboration diagram for ilObjItemGroupGUI:

Public Member Functions

 getType ()
 Get type. More...
 
 executeCommand ()
 execute command More...
 
 addLocatorItems ()
 Add session locator. More...
 
 listMaterials ()
 show material assignment More...
 
 saveItemAssignment ()
 Save material assignment. More...
 
 getTemplate ()
 Get standard template. More...
 
 setTabs ()
 Set tabs. More...
 
 _goto ($a_target)
 Goto item group. More...
 
 gotoParent ()
 Goto item group. More...
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent containert. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 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 ($a_mode=true)
 
 getCreationMode ()
 
 isVisible ()
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor 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 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...
 
 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...
 

Protected Member Functions

 afterConstructor ()
 Initialisation. More...
 
 initCreationForms ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 After save. 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 ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 prepareOutput ()
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings ($column_gui)
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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)
 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...
 

Additional Inherited Members

- 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 inherited from ilObject2GUI
 $tree
 
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 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 Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 

Detailed Description

Member Function Documentation

◆ _goto()

ilObjItemGroupGUI::_goto (   $a_target)

Goto item group.

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

References $ilErr, ilObjectGUI\$lng, ilObjectGUI\$ref_id, ilObject2GUI\$tree, ilLink\_getLink(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilUtil\redirect(), and ilUtil\sendFailure().

223  {
224  global $ilAccess, $ilErr, $lng, $tree;
225 
226  $targets = explode('_',$a_target);
227  $ref_id = $targets[0];
228  $par_id = $tree->getParentId($ref_id);
229 
230  if ($ilAccess->checkAccess("read", "", $par_id))
231  {
232  include_once("./Services/Link/classes/class.ilLink.php");
234  exit;
235  }
236  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
237  {
238  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
241  }
242 
243  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
244  }
exit
Definition: login.php:54
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjItemGroupGUI::addLocatorItems ( )

Add session locator.

public

Definition at line 90 of file class.ilObjItemGroupGUI.php.

References $_GET.

91  {
92  global $ilLocator, $ilAccess;
93 
94  if (is_object($this->object) && $ilAccess->checkAccess("write", "", $this->object->getRefId()))
95  {
96  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listMaterials"), "", $_GET["ref_id"]);
97  }
98  }
$_GET["client_id"]

◆ afterConstructor()

ilObjItemGroupGUI::afterConstructor ( )
protected

Initialisation.

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

References ilObjectGUI\$lng.

26  {
27  global $lng;
28 
29  $lng->loadLanguageModule("itgr");
30 
31  $this->ctrl->saveParameter($this, array("ref_id"));
32  }

◆ afterSave()

ilObjItemGroupGUI::afterSave ( ilObject  $a_new_object)
protected

After save.

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

References $ilCtrl, and ilUtil\sendSuccess().

112  {
113  global $ilCtrl;
114 
115  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
116  $ilCtrl->redirect($this, "listMaterials");
117  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ afterSaveCallback()

ilObjItemGroupGUI::afterSaveCallback ( ilObject  $a_obj)

Custom callback after object is created (in parent containert.

Parameters
ilObject$a_obj

Definition at line 269 of file class.ilObjItemGroupGUI.php.

References ilItemGroupItems\addItem(), and ilObject\getRefId().

270  {
271  // add new object to materials
272  include_once './Modules/ItemGroup/classes/class.ilItemGroupItems.php';
273  $items = new ilItemGroupItems($this->object->getRefId());
274  $items->addItem($a_obj->getRefId());
275  $items->update();
276  }
addItem($a_item_ref_id)
Add one item.
Item group items.
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ executeCommand()

ilObjItemGroupGUI::executeCommand ( )

execute command

Definition at line 45 of file class.ilObjItemGroupGUI.php.

References $cmd, $ilCtrl, ilObjectGUI\$lng, $ret, ilObjectGUI\$tpl, ilObjectGUI\addHeaderAction(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), and ilObject2GUI\prepareOutput().

46  {
47  global $ilTabs, $lng, $ilAccess, $tpl, $ilCtrl, $ilLocator;
48 
49  $next_class = $this->ctrl->getNextClass($this);
50  $cmd = $this->ctrl->getCmd();
51 
52  switch($next_class)
53  {
54  case 'ilinfoscreengui':
55  $this->prepareOutput();
56  $this->addHeaderAction();
57  $this->infoScreen();
58  break;
59 
60  case 'ilpermissiongui':
61  $this->prepareOutput();
62  $ilTabs->activateTab("perm_settings");
63  $this->addHeaderAction();
64  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
65  $perm_gui =& new ilPermissionGUI($this);
66  $ret = $this->ctrl->forwardCommand($perm_gui);
67  break;
68 
69  case "ilcommonactiondispatchergui":
70  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
72  $this->ctrl->forwardCommand($gui);
73  break;
74 
75  default:
76  $cmd = $this->ctrl->getCmd("listMaterials");
77  $this->prepareOutput();
78  $this->addHeaderAction();
79  $this->$cmd();
80  break;
81  }
82  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getTemplate()

ilObjItemGroupGUI::getTemplate ( )

Get standard template.

Definition at line 174 of file class.ilObjItemGroupGUI.php.

175  {
176  $this->tpl->getStandardTemplate();
177  }

◆ getType()

ilObjItemGroupGUI::getType ( )
final

Get type.

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

38  {
39  return "itgr";
40  }

◆ gotoParent()

ilObjItemGroupGUI::gotoParent ( )

Goto item group.

Definition at line 249 of file class.ilObjItemGroupGUI.php.

References $ilErr, ilObjectGUI\$lng, ilObjectGUI\$ref_id, ilObject2GUI\$tree, ilLink\_getLink(), exit, and ilUtil\redirect().

250  {
251  global $ilAccess, $ilErr, $lng, $tree;
252 
253  $ref_id = $this->object->getRefId();
254  $par_id = $tree->getParentId($ref_id);
255 
256  if ($ilAccess->checkAccess("read", "", $par_id))
257  {
258  include_once("./Services/Link/classes/class.ilLink.php");
260  exit;
261  }
262  }
exit
Definition: login.php:54
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjItemGroupGUI::initCreationForms (   $a_new_type)
protected

Definition at line 100 of file class.ilObjItemGroupGUI.php.

References ilObjectGUI\initCreateForm().

101  {
102  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type)
103  );
104 
105  return $forms;
106  }
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ listMaterials()

ilObjItemGroupGUI::listMaterials ( )

show material assignment

protected

Parameters

Definition at line 126 of file class.ilObjItemGroupGUI.php.

References $tab, ilObjectGUI\$tpl, ilObject2GUI\$tree, and ilObject2GUI\checkPermission().

127  {
128  global $tree, $ilTabs, $tpl;
129 
130  $this->checkPermission("write");
131 
132  $ilTabs->activateTab("materials");
133 
134  $parent_ref_id = $tree->getParentId($this->object->getRefId());
135 
136  include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
137  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
138  $gui->setDisabledObjectTypes(array("itgr", "sess"));
139  $gui->setAfterCreationCallback($this->object->getRefId());
140  $gui->render();
141 
142  include_once("./Modules/ItemGroup/classes/class.ilItemGroupItemsTableGUI.php");
143  $tab = new ilItemGroupItemsTableGUI($this, "listMaterials");
144  $tpl->setContent($tab->getHTML());
145  }
checkPermission($a_perm, $a_cmd="")
Render add new item selector.
+ Here is the call graph for this function:

◆ saveItemAssignment()

ilObjItemGroupGUI::saveItemAssignment ( )

Save material assignment.

Definition at line 150 of file class.ilObjItemGroupGUI.php.

References $_POST, $ilCtrl, ilObject2GUI\checkPermission(), ilUtil\sendSuccess(), and ilUtil\stripSlashesArray().

151  {
152  global $ilCtrl;
153 
154  $this->checkPermission("write");
155 
156  include_once './Modules/ItemGroup/classes/class.ilItemGroupItems.php';
157 
158  $item_group_items = new ilItemGroupItems($this->object->getRefId());
159  $items = is_array($_POST['items'])
160  ? $_POST['items']
161  : array();
162  $items = ilUtil::stripSlashesArray($items);
163  $item_group_items->setItems($items);
164  $item_group_items->update();
165 
166  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
167  $ilCtrl->redirect($this, "listMaterials");
168  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="")
Item group items.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
+ Here is the call graph for this function:

◆ setTabs()

ilObjItemGroupGUI::setTabs ( )

Set tabs.

Definition at line 183 of file class.ilObjItemGroupGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\$tree, ilLink\_getLink(), ilObject\_lookupObjId(), and ilObject\_lookupType().

184  {
185  global $ilAccess, $ilTabs, $ilCtrl, $ilHelp, $lng, $tree;
186 
187  $ilHelp->setScreenIdComponent("itgr");
188 
189  $parent_ref_id = $tree->getParentId($this->object->getRefId());
190  $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
191  $parent_type = ilObject::_lookupType($parent_obj_id);
192 
193  include_once("./Services/Link/classes/class.ilLink.php");
194  $ilTabs->setBackTarget(
195  $lng->txt('obj_'.$parent_type),
196  ilLink::_getLink($parent_ref_id), "_top");
197 
198  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
199  {
200  $ilTabs->addTab('materials',
201  $lng->txt('itgr_materials'),
202  $this->ctrl->getLinkTarget($this, 'listMaterials'));
203 
204  $ilTabs->addTab('settings',
205  $lng->txt('settings'),
206  $this->ctrl->getLinkTarget($this, 'edit'));
207  }
208 
209  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
210  {
211  $ilTabs->addTab("perm_settings",
212  $lng->txt('perm_settings'),
213  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
214  );
215  }
216  }
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

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