ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjSkillManagement Class Reference

Skill management main application class. More...

+ Inheritance diagram for ilObjSkillManagement:
+ Collaboration diagram for ilObjSkillManagement:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 update ()
 update object data More...
 
 read ()
 read style folder data More...
 
 delete ()
 delete object and all related data More...
 
 executeDragDrop ($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
 Execute Drag Drop Action. 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...
 
 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...
 

Additional Inherited Members

- 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)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 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 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
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Detailed Description

Skill management main application class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilObjSkillManagement.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjSkillManagement::__construct (   $a_id = 0,
  $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 24 of file class.ilObjSkillManagement.php.

25 {
26 global $DIC;
27
28 $this->db = $DIC->database();
29 $this->type = "skmg";
30 parent::__construct($a_id, $a_call_by_reference);
31 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ delete()

ilObjSkillManagement::delete ( )

delete object and all related data

@access public

Returns
boolean true if all object data were removed; false if only a references were removed

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

67 {
68 // always call parent delete function first!!
69 if (!parent::delete()) {
70 return false;
71 }
72
73 //put here your module specific stuff
74
75 return true;
76 }

◆ executeDragDrop()

ilObjSkillManagement::executeDragDrop (   $source_id,
  $target_id,
  $first_child,
  $as_subitem = false,
  $movecopy = "move" 
)

Execute Drag Drop Action.

Parameters
string$source_idSource element ID
string$target_idTarget element ID
string$first_childInsert as first child of target
string$movecopyPosition ("move" | "copy")

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

87 {
88 include_once("./Services/Skill/classes/class.ilSkillTree.php");
89 $tree = new ilSkillTree();
90
91 include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
92
93 $source_obj = ilSkillTreeNodeFactory::getInstance($source_id);
94
95 if (!$first_child) {
97 $target_parent = $tree->getParentId($target_id);
98 }
99 // handle skills
100 if ($source_obj->getType() == "skll") {
101 if ($tree->isInTree($source_obj->getId())) {
102 $node_data = $tree->getNodeData($source_obj->getId());
103
104 // cut on move
105 if ($movecopy == "move") {
106 $parent_id = $tree->getParentId($source_obj->getId());
107 $tree->deleteTree($node_data);
108 }
109
110 // paste page
111 if (!$tree->isInTree($source_obj->getId())) {
112 if ($first_child) { // as first child
113 $target_pos = IL_FIRST_NODE;
114 $parent = $target_id;
115 } elseif ($as_subitem) { // as last child
116 $parent = $target_id;
117 $target_pos = IL_FIRST_NODE;
118 $childs = $tree->getChildsByType($parent, array("skll", "scat"));
119 if (count($childs) != 0) {
120 $target_pos = $childs[count($childs) - 1]["obj_id"];
121 }
122 } else { // at position
123 $target_pos = $target_id;
124 $parent = $target_parent;
125 }
126 // insert skill into tree
127 $tree->insertNode(
128 $source_obj->getId(),
129 $parent,
130 $target_pos
131 );
132 }
133 }
134 }
135
136 // handle skil categories
137 if ($source_obj->getType() == "scat") {
138 $source_node = $tree->getNodeData($source_id);
139 $subnodes = $tree->getSubtree($source_node);
140
141 // check, if target is within subtree
142 foreach ($subnodes as $subnode) {
143 if ($subnode["obj_id"] == $target_id) {
144 return;
145 }
146 }
147
148 $target_pos = $target_id;
149
150 if ($first_child) { // as first node
151 $target_pos = IL_FIRST_NODE;
152 $target_parent = $target_id;
153 } elseif ($as_subitem) { // as last node
154 $target_parent = $target_id;
155 $target_pos = IL_FIRST_NODE;
156 $childs = $tree->getChilds($target_parent);
157 if (count($childs) != 0) {
158 $target_pos = $childs[count($childs) - 1]["obj_id"];
159 }
160 }
161
162 // delete source tree
163 if ($movecopy == "move") {
164 $tree->deleteTree($source_node);
165 }
166
167 if (!$tree->isInTree($source_id)) {
168 $tree->insertNode($source_id, $target_parent, $target_pos);
169
170 // insert moved tree
171 if ($movecopy == "move") {
172 foreach ($subnodes as $node) {
173 if ($node["obj_id"] != $source_id) {
174 $tree->insertNode($node["obj_id"], $node["parent"]);
175 }
176 }
177 }
178 }
179 }
180 }
const IL_FIRST_NODE
Definition: class.ilTree.php:5
$target_id
Definition: goto.php:49

References $target_id, ilObject\$tree, ilSkillTreeNodeFactory\getInstance(), and IL_FIRST_NODE.

+ Here is the call graph for this function:

◆ read()

ilObjSkillManagement::read ( )

read style folder data

Reimplemented from ilObject.

Definition at line 53 of file class.ilObjSkillManagement.php.

54 {
56
57 parent::read();
58 }
global $ilDB

References ilObject\$db, and $ilDB.

◆ update()

ilObjSkillManagement::update ( )

update object data

@access public

Returns
boolean

Reimplemented from ilObject.

Definition at line 39 of file class.ilObjSkillManagement.php.

40 {
42
43 if (!parent::update()) {
44 return false;
45 }
46
47 return true;
48 }
update($pash, $contents, Config $config)

References ilObject\$db, $ilDB, and League\Flysystem\Adapter\Polyfill\update().

+ Here is the call graph for this function:

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