ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjRepositorySettings 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 ilObjRepositorySettings:
+ Collaboration diagram for ilObjRepositorySettings:

Public Member Functions

 __construct (int $a_id, bool $a_call_by_reference=true)
 
 delete ()
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 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 $description)
 
 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 addNewItemGroupSeparator ()
 
static addNewItemGroup (array $a_titles)
 
static updateNewItemGroup (int $a_id, array $a_titles)
 
static deleteNewItemGroup (int $a_id)
 
static getNewItemGroups ()
 
static updateNewItemGroupOrder (array $a_order)
 
static getNewItemGroupSubItems ()
 
static getDefaultNewItemGrouping ()
 
static deleteObjectType (string $a_type)
 
- 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)
 

Data Fields

const NEW_ITEM_GROUP_TYPE_GROUP = 1
 
const NEW_ITEM_GROUP_TYPE_SEPARATOR = 2
 
- 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
 

Static Protected Member Functions

static getAllObjTypes ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- 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
 
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 = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

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 ilObjRepositorySettings

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

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

Constructor & Destructor Documentation

◆ __construct()

ilObjRepositorySettings::__construct ( int  $a_id,
bool  $a_call_by_reference = true 
)

Definition at line 31 of file class.ilObjRepositorySettings.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct().

32  {
33  $this->type = "reps";
34  parent::__construct($a_id, $a_call_by_reference);
35  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ addNewItemGroup()

static ilObjRepositorySettings::addNewItemGroup ( array  $a_titles)
static

Definition at line 66 of file class.ilObjRepositorySettings.php.

References $DIC, $ilDB, and ILIAS\Repository\int().

Referenced by ilObjRepositorySettingsGUI\saveNewItemGroup().

66  : bool
67  {
68  global $DIC;
69 
70  $ilDB = $DIC->database();
71 
72  // append
73  $pos = $ilDB->query("SELECT max(pos) mpos FROM il_new_item_grp");
74  $pos = $ilDB->fetchAssoc($pos);
75  $pos = (int) $pos["mpos"];
76  $pos += 10;
77 
78  $seq = $ilDB->nextID("il_new_item_grp");
79 
80  $ilDB->manipulate("INSERT INTO il_new_item_grp" .
81  " (id, titles, pos, type) VALUES (" .
82  $ilDB->quote($seq, "integer") .
83  ", " . $ilDB->quote(serialize($a_titles), "text") .
84  ", " . $ilDB->quote($pos, "integer") .
85  ", " . $ilDB->quote(self::NEW_ITEM_GROUP_TYPE_GROUP, "integer") .
86  ")");
87  return true;
88  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNewItemGroupSeparator()

static ilObjRepositorySettings::addNewItemGroupSeparator ( )
static

Definition at line 43 of file class.ilObjRepositorySettings.php.

References $DIC, $ilDB, and ILIAS\Repository\int().

Referenced by ilObjRepositorySettingsGUI\addNewItemGroupSeparator().

43  : bool
44  {
45  global $DIC;
46 
47  $ilDB = $DIC->database();
48 
49  // append
50  $pos = $ilDB->query("SELECT max(pos) mpos FROM il_new_item_grp");
51  $pos = $ilDB->fetchAssoc($pos);
52  $pos = (int) $pos["mpos"];
53  $pos += 10;
54 
55  $seq = $ilDB->nextID("il_new_item_grp");
56 
57  $ilDB->manipulate("INSERT INTO il_new_item_grp" .
58  " (id, pos, type) VALUES (" .
59  $ilDB->quote($seq, "integer") .
60  ", " . $ilDB->quote($pos, "integer") .
61  ", " . $ilDB->quote(self::NEW_ITEM_GROUP_TYPE_SEPARATOR, "integer") .
62  ")");
63  return true;
64  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjRepositorySettings::delete ( )

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

37  : bool
38  {
39  // DISABLED
40  return false;
41  }

◆ deleteNewItemGroup()

static ilObjRepositorySettings::deleteNewItemGroup ( int  $a_id)
static

Definition at line 102 of file class.ilObjRepositorySettings.php.

References $DIC, $ilDB, and $ilSetting.

Referenced by ilObjRepositorySettingsGUI\deleteNewItemGroup().

102  : bool
103  {
104  global $DIC;
105 
106  $ilDB = $DIC->database();
107  $ilSetting = $DIC->settings();
108 
109  // move subitems to unassigned
110  $sub_items = self::getNewItemGroupSubItems();
111  $sub_items = $sub_items[$a_id] ?? null;
112  if ($sub_items) {
113  foreach ($sub_items as $obj_type) {
114  $old_pos = $ilSetting->get("obj_add_new_pos_" . $obj_type);
115  if (strlen($old_pos) === 8) {
116  $new_pos = "9999" . substr($old_pos, 4);
117  $ilSetting->set("obj_add_new_pos_" . $obj_type, $new_pos);
118  $ilSetting->set("obj_add_new_pos_grp_" . $obj_type, '0');
119  }
120  }
121  }
122 
123  $ilDB->manipulate("DELETE FROM il_new_item_grp" .
124  " WHERE id = " . $ilDB->quote($a_id, "integer"));
125  return true;
126  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:18
+ Here is the caller graph for this function:

◆ deleteObjectType()

static ilObjRepositorySettings::deleteObjectType ( string  $a_type)
static

Definition at line 295 of file class.ilObjRepositorySettings.php.

References $DIC, and $ilSetting.

Referenced by ilRepUtil\deleteObjectType().

295  : void
296  {
297  global $DIC;
298 
299  $ilSetting = $DIC->settings();
300 
301  // see ilObjRepositorySettingsGUI::saveModules()
302  $ilSetting->delete("obj_dis_creation_" . $a_type);
303  $ilSetting->delete("obj_add_new_pos_" . $a_type);
304  $ilSetting->delete("obj_add_new_pos_grp_" . $a_type);
305  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:18
+ Here is the caller graph for this function:

◆ getAllObjTypes()

static ilObjRepositorySettings::getAllObjTypes ( )
staticprotected

Definition at line 181 of file class.ilObjRepositorySettings.php.

References $DIC, XapiProxy\$plugin, $res, and ilComponentInfo\TYPE_MODULES.

181  : array
182  {
183  global $DIC;
184 
185  $component_repository = $DIC["component.repository"];
186  $objDefinition = $DIC["objDefinition"];
187 
188  $res = [];
189 
190  // parse modules
191  foreach ($component_repository->getComponents() as $mod) {
192  if ($mod->getType() !== ilComponentInfo::TYPE_MODULES) {
193  continue;
194  }
195  $has_repo = false;
196  $rep_types = $objDefinition->getRepositoryObjectTypesForComponent(ilComponentInfo::TYPE_MODULES, $mod->getName());
197  if (count($rep_types) > 0) {
198  foreach ($rep_types as $ridx => $rt) {
199  // we only want to display repository modules
200  if ($rt["repository"]) {
201  $has_repo = true;
202  } else {
203  unset($rep_types[$ridx]);
204  }
205  }
206  }
207  if ($has_repo) {
208  foreach ($rep_types as $rt) {
209  $res[] = $rt["id"];
210  }
211  }
212  }
213 
214  // parse plugins
215  $pl_names = $component_repository->getPluginSlotById("robj")->getActivePlugins();
216  foreach ($pl_names as $plugin) {
217  $res[] = $plugin->getId();
218  }
219 
220  return $res;
221  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ getDefaultNewItemGrouping()

static ilObjRepositorySettings::getDefaultNewItemGrouping ( )
static

Definition at line 239 of file class.ilObjRepositorySettings.php.

References $DIC, ilObject\$lng, $res, ilObject\$title, ilLanguage\getUserLanguage(), and ilLanguage\txt().

Referenced by ilObjectAddNewItemGUI\parseRepository().

239  : array
240  {
241  global $DIC;
242 
243  $lng = $DIC->language();
244 
245  $res = [];
246 
247  $groups = [
248  "organisation" => ["fold", "sess", "cat", "catr", "crs", "crsr", "grp", "grpr", "itgr", "book", "prg", "prgr"],
249  "communication" => ["frm", "chtr"],
250  "breaker1" => null,
251  "content" => ["file", "webr", "feed", "copa", "wiki", "blog", "lm", "htlm", "sahs", 'cmix', 'lti', "lso", "glo", "dcl", "bibl", "mcst", "mep"],
252  "breaker2" => null,
253  "assessment" => ["exc", "tst", "qpl", "iass"],
254  "feedback" => ["poll", "svy", "spl"],
255  "templates" => ["prtt"]
256  ];
257 
258  $pos = 0;
259  foreach ($groups as $group => $items) {
260  $pos += 10;
261  $grp_id = $pos / 10;
262 
263  if (is_array($items)) {
264  $title = $lng->txt("rep_add_new_def_grp_" . $group);
265 
266  $res["groups"][$grp_id] = [
267  "id" => $grp_id,
268  "titles" => [$lng->getUserLanguage() => $title],
269  "pos" => $pos,
270  "type" => self::NEW_ITEM_GROUP_TYPE_GROUP,
271  "title" => $title
272  ];
273 
274  foreach ($items as $idx => $item) {
275  $res["items"][$item] = $grp_id;
276  $res["sort"][$item] = str_pad((string) $pos, 4, "0", STR_PAD_LEFT) .
277  str_pad((string) ($idx + 1), 4, "0", STR_PAD_LEFT);
278  }
279  } else {
280  $title = "COL_SEP";
281 
282  $res["groups"][$grp_id] = [
283  "id" => $grp_id,
284  "titles" => [$lng->getUserLanguage() => $title],
285  "pos" => $pos,
286  "type" => self::NEW_ITEM_GROUP_TYPE_SEPARATOR,
287  "title" => $title
288  ];
289  }
290  }
291 
292  return $res;
293  }
string $title
$res
Definition: ltiservices.php:69
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...
getUserLanguage()
Return language of user.
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewItemGroups()

static ilObjRepositorySettings::getNewItemGroups ( )
static

Definition at line 128 of file class.ilObjRepositorySettings.php.

References $DIC, $ilDB, ilObject\$lng, $res, ilObject\$title, ilLanguage\getDefaultLanguage(), and ilLanguage\txt().

Referenced by ilObjRepositorySettingsGUI\confirmDeleteNewItemGroup(), ilModulesTableGUI\getComponents(), ilNewItemGroupTableGUI\getGroups(), ilObjRepositorySettingsGUI\initNewItemGroupForm(), ilObjectAddNewItemGUI\parseRepository(), ilObjRepositorySettingsGUI\saveModules(), and ilObjRepositorySettingsGUI\saveNewItemGroupOrder().

128  : array
129  {
130  global $DIC;
131 
132  $ilDB = $DIC->database();
133  $lng = $DIC->language();
134  $ilUser = $DIC->user();
135 
136  $def_lng = $lng->getDefaultLanguage();
137  $usr_lng = $ilUser->getLanguage();
138 
139  $res = [];
140 
141  $set = $ilDB->query("SELECT * FROM il_new_item_grp ORDER BY pos");
142  while ($row = $ilDB->fetchAssoc($set)) {
143  if ((int) $row["type"] === self::NEW_ITEM_GROUP_TYPE_GROUP) {
144  $row["titles"] = unserialize($row["titles"], ["allowed_classes" => false]);
145 
146  $title = $row["titles"][$usr_lng] ?? "";
147  if ($title == "") {
148  $title = $row["titles"][$def_lng] ?? "";
149  }
150  if ($title == "") {
151  $title = array_shift($row["titles"]);
152  }
153  $row["title"] = $title;
154  } else {
155  $row["title"] = $lng->txt("rep_new_item_group_separator");
156  }
157 
158  $res[$row["id"]] = $row;
159  }
160 
161  return $res;
162  }
string $title
$res
Definition: ltiservices.php:69
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...
getDefaultLanguage()
Return default language.
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewItemGroupSubItems()

static ilObjRepositorySettings::getNewItemGroupSubItems ( )
static

Definition at line 223 of file class.ilObjRepositorySettings.php.

References $DIC, $ilSetting, $res, and ilObject\$type.

Referenced by ilNewItemGroupTableGUI\getGroups(), ilObjectAddNewItemGUI\parseRepository(), and ilObjRepositorySettingsGUI\saveNewItemGroupOrder().

223  : array
224  {
225  global $DIC;
226 
227  $ilSetting = $DIC->settings();
228 
229  $res = [];
230 
231  foreach (self::getAllObjTypes() as $type) {
232  $pos_grp = $ilSetting->get("obj_add_new_pos_grp_" . $type, '0');
233  $res[$pos_grp][] = $type;
234  }
235 
236  return $res;
237  }
$res
Definition: ltiservices.php:69
string $type
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:18
+ Here is the caller graph for this function:

◆ updateNewItemGroup()

static ilObjRepositorySettings::updateNewItemGroup ( int  $a_id,
array  $a_titles 
)
static

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

References $DIC, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\updateNewItemGroup().

90  : bool
91  {
92  global $DIC;
93 
94  $ilDB = $DIC->database();
95 
96  $ilDB->manipulate("UPDATE il_new_item_grp" .
97  " SET titles = " . $ilDB->quote(serialize($a_titles), "text") .
98  " WHERE id = " . $ilDB->quote($a_id, "integer"));
99  return true;
100  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ updateNewItemGroupOrder()

static ilObjRepositorySettings::updateNewItemGroupOrder ( array  $a_order)
static

Definition at line 164 of file class.ilObjRepositorySettings.php.

References $DIC, $id, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\saveNewItemGroupOrder().

164  : void
165  {
166  global $DIC;
167 
168  $ilDB = $DIC->database();
169 
170  asort($a_order);
171  $pos = 0;
172  foreach (array_keys($a_order) as $id) {
173  $pos += 10;
174 
175  $ilDB->manipulate("UPDATE il_new_item_grp" .
176  " SET pos = " . $ilDB->quote($pos, "integer") .
177  " WHERE id = " . $ilDB->quote($id, "integer"));
178  }
179  }
global $DIC
Definition: feed.php:28
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

Field Documentation

◆ NEW_ITEM_GROUP_TYPE_GROUP

const ilObjRepositorySettings::NEW_ITEM_GROUP_TYPE_GROUP = 1

◆ NEW_ITEM_GROUP_TYPE_SEPARATOR

const ilObjRepositorySettings::NEW_ITEM_GROUP_TYPE_SEPARATOR = 2

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


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