ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjRepositorySettings Class Reference

Class ilObjRepositorySettings. More...

+ Inheritance diagram for ilObjRepositorySettings:
+ Collaboration diagram for ilObjRepositorySettings:

Public Member Functions

 __construct ($a_id, $a_call_by_reference=true)
 Constructor @access public. More...
 
 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...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects 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 ($a_id, array $a_titles)
 
static deleteNewItemGroup ($a_id)
 
static getNewItemGroups ()
 
static updateNewItemGroupOrder (array $a_order)
 
static getNewItemGroupSubItems ()
 
static getDefaultNewItemGrouping ()
 
static deleteObjectType ($a_type)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

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
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Static Protected Member Functions

static getAllObjTypes ()
 

Detailed Description

Class ilObjRepositorySettings.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilObjSystemFolder.php 33501 2012-03-03 11:11:05Z akill

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Reimplemented from ilObject.

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

26 {
27 $this->type = "reps";
28 parent::__construct($a_id,$a_call_by_reference);
29 }

Member Function Documentation

◆ addNewItemGroup()

static ilObjRepositorySettings::addNewItemGroup ( array  $a_titles)
static

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

59 {
60 global $ilDB;
61
62 // append
63 $pos = $ilDB->query("SELECT max(pos) mpos FROM il_new_item_grp");
64 $pos = $ilDB->fetchAssoc($pos);
65 $pos = (int)$pos["mpos"];
66 $pos += 10;
67
68 $seq = $ilDB->nextID("il_new_item_grp");
69
70 $ilDB->manipulate("INSERT INTO il_new_item_grp".
71 " (id, titles, pos, type) VALUES (".
72 $ilDB->quote($seq, "integer").
73 ", ".$ilDB->quote(serialize($a_titles), "text").
74 ", ".$ilDB->quote($pos, "integer").
75 ", ".$ilDB->quote(self::NEW_ITEM_GROUP_TYPE_GROUP, "integer").
76 ")");
77 return true;
78 }
global $ilDB

References $ilDB.

Referenced by ilObjRepositorySettingsGUI\saveNewItemGroup().

+ Here is the caller graph for this function:

◆ addNewItemGroupSeparator()

static ilObjRepositorySettings::addNewItemGroupSeparator ( )
static

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

38 {
39 global $ilDB;
40
41 // append
42 $pos = $ilDB->query("SELECT max(pos) mpos FROM il_new_item_grp");
43 $pos = $ilDB->fetchAssoc($pos);
44 $pos = (int)$pos["mpos"];
45 $pos += 10;
46
47 $seq = $ilDB->nextID("il_new_item_grp");
48
49 $ilDB->manipulate("INSERT INTO il_new_item_grp".
50 " (id, pos, type) VALUES (".
51 $ilDB->quote($seq, "integer").
52 ", ".$ilDB->quote($pos, "integer").
53 ", ".$ilDB->quote(self::NEW_ITEM_GROUP_TYPE_SEPARATOR, "integer").
54 ")");
55 return true;
56 }

References $ilDB.

Referenced by ilObjRepositorySettingsGUI\addNewItemGroupSeparator().

+ Here is the caller graph for this function:

◆ delete()

ilObjRepositorySettings::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!!

@access public

Returns
boolean true if object was removed completely; false if only a references was removed

Reimplemented from ilObject.

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

32 {
33 // DISABLED
34 return false;
35 }

◆ deleteNewItemGroup()

static ilObjRepositorySettings::deleteNewItemGroup (   $a_id)
static

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

91 {
92 global $ilDB, $ilSetting;
93
94 // move subitems to unassigned
95 $sub_items = self::getNewItemGroupSubItems();
96 $sub_items = $sub_items[$a_id];
97 if($sub_items)
98 {
99 foreach($sub_items as $obj_type)
100 {
101 $old_pos = $ilSetting->get("obj_add_new_pos_".$obj_type);
102 if(strlen($old_pos) == 8)
103 {
104 $new_pos = "9999".substr($old_pos, 4);
105 $ilSetting->set("obj_add_new_pos_".$obj_type, $new_pos);
106 $ilSetting->set("obj_add_new_pos_grp_".$obj_type, 0);
107 }
108 }
109 }
110
111 $ilDB->manipulate("DELETE FROM il_new_item_grp".
112 " WHERE id = ".$ilDB->quote($a_id, "integer"));
113 return true;
114 }
global $ilSetting
Definition: privfeed.php:17

