ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 
- 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...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. 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 ()
 Gets the disk usage of the object in bytes. More...
 
 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...
 
 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 ()
 
 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 lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. 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, $a_deleted_by)
 
static setDeletedDates ($a_ref_ids, $a_user_id)
 Set deleted date. 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 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
 
 $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 ()
 

Additional Inherited Members

- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

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 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ addNewItemGroup()

static ilObjRepositorySettings::addNewItemGroup ( array  $a_titles)
static

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

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

References $DIC, and $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 $DIC;
40
41 $ilDB = $DIC->database();
42
43 // append
44 $pos = $ilDB->query("SELECT max(pos) mpos FROM il_new_item_grp");
45 $pos = $ilDB->fetchAssoc($pos);
46 $pos = (int) $pos["mpos"];
47 $pos += 10;
48
49 $seq = $ilDB->nextID("il_new_item_grp");
50
51 $ilDB->manipulate("INSERT INTO il_new_item_grp" .
52 " (id, pos, type) VALUES (" .
53 $ilDB->quote($seq, "integer") .
54 ", " . $ilDB->quote($pos, "integer") .
55 ", " . $ilDB->quote(self::NEW_ITEM_GROUP_TYPE_SEPARATOR, "integer") .
56 ")");
57 return true;
58 }

References $DIC, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\addNewItemGroupSeparator().

+ Here is the caller graph for this function:

◆ delete()

ilObjRepositorySettings::delete ( )

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

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

References $DIC, $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 287 of file class.ilObjRepositorySettings.php.

288 {
289 global $DIC;
290
291 $ilSetting = $DIC->settings();
292
293 // see ilObjRepositorySettingsGUI::saveModules()
294 $ilSetting->delete("obj_dis_creation_" . $a_type);
295 $ilSetting->delete("obj_add_new_pos_" . $a_type);
296 $ilSetting->delete("obj_add_new_pos_grp_" . $a_type);
297 }
$a_type
Definition: workflow.php:92

References $a_type, $DIC, and $ilSetting.

Referenced by ilRepUtil\deleteObjectType().

+ Here is the caller graph for this function:

◆ getAllObjTypes()

static ilObjRepositorySettings::getAllObjTypes ( )
staticprotected

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

176 {
177 global $DIC;
178
179 $ilPluginAdmin = $DIC["ilPluginAdmin"];
180 $objDefinition = $DIC["objDefinition"];
181
182 $res = array();
183
184 // parse modules
185 include_once("./Services/Component/classes/class.ilModule.php");
186 foreach (ilModule::getAvailableCoreModules() as $mod) {
187 $has_repo = false;
188 $rep_types = $objDefinition->getRepositoryObjectTypesForComponent(IL_COMP_MODULE, $mod["subdir"]);
189 if (sizeof($rep_types) > 0) {
190 foreach ($rep_types as $ridx => $rt) {
191 // we only want to display repository modules
192 if ($rt["repository"]) {
193 $has_repo = true;
194 } else {
195 unset($rep_types[$ridx]);
196 }
197 }
198 }
199 if ($has_repo) {
200 foreach ($rep_types as $rt) {
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 $pl_id = ilPlugin::lookupIdForName(IL_COMP_SERVICE, "Repository", "robj", $pl_name);
211 if ($pl_id) {
212 $res[] = $pl_id;
213 }
214 }
215
216 return $res;
217 }
const IL_COMP_SERVICE
const IL_COMP_MODULE
static getAvailableCoreModules()
Get all available core modules.
static lookupIdForName(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_name)
foreach($_POST as $key=> $value) $res

References $DIC, ilObject\$objDefinition, $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 235 of file class.ilObjRepositorySettings.php.

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

References $DIC, 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 122 of file class.ilObjRepositorySettings.php.

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

References $DIC, $ilDB, $ilUser, ilObject\$lng, $res, 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 219 of file class.ilObjRepositorySettings.php.

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

References $DIC, $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 84 of file class.ilObjRepositorySettings.php.

85 {
86 global $DIC;
87
88 $ilDB = $DIC->database();
89
90 $ilDB->manipulate("UPDATE il_new_item_grp" .
91 " SET titles = " . $ilDB->quote(serialize($a_titles), "text") .
92 " WHERE id = " . $ilDB->quote($a_id, "integer"));
93 return true;
94 }

References $DIC, and $ilDB.

Referenced by ilObjRepositorySettingsGUI\updateNewItemGroup().

+ Here is the caller graph for this function:

◆ updateNewItemGroupOrder()

static ilObjRepositorySettings::updateNewItemGroupOrder ( array  $a_order)
static

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

159 {
160 global $DIC;
161
162 $ilDB = $DIC->database();
163
164 asort($a_order);
165 $pos = 0;
166 foreach (array_keys($a_order) as $id) {
167 $pos += 10;
168
169 $ilDB->manipulate("UPDATE il_new_item_grp" .
170 " SET pos = " . $ilDB->quote($pos, "integer") .
171 " WHERE id = " . $ilDB->quote($id, "integer"));
172 }
173 }

References $DIC, 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: