ILIAS  release_8 Revision v8.23
ilObjItemGroup Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjItemGroup:
+ Collaboration diagram for ilObjItemGroup:

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 
 setId ($a_id)
 
 initType ()
 
 setHideTitle (bool $a_val)
 
 getHideTitle ()
 
 setBehaviour (int $a_val)
 Set behaviour (see ilItemGroupBehaviour) More...
 
 getListPresentation ()
 
 setListPresentation (string $a_val)
 
 getTileSize ()
 
 setTileSize (int $a_val)
 
 getBehaviour ()
 
 cloneDependencies (int $a_target_id, int $a_copy_id)
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 update ()
 
 delete ()
 
 cloneMetaData (ilObject $target_obj)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static fixContainerItemGroupRefsAfterCloning (ilContainer $a_source_container, int $a_copy_id)
 
static lookupHideTitle (int $a_id)
 
static lookupBehaviour (int $a_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Protected Member Functions

 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 doUpdate ()
 
 doDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Static Protected Member Functions

static lookup (int $a_id, string $a_key)
 

Protected Attributes

ilObjectDefinition $obj_def
 
int $access_type
 
int $access_begin
 
int $access_end
 
bool $access_visibility
 
ilItemGroupAR $item_data_ar = null
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Additional Inherited Members

- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjItemGroup

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilObjItemGroup::__construct ( int  $a_id = 0,
bool  $a_reference = true 
)

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

References $DIC, $ilDB, ilObject\$tree, and ILIAS\GlobalScreen\Provider\__construct().

35  {
36  global $DIC;
37 
38  $this->log = $DIC["ilLog"];
39  $tree = $DIC->repositoryTree();
40  $objDefinition = $DIC["objDefinition"];
41  $ilDB = $DIC->database();
42 
43  $this->tree = $tree;
44  $this->obj_def = $objDefinition;
45  $this->db = $ilDB;
46 
47  $this->item_data_ar = new ilItemGroupAR();
48 
49  parent::__construct($a_id, $a_reference);
50  }
ilTree $tree
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Member Function Documentation

◆ cloneDependencies()

ilObjItemGroup::cloneDependencies ( int  $a_target_id,
int  $a_copy_id 
)

Definition at line 177 of file class.ilObjItemGroup.php.

References ilObject\getRefId().

177  : bool
178  {
179  parent::cloneDependencies($a_target_id, $a_copy_id);
180 
181  $ig_items = new ilItemGroupItems($a_target_id);
182  $ig_items->cloneItems($this->getRefId(), $a_copy_id);
183 
184  return true;
185  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ doCloneObject()

ilObjItemGroup::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = null 
)
protected

Definition at line 153 of file class.ilObjItemGroup.php.

References getBehaviour(), getHideTitle(), ilObject\getId(), ilObjectTranslation\getInstance(), getListPresentation(), getTileSize(), ilObject\setDescription(), ilObject\setTitle(), and ilObject2\update().

153  : void
154  {
155  assert($new_obj instanceof ilObjItemGroup);
156  $new_obj->setHideTitle($this->getHideTitle());
157  $new_obj->setBehaviour($this->getBehaviour());
158  $new_obj->setListPresentation($this->getListPresentation());
159  $new_obj->setTileSize($this->getTileSize());
160 
161 
162  // translations
163  $ot = ilObjectTranslation::getInstance($this->getId());
164  $ot->copy($new_obj->getId());
165  $ot2 = ilObjectTranslation::getInstance($new_obj->getId());
166  $ot2->read();
167  if ($ot2->getDefaultTitle() !== "") {
168  $new_obj->setTitle($ot2->getDefaultTitle());
169  }
170  if ($ot2->getDefaultDescription() !== "") {
171  $new_obj->setDescription($ot2->getDefaultDescription());
172  }
173 
174  $new_obj->update();
175  }
setTitle(string $title)
setDescription(string $desc)
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ doCreate()

ilObjItemGroup::doCreate ( bool  $clone_mode = false)
protected

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

References $DIC, ilObject\$lng, ilLanguage\getDefaultLanguage(), ilObject\getDescription(), ilObject\getId(), ilObjectTranslation\getInstance(), and ilObject\getTitle().

111  : void
112  {
113  global $DIC;
114 
115  if ($this->getId()) {
116  $this->item_data_ar->setId($this->getId());
117  $this->item_data_ar->create();
118  }
119 
120  $lng = $DIC->language();
121 
122  // add default translation
123  $obj_trans = ilObjectTranslation::getInstance($this->getId());
124  $obj_trans->addLanguage(
126  $this->getTitle(),
127  $this->getDescription(),
128  true,
129  true
130  );
131  $obj_trans->save();
132  }
getDefaultLanguage()
Return default language.
global $DIC
Definition: feed.php:28
ilLanguage $lng
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ doDelete()

ilObjItemGroup::doDelete ( )
protected

Definition at line 146 of file class.ilObjItemGroup.php.

References ilObject\getId().

146  : void
147  {
148  if ($this->getId()) {
149  $this->item_data_ar->delete();
150  }
151  }
+ Here is the call graph for this function:

◆ doRead()

ilObjItemGroup::doRead ( )
protected

Definition at line 106 of file class.ilObjItemGroup.php.

References ilObject\getId().

106  : void
107  {
108  $this->item_data_ar = new ilItemGroupAR($this->getId());
109  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ doUpdate()

ilObjItemGroup::doUpdate ( )
protected

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

References ilObject\getId(), ilObjectTranslation\getInstance(), ilObject\getLongDescription(), and ilObject\getTitle().

134  : void
135  {
136  if ($this->getId()) {
137  $this->item_data_ar->update();
138 
139  $trans = ilObjectTranslation::getInstance($this->getId());;
140  $trans->setDefaultTitle($this->getTitle());
141  $trans->setDefaultDescription($this->getLongDescription());
142  $trans->save();
143  }
144  }
static getInstance(int $obj_id)
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:

◆ fixContainerItemGroupRefsAfterCloning()

static ilObjItemGroup::fixContainerItemGroupRefsAfterCloning ( ilContainer  $a_source_container,
int  $a_copy_id 
)
static

Definition at line 187 of file class.ilObjItemGroup.php.

References $DIC, ilPageObject\_exists(), ilCopyWizardOptions\_getInstance(), ilObject\_lookupObjId(), ilObject\getRefId(), ilObject\getType(), and ilPCResources\modifyItemGroupRefIdsByMapping().

Referenced by ilContainer\cloneDependencies().

190  : void {
191  global $DIC;
192 
193  $ilLog = $DIC["ilLog"];
194 
195  $ilLog->write(__METHOD__ . ': Fix item group references in ' . $a_source_container->getType());
196 
197  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
198  $mappings = $cwo->getMappings();
199 
200  $new_container_ref_id = $mappings[$a_source_container->getRefId()];
201  $ilLog->write(__METHOD__ . ': 2-' . $new_container_ref_id . '-');
202  $new_container_obj_id = ilObject::_lookupObjId($new_container_ref_id);
203 
204  $ilLog->write(__METHOD__ . ': 3' . $new_container_obj_id . '-');
205  if (ilPageObject::_exists("cont", $new_container_obj_id)) {
206  $ilLog->write(__METHOD__ . ': 4');
207  $new_page = new ilContainerPage($new_container_obj_id);
208  $new_page->buildDom();
209  ilPCResources::modifyItemGroupRefIdsByMapping($new_page, $mappings);
210  $new_page->update();
211  }
212  $ilLog->write(__METHOD__ . ': 5');
213  }
static modifyItemGroupRefIdsByMapping(ilPageObject $a_page, array $mappings)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _getInstance(int $a_copy_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBehaviour()

ilObjItemGroup::getBehaviour ( )

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

Referenced by doCloneObject().

101  : int
102  {
103  return $this->item_data_ar->getBehaviour();
104  }
+ Here is the caller graph for this function:

◆ getHideTitle()

ilObjItemGroup::getHideTitle ( )

Definition at line 68 of file class.ilObjItemGroup.php.

Referenced by doCloneObject().

68  : bool
69  {
70  return $this->item_data_ar->getHideTitle();
71  }
+ Here is the caller graph for this function:

◆ getListPresentation()

ilObjItemGroup::getListPresentation ( )

Definition at line 81 of file class.ilObjItemGroup.php.

Referenced by doCloneObject().

81  : string
82  {
83  return $this->item_data_ar->getListPresentation();
84  }
+ Here is the caller graph for this function:

◆ getTileSize()

ilObjItemGroup::getTileSize ( )

Definition at line 91 of file class.ilObjItemGroup.php.

Referenced by doCloneObject().

91  : int
92  {
93  return $this->item_data_ar->getTileSize();
94  }
+ Here is the caller graph for this function:

◆ initType()

ilObjItemGroup::initType ( )

Definition at line 58 of file class.ilObjItemGroup.php.

58  : void
59  {
60  $this->type = "itgr";
61  }

◆ lookup()

static ilObjItemGroup::lookup ( int  $a_id,
string  $a_key 
)
staticprotected

Definition at line 225 of file class.ilObjItemGroup.php.

References $DIC, and $ilDB.

225  : string
226  {
227  global $DIC;
228 
229  $ilDB = $DIC->database();
230 
231  $set = $ilDB->query(
232  "SELECT " . $a_key . " FROM itgr_data " .
233  " WHERE id = " . $ilDB->quote($a_id, "integer")
234  );
235  $rec = $ilDB->fetchAssoc($set);
236  return $rec[$a_key];
237  }
global $DIC
Definition: feed.php:28

◆ lookupBehaviour()

static ilObjItemGroup::lookupBehaviour ( int  $a_id)
static

Definition at line 220 of file class.ilObjItemGroup.php.

220  : int
221  {
222  return (int) self::lookup($a_id, "behaviour");
223  }

◆ lookupHideTitle()

static ilObjItemGroup::lookupHideTitle ( int  $a_id)
static

Definition at line 215 of file class.ilObjItemGroup.php.

Referenced by ilContainerContentGUI\renderItemGroup().

215  : bool
216  {
217  return (bool) self::lookup($a_id, "hide_title");
218  }
+ Here is the caller graph for this function:

◆ setBehaviour()

ilObjItemGroup::setBehaviour ( int  $a_val)

Set behaviour (see ilItemGroupBehaviour)

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

76  : void
77  {
78  $this->item_data_ar->setBehaviour($a_val);
79  }

◆ setHideTitle()

ilObjItemGroup::setHideTitle ( bool  $a_val)

Definition at line 63 of file class.ilObjItemGroup.php.

63  : void
64  {
65  $this->item_data_ar->setHideTitle($a_val);
66  }

◆ setId()

ilObjItemGroup::setId (   $a_id)

Definition at line 52 of file class.ilObjItemGroup.php.

52  : void
53  {
54  parent::setId($a_id);
55  $this->item_data_ar->setId($a_id);
56  }

◆ setListPresentation()

ilObjItemGroup::setListPresentation ( string  $a_val)

Definition at line 86 of file class.ilObjItemGroup.php.

86  : void
87  {
88  $this->item_data_ar->setListPresentation($a_val);
89  }

◆ setTileSize()

ilObjItemGroup::setTileSize ( int  $a_val)

Definition at line 96 of file class.ilObjItemGroup.php.

96  : void
97  {
98  $this->item_data_ar->setTileSize($a_val);
99  }

Field Documentation

◆ $access_begin

int ilObjItemGroup::$access_begin
protected

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

◆ $access_end

int ilObjItemGroup::$access_end
protected

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

◆ $access_type

int ilObjItemGroup::$access_type
protected

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

◆ $access_visibility

bool ilObjItemGroup::$access_visibility
protected

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

◆ $item_data_ar

ilItemGroupAR ilObjItemGroup::$item_data_ar = null
protected

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

◆ $obj_def

ilObjectDefinition ilObjItemGroup::$obj_def
protected

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


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