References $ilDB, $ilSetting, and getNewItemGroupSubItems().

Referenced by ilObjRepositorySettingsGUI\deleteNewItemGroup().

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

◆ deleteObjectType()

static ilObjRepositorySettings::deleteObjectType (   $a_type)
static

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

292 {
293 global $ilSetting;
294
295 // see ilObjRepositorySettingsGUI::saveModules()
296 $ilSetting->delete("obj_dis_creation_".$a_type);
297 $ilSetting->delete("obj_add_new_pos_".$a_type);
298 $ilSetting->delete("obj_add_new_pos_grp_".$a_type);
299 }
$a_type
Definition: workflow.php:93

References $a_type, and $ilSetting.

Referenced by ilRepUtil\deleteObjectType().

+ Here is the caller graph for this function:

◆ getAllObjTypes()

static ilObjRepositorySettings::getAllObjTypes ( )
staticprotected

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

171 {
172 global $ilPluginAdmin, $objDefinition;
173
174 $res = array();
175
176 // parse modules
177 include_once("./Services/Component/classes/class.ilModule.php");
178 foreach(ilModule::getAvailableCoreModules() as $mod)
179 {
180 $has_repo = false;
181 $rep_types = $objDefinition->getRepositoryObjectTypesForComponent(IL_COMP_MODULE, $mod["subdir"]);
182 if(sizeof($rep_types) > 0)
183 {
184 foreach($rep_types as $ridx => $rt)
185 {
186 // we only want to display repository modules
187 if($rt["repository"])
188 {
189 $has_repo = true;
190 }
191 else
192 {
193 unset($rep_types[$ridx]);
194 }
195 }
196 }
197 if($has_repo)
198 {
199 foreach($rep_types as $rt)
200 {
201 $res[] = $rt["id"];
202 }
203 }
204 }
205
206 // parse plugins
207 include_once("./Services/Component/classes/class.ilPlugin.php");
208 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
209 foreach ($pl_names as $pl_name)
210 {
211 $pl_id = ilPlugin::lookupIdForName(IL_COMP_SERVICE, "Repository", "robj", $pl_name);
212 if($pl_id)
213 {
214 $res[] = $pl_id;
215 }
216 }
217
218 return $res;
219 }
const IL_COMP_SERVICE
const IL_COMP_MODULE
static getAvailableCoreModules()
Get all available core modules.
static lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.

References $res, ilModule\getAvailableCoreModules(), IL_COMP_MODULE, IL_COMP_SERVICE, and ilPlugin\lookupIdForName().

+ Here is the call graph for this function:

◆ getDefaultNewItemGrouping()

static ilObjRepositorySettings::getDefaultNewItemGrouping ( )
static

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

237 {
238 global $lng;
239
240 $res = array();
241
242 $groups = array(
243 "organisation" => array("fold", "sess", "cat", "catr", "crs", "crsr", "grp", "grpr", "itgr", "book", "prg"),
244 "communication" => array("frm", "chtr"),
245 "breaker1" => null,
246 "content" => array("file", "webr", "feed", "wiki", "blog", "lm", "htlm", "sahs", "glo", "dcl", "bibl", "mcst", "mep"),
247 "breaker2" => null,
248 "assessment" => array("exc", "tst", "qpl", "iass"),
249 "feedback" => array("poll", "svy", "spl"),
250 "templates" => array("prtt")
251 );
252
253 $pos = 0;
254 foreach($groups as $group => $items)
255 {
256 $pos += 10;
257 $grp_id = $pos/10;
258
259 if(is_array($items))
260 {
261 $title = $lng->txt("rep_add_new_def_grp_".$group);
262
263 $res["groups"][$grp_id] = array("id" => $grp_id,
264 "titles" => array($lng->getUserLanguage() => $title),
265 "pos" => $pos,
266 "type" => self::NEW_ITEM_GROUP_TYPE_GROUP,
267 "title" => $title);
268
269 foreach($items as $idx => $item)
270 {
271 $res["items"][$item] = $grp_id;
272 $res["sort"][$item] = str_pad($pos, 4, "0", STR_PAD_LEFT).
273 str_pad($idx+1, 4, "0", STR_PAD_LEFT);
274 }
275 }
276 else
277 {
278 $title = "COL_SEP";
279
280 $res["groups"][$grp_id] = array("id" => $grp_id,
281 "titles" => array($lng->getUserLanguage() => $title),
282 "pos" => $pos,
283 "type" => self::NEW_ITEM_GROUP_TYPE_SEPARATOR,
284 "title" => $title);
285 }
286 }
287
288 return $res;
289 }

