ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjRepositorySettings Class Reference

Class ilObjRepositorySettings. 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 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 getIconForType (string $type)
 
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)
 

Static Protected Member Functions

static getAllObjTypes ()
 

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
 
- 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
 
LOMServices $lom_services
 
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

Constructor & Destructor Documentation

◆ __construct()

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

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

References ILIAS\GlobalScreen\Provider\__construct().

29  {
30  $this->type = "reps";
31  parent::__construct($a_id, $a_call_by_reference);
32  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addNewItemGroup()

static ilObjRepositorySettings::addNewItemGroup ( array  $a_titles)
static

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

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

Referenced by ilObjRepositorySettingsGUI\saveNewItemGroup().

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

◆ delete()

ilObjRepositorySettings::delete ( )

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

34  : bool
35  {
36  // DISABLED
37  return false;
38  }

◆ deleteNewItemGroup()

static ilObjRepositorySettings::deleteNewItemGroup ( int  $a_id)
static

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

References $DIC, $ilDB, $ilSetting, and null.

Referenced by ilObjRepositorySettingsGUI\deleteNewItemGroup().

75  : bool
76  {
77  global $DIC;
78 
79  $ilDB = $DIC->database();
80  $ilSetting = $DIC->settings();
81 
82  // move subitems to unassigned
83  $sub_items = self::getNewItemGroupSubItems();
84  $sub_items = $sub_items[$a_id] ?? null;
85  if ($sub_items) {
86  foreach ($sub_items as $obj_type) {
87  $old_pos = $ilSetting->get("obj_add_new_pos_" . $obj_type);
88  if (strlen($old_pos) === 8) {
89  $new_pos = "9999" . substr($old_pos, 4);
90  $ilSetting->set("obj_add_new_pos_" . $obj_type, $new_pos);
91  $ilSetting->set("obj_add_new_pos_grp_" . $obj_type, '0');
92  }
93  }
94  }
95 
96  $ilDB->manipulate("DELETE FROM il_new_item_grp" .
97  " WHERE id = " . $ilDB->quote($a_id, "integer"));
98  return true;
99  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
global $ilSetting
Definition: privfeed.php:31
+ Here is the caller graph for this function:

◆ deleteObjectType()

static ilObjRepositorySettings::deleteObjectType ( string  $a_type)
static

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

References $DIC, and $ilSetting.

Referenced by ilRepUtil\deleteObjectType().

252  : void
253  {
254  global $DIC;
255 
256  $ilSetting = $DIC->settings();
257 
258  // see ilObjRepositorySettingsGUI::saveModules()
259  $ilSetting->delete("obj_dis_creation_" . $a_type);
260  $ilSetting->delete("obj_add_new_pos_" . $a_type);
261  $ilSetting->delete("obj_add_new_pos_grp_" . $a_type);
262  }
global $DIC
Definition: shib_login.php:22
global $ilSetting
Definition: privfeed.php:31
+ Here is the caller graph for this function:

◆ getAllObjTypes()

static ilObjRepositorySettings::getAllObjTypes ( )
staticprotected

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

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

153  : array
154  {
155  global $DIC;
156 
157  $component_repository = $DIC["component.repository"];
158  $objDefinition = $DIC["objDefinition"];
159 
160  $res = [];
161 
162  // parse modules
163  foreach ($component_repository->getComponents() as $mod) {
164  if ($mod->getType() !== ilComponentInfo::TYPE_MODULES) {
165  continue;
166  }
167  $has_repo = false;
168  $rep_types = $objDefinition->getRepositoryObjectTypesForComponent(ilComponentInfo::TYPE_MODULES, $mod->getName());
169  if (count($rep_types) > 0) {
170  foreach ($rep_types as $ridx => $rt) {
171  // we only want to display repository modules
172  if ($rt["repository"]) {
173  $has_repo = true;
174  } else {
175  unset($rep_types[$ridx]);
176  }
177  }
178  }
179  if ($has_repo) {
180  foreach ($rep_types as $rt) {
181  $res[] = $rt["id"];
182  }
183  }
184  }
185 
186  // parse plugins
187  $pl_names = $component_repository->getPluginSlotById("robj")->getActivePlugins();
188  foreach ($pl_names as $plugin) {
189  $res[] = $plugin->getId();
190  }
191 
192  return $res;
193  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22

◆ getDefaultNewItemGrouping()

static ilObjRepositorySettings::getDefaultNewItemGrouping ( )
static

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

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

Referenced by ilObjectGUI\buildAddNewItemElements().

211  : array
212  {
213  global $DIC;
214 
215  $lng = $DIC->language();
216 
217  $res = [];
218 
219  $groups = [
220  "content" => ["file", "webr", "feed", "copa", "wiki", "blog", "lm", "htlm", "sahs", 'cmix', 'lti', "lso", "glo", "dcl", "bibl", "mcst", "mep"],
221  "organisation" => ["fold", "sess", "cat", "catr", "crs", "crsr", "grp", "grpr", "itgr", "book", "prg", "prgr"],
222  "communication" => ["frm", "chtr"],
223  "assessment" => ["exc", "tst", "qpl", "iass"],
224  "feedback" => ["poll", "svy", "spl"],
225  "templates" => ["prtt"]
226  ];
227 
228  $pos = 0;
229  foreach ($groups as $group => $items) {
230  $pos += 10;
231  $grp_id = $pos / 10;
232 
233  $title = $lng->txt("rep_add_new_def_grp_" . $group);
234 
235  $res["groups"][$grp_id] = [
236  "id" => $grp_id,
237  "titles" => [$lng->getUserLanguage() => $title],
238  "pos" => $pos,
239  "title" => $title
240  ];
241 
242  foreach ($items as $idx => $item) {
243  $res["items"][$item] = $grp_id;
244  $res["sort"][$item] = str_pad((string) $pos, 4, "0", STR_PAD_LEFT) .
245  str_pad((string) ($idx + 1), 4, "0", STR_PAD_LEFT);
246  }
247  }
248 
249  return $res;
250  }
string $title
$res
Definition: ltiservices.php:66
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.
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewItemGroups()

static ilObjRepositorySettings::getNewItemGroups ( )
static

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

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

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

101  : array
102  {
103  global $DIC;
104 
105  $ilDB = $DIC->database();
106  $lng = $DIC->language();
107  $ilUser = $DIC->user();
108 
109  $def_lng = $lng->getDefaultLanguage();
110  $usr_lng = $ilUser->getLanguage();
111 
112  $res = [];
113 
114  $set = $ilDB->query("SELECT * FROM il_new_item_grp ORDER BY pos");
115  while ($row = $ilDB->fetchAssoc($set)) {
116  if ($row['titles'] === null) {
117  continue;
118  }
119  $row["titles"] = unserialize($row["titles"], ["allowed_classes" => false]);
120 
121  $title = $row["titles"][$usr_lng] ?? false;
122  if (!$title) {
123  $title = $row["titles"][$def_lng] ?? false;
124  }
125  if (!$title) {
126  $title = array_shift($row["titles"]);
127  }
128  $row["title"] = $title;
129 
130  $res[$row["id"]] = $row;
131  }
132 
133  return $res;
134  }
string $title
$res
Definition: ltiservices.php:66
getDefaultLanguage()
Return default language.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewItemGroupSubItems()

static ilObjRepositorySettings::getNewItemGroupSubItems ( )
static

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

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

Referenced by ilObjectGUI\buildAddNewItemElements(), ilNewItemGroupTableGUI\getGroups(), and ilObjRepositorySettingsGUI\saveNewItemGroupOrder().

195  : array
196  {
197  global $DIC;
198 
199  $ilSetting = $DIC->settings();
200 
201  $res = [];
202 
203  foreach (self::getAllObjTypes() as $type) {
204  $pos_grp = $ilSetting->get("obj_add_new_pos_grp_" . $type, '0');
205  $res[$pos_grp][] = $type;
206  }
207 
208  return $res;
209  }
$res
Definition: ltiservices.php:66
string $type
global $DIC
Definition: shib_login.php:22
global $ilSetting
Definition: privfeed.php:31
+ Here is the caller graph for this function:

◆ updateNewItemGroup()

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

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

References $DIC, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\updateNewItemGroup().

63  : bool
64  {
65  global $DIC;
66 
67  $ilDB = $DIC->database();
68 
69  $ilDB->manipulate("UPDATE il_new_item_grp" .
70  " SET titles = " . $ilDB->quote(serialize($a_titles), "text") .
71  " WHERE id = " . $ilDB->quote($a_id, "integer"));
72  return true;
73  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ updateNewItemGroupOrder()

static ilObjRepositorySettings::updateNewItemGroupOrder ( array  $a_order)
static

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

References $DIC, $id, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\saveNewItemGroupOrder().

136  : void
137  {
138  global $DIC;
139 
140  $ilDB = $DIC->database();
141 
142  asort($a_order);
143  $pos = 0;
144  foreach (array_keys($a_order) as $id) {
145  $pos += 10;
146 
147  $ilDB->manipulate("UPDATE il_new_item_grp" .
148  " SET pos = " . $ilDB->quote($pos, "integer") .
149  " WHERE id = " . $ilDB->quote($id, "integer"));
150  }
151  }
global $DIC
Definition: shib_login.php:22
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

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