ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilObjWorkspaceRootFolder.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
require_once
"Services/Object/classes/class.ilObject2.php"
;
6
15
class
ilObjWorkspaceRootFolder
extends
ilObject2
16
{
17
21
public
function
__construct
($a_id = 0, $a_reference =
true
)
22
{
23
global
$DIC
;
24
parent::__construct($a_id, $a_reference);
25
26
$this->db = $DIC->database();
27
}
28
29
public
function
initType
()
30
{
31
$this->type =
"wsrt"
;
32
}
33
40
public
function
getTranslations
()
41
{
42
$ilDB
=
$this->db
;
43
44
$q =
"SELECT * FROM object_translation WHERE obj_id = "
.
45
$ilDB
->quote($this->
getId
(),
'integer'
) .
" ORDER BY lang_default DESC"
;
46
$r
=
$ilDB
->query($q);
47
48
$num = 0;
49
50
$data
[
"Fobject"
] =
array
();
51
while
(
$row
=
$r
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
52
$data
[
"Fobject"
][$num]=
array
(
"title"
=>
$row
->title,
53
"desc"
=>
$row
->description,
54
"lang"
=>
$row
->lang_code
55
);
56
$num++;
57
}
58
59
// first entry is always the default language
60
$data
[
"default_language"
] = 0;
61
62
return
$data
?
$data
:
array
();
63
}
64
65
// remove all Translations of current category
66
public
function
removeTranslations
()
67
{
68
$ilDB
=
$this->db
;
69
70
$query
=
"DELETE FROM object_translation WHERE obj_id= "
.
71
$ilDB
->quote($this->
getId
(),
'integer'
);
72
$res
=
$ilDB
->manipulate(
$query
);
73
}
74
75
// add a new translation to current category
76
public
function
addTranslation
($a_title, $a_desc, $a_lang, $a_lang_default)
77
{
78
$ilDB
=
$this->db
;
79
80
if
(empty($a_title)) {
81
$a_title =
"NO TITLE"
;
82
}
83
84
$query
=
"INSERT INTO object_translation "
.
85
"(obj_id,title,description,lang_code,lang_default) "
.
86
"VALUES "
.
87
"("
.
$ilDB
->quote($this->
getId
(),
'integer'
) .
","
.
88
$ilDB
->quote($a_title,
'text'
) .
","
.
89
$ilDB
->quote($a_desc,
'text'
) .
","
.
90
$ilDB
->quote($a_lang,
'text'
) .
","
.
91
$ilDB
->quote($a_lang_default,
'integer'
) .
")"
;
92
$res
=
$ilDB
->manipulate(
$query
);
93
return
true
;
94
}
95
}
// END class.ObjRootFolder
ilObject2\getId
getId()
Definition:
class.ilObject2.php:47
ilObjWorkspaceRootFolder\initType
initType()
Definition:
class.ilObjWorkspaceRootFolder.php:29
$DIC
global $DIC
Definition:
saml.php:7
ilObjWorkspaceRootFolder\removeTranslations
removeTranslations()
Definition:
class.ilObjWorkspaceRootFolder.php:66
ilObjWorkspaceRootFolder\__construct
__construct($a_id=0, $a_reference=true)
Constructor.
Definition:
class.ilObjWorkspaceRootFolder.php:21
$r
$r
Definition:
example_031.php:79
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilObjWorkspaceRootFolder\addTranslation
addTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
Definition:
class.ilObjWorkspaceRootFolder.php:76
$data
$data
Definition:
test-settings.sample.php:14
ilObjWorkspaceRootFolder
Class ilObjWorkspaceRootFolder.
Definition:
class.ilObjWorkspaceRootFolder.php:15
$query
$query
Definition:
proxy_ylocal.php:13
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilObjWorkspaceRootFolder\getTranslations
getTranslations()
get all translations from this category
Definition:
class.ilObjWorkspaceRootFolder.php:40
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilObject2
Class ilObject2 This is an intermediate progress of ilObject class.
Definition:
class.ilObject2.php:14
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilObject\$db
$db
Definition:
class.ilObject.php:23
Modules
WorkspaceRootFolder
classes
class.ilObjWorkspaceRootFolder.php
Generated on Sat Jan 18 2025 19:01:25 for ILIAS by
1.8.13 (using
Doxyfile
)