5 require_once
"./Services/Container/classes/class.ilContainer.php";
27 public function __construct($a_id = 0, $a_call_by_reference =
true)
31 $this->db = $DIC->database();
32 $this->app_event_handler = $DIC[
"ilAppEventHandler"];
33 $this->log = $DIC[
"ilLog"];
34 $this->
user = $DIC->user();
36 parent::__construct($a_id, $a_call_by_reference);
45 public function delete()
51 if (!parent::delete()) {
56 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
59 $query =
"DELETE FROM object_translation WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer');
63 include_once
"Services/Taxonomy/classes/class.ilObjTaxonomy.php";
71 $ilAppEventHandler->raise(
74 array(
'object' => $this,
75 'obj_id' => $this->
getId())
91 $q =
"SELECT * FROM object_translation WHERE obj_id = " .
92 $ilDB->quote($this->
getId(),
'integer') .
" ORDER BY lang_default DESC";
99 "desc" =>
$row->description,
100 "lang" =>
$row->lang_code
106 $data[
"default_language"] = 0;
116 $query =
"DELETE FROM object_translation WHERE obj_id= " .
126 $query =
"DELETE FROM object_translation WHERE obj_id= " .
127 $ilDB->quote($this->
getId(),
'integer') .
" AND lang_code = " .
128 $ilDB->quote($a_lang,
'text');
137 if (empty($a_title)) {
138 $a_title =
"NO TITLE";
141 $query =
"INSERT INTO object_translation " .
142 "(obj_id,title,description,lang_code,lang_default) " .
144 "(" .
$ilDB->quote($this->
getId(),
'integer') .
"," .
145 $ilDB->quote($a_title,
'text') .
"," .
$ilDB->quote($a_desc,
'text') .
"," .
146 $ilDB->quote($a_lang,
'text') .
"," .
$ilDB->quote($a_lang_default,
'integer') .
")";
158 if (empty($a_title)) {
159 $a_title =
"NO TITLE";
162 $query =
"UPDATE object_translation " .
163 "SET title = " .
$ilDB->quote($a_title,
'text') .
"," .
164 "description = " .
$ilDB->quote($a_desc,
'text') .
"," .
165 "lang_code = " .
$ilDB->quote($a_lang,
'text') .
"," .
166 "lang_default = " .
$ilDB->quote($a_lang_default,
'integer') .
" " .
168 " obj_id = " .
$ilDB->quote($this->
getId(),
'integer');
182 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
184 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
186 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
188 $ot->copy($new_obj->getId());
195 parent::cloneDependencies($a_target_id, $a_copy_id);
200 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
202 if (
sizeof($all_tax)) {
203 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
206 $mappings = $cwo->getMappings();
208 foreach ($all_tax as $old_tax_id) {
212 $new_tax = $old_tax->cloneObject(0, 0,
true);
213 $tax_map = $old_tax->getNodeMapping();
219 foreach ($mappings as $old_ref_id => $new_ref_id) {
220 if ($old_ref_id != $new_ref_id) {
226 $assignmts = $tax_ass->getAssignmentsOfItem($old_obj_id);
227 if (
sizeof($assignmts)) {
229 foreach ($assignmts as $a) {
230 if ($tax_map[$a[
"node_id"]]) {
231 $new_tax_ass->
addAssignment($tax_map[$a[
"node_id"]], $new_obj_id);
248 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)
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.
foreach($_POST as $key=> $value) $res
getId()
get object id public
cloneDependencies($a_target_id, $a_copy_id)
static _lookupObjId($a_id)
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.
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
static getInstance($a_obj_id)
Get instance.
const USER_FOLDER_ID
Class ilObjUserFolder.