5 require_once
"./Services/Container/classes/class.ilContainer.php";
30 parent::__construct($a_id,$a_call_by_reference);
41 global
$ilDB,$ilAppEventHandler;
44 if (!parent::delete())
50 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
53 $query =
"DELETE FROM object_translation WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer');
57 include_once
"Services/Taxonomy/classes/class.ilObjTaxonomy.php";
67 $ilAppEventHandler->raise(
'Modules/Category',
69 array(
'object' => $this,
70 'obj_id' => $this->
getId()));
85 $q =
"SELECT * FROM object_translation WHERE obj_id = ".
86 $ilDB->quote($this->
getId(),
'integer').
" ORDER BY lang_default DESC";
87 $r = $this->
ilias->db->query($q);
94 "desc" =>
$row->description,
95 "lang" =>
$row->lang_code
101 $data[
"default_language"] = 0;
111 $query =
"DELETE FROM object_translation WHERE obj_id= ".
112 $ilDB->quote($this->
getId(),
'integer');
121 $query =
"DELETE FROM object_translation WHERE obj_id= ".
122 $ilDB->quote($this->
getId(),
'integer').
" AND lang_code = ".
123 $ilDB->quote($a_lang,
'text');
134 $a_title =
"NO TITLE";
137 $query =
"INSERT INTO object_translation ".
138 "(obj_id,title,description,lang_code,lang_default) ".
140 "(".$ilDB->quote($this->
getId(),
'integer').
",".
141 $ilDB->quote($a_title,
'text').
",".$ilDB->quote($a_desc,
'text').
",".
142 $ilDB->quote($a_lang,
'text').
",".$ilDB->quote($a_lang_default,
'integer').
")";
155 $a_title =
"NO TITLE";
158 $query =
"UPDATE object_translation ".
159 "SET title = ". $ilDB->quote($a_title,
'text').
",".
160 "description = ".$ilDB->quote($a_desc,
'text').
",".
161 "lang_code = ".$ilDB->quote($a_lang,
'text') .
",".
162 "lang_default = ".$ilDB->quote($a_lang_default,
'integer').
" ".
164 " obj_id = ".$ilDB->quote($this->
getId(),
'integer');
178 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
182 $new_obj = parent::cloneObject($a_target_id,$a_copy_id,$a_omit_tree);
189 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
191 $ot->copy($new_obj->getId());
219 parent::cloneDependencies($a_target_id,$a_copy_id);
224 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
228 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
231 $mappings = $cwo->getMappings();
233 foreach($all_tax as $old_tax_id)
239 $new_tax = $old_tax->cloneObject(0,0,
true);
240 $tax_map = $old_tax->getNodeMapping();
246 foreach($mappings as $old_ref_id => $new_ref_id)
248 if($old_ref_id != $new_ref_id)
255 $assignmts = $tax_ass->getAssignmentsOfItem($old_obj_id);
256 if(
sizeof($assignmts))
259 foreach($assignmts as $a)
261 if($tax_map[$a[
"node_id"]])
263 $new_tax_ass->
addAssignment($tax_map[$a[
"node_id"]], $new_obj_id);
280 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
static _updateUserFolderAssignment($a_old_id, $a_new_id)
Update user folder assignment Typically called after deleting a category with local user accounts...
addAssignment($a_node_id, $a_item_id, $a_order_nr=0)
Add assignment.
Taxonomy node <-> item assignment.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
deleteTranslation($a_lang)
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone course (no member data)
getBigIconPath()
Get path for big icon.
getTinyIconPath()
Get path for tiny icon.
getTranslations()
get all translations from this category
addTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
addAdditionalSubItemInformation(&$a_item_data)
Add additional information to sub item, e.g.
getId()
get object id public
cloneDependencies($a_target_id, $a_copy_id)
static _lookupObjId($a_id)
redirection script todo: (a better solution should control the processing via a xml file) ...
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
updateTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
getSmallIconPath()
Get path for small icon.
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
static getInstance($a_obj_id)
Get instance.
const USER_FOLDER_ID
Class ilObjUserFolder.