References ilObject\$lng, $res, and ilObject\$title.

Referenced by ilObjectAddNewItemGUI\parseRepository().

+ Here is the caller graph for this function:

◆ getNewItemGroups()

static ilObjRepositorySettings::getNewItemGroups ( )
static

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

117 {
118 global $ilDB, $lng, $ilUser;
119
120 $def_lng = $lng->getDefaultLanguage();
121 $usr_lng = $ilUser->getLanguage();
122
123 $res = array();
124
125 $set = $ilDB->query("SELECT * FROM il_new_item_grp ORDER BY pos");
126 while($row = $ilDB->fetchAssoc($set))
127 {
128 if($row["type"] == self::NEW_ITEM_GROUP_TYPE_GROUP)
129 {
130 $row["titles"] = unserialize($row["titles"]);
131
132 $title = $row["titles"][$usr_lng];
133 if(!$title)
134 {
135 $title = $row["titles"][$def_lng];
136 }
137 if(!$title)
138 {
139 $title = array_shift($row["titles"]);
140 }
141 $row["title"] = $title;
142 }
143 else
144 {
145 $row["title"] = $lng->txt("rep_new_item_group_separator");
146 }
147
148 $res[$row["id"]] = $row;
149 }
150
151 return $res;
152 }
$ilUser
Definition: imgupload.php:18

References $ilDB, $ilUser, ilObject\$lng, $res, $row, and ilObject\$title.

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

+ Here is the caller graph for this function:

◆ getNewItemGroupSubItems()

static ilObjRepositorySettings::getNewItemGroupSubItems ( )
static

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

222 {
223 global $ilSetting;
224
225 $res = array();
226
227 foreach(self::getAllObjTypes() as $type)
228 {
229 $pos_grp = $ilSetting->get("obj_add_new_pos_grp_".$type, 0);
230 $res[$pos_grp][] = $type;
231 }
232
233 return $res;
234 }

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

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

+ Here is the caller graph for this function:

◆ updateNewItemGroup()

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

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

81 {
82 global $ilDB;
83
84 $ilDB->manipulate("UPDATE il_new_item_grp".
85 " SET titles = ".$ilDB->quote(serialize($a_titles), "text").
86 " WHERE id = ".$ilDB->quote($a_id, "integer"));
87 return true;
88 }

References $ilDB.

Referenced by ilObjRepositorySettingsGUI\updateNewItemGroup().

+ Here is the caller graph for this function:

◆ updateNewItemGroupOrder()

static ilObjRepositorySettings::updateNewItemGroupOrder ( array  $a_order)
static

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

155 {
156 global $ilDB;
157
158 asort($a_order);
159 $pos = 0;
160 foreach(array_keys($a_order) as $id)
161 {
162 $pos += 10;
163
164 $ilDB->manipulate("UPDATE il_new_item_grp".
165 " SET pos = ".$ilDB->quote($pos, "integer").
166 " WHERE id = ".$ilDB->quote($id, "integer"));
167 }
168 }

References ilObject\$id, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\saveNewItemGroupOrder().

+ 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 17 of file class.ilObjRepositorySettings.php.


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