ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilMD5295Rights.php
Go to the documentation of this file.
1
<?php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
31
include_once
'class.ilMD5295Base.php'
;
32
33
class
ilMD5295Rights
extends
ilMD5295Base
34
{
35
// SET/GET
36
public
function
setCosts
($a_costs)
37
{
38
switch
($a_costs) {
39
case
'Yes'
:
40
case
'No'
:
41
$this->costs = $a_costs;
42
return
true
;
43
44
default
:
45
return
false
;
46
}
47
}
48
public
function
getCosts
()
49
{
50
return
$this->costs;
51
}
52
public
function
setCopyrightAndOtherRestrictions
($a_caor)
53
{
54
switch
($a_caor) {
55
case
'Yes'
:
56
case
'No'
:
57
$this->caor = $a_caor;
58
return
true
;
59
60
default
:
61
return
false
;
62
}
63
}
64
public
function
getCopyrightAndOtherRestrictions
()
65
{
66
return
$this->caor;
67
}
68
public
function
setDescription
($a_description)
69
{
70
$this->description = $a_description;
71
}
72
public
function
getDescription
()
73
{
74
return
$this->description;
75
}
76
public
function
setDescriptionLanguage
(&$lng_obj)
77
{
78
if
(is_object($lng_obj)) {
79
$this->description_language = $lng_obj;
80
}
81
}
82
public
function
&
getDescriptionLanguage
()
83
{
84
return
is_object($this->description_language) ? $this->description_language :
false
;
85
}
86
public
function
getDescriptionLanguageCode
()
87
{
88
return
is_object($this->description_language) ? $this->description_language->getLanguageCode() :
false
;
89
}
90
91
public
function
save
()
92
{
93
global
$DIC
;
94
95
$ilDB
= $DIC[
'ilDB'
];
96
97
$fields = $this->
__getFields
();
98
$fields[
'meta_rights_id'
] = array(
'integer'
,$next_id =
$ilDB
->nextId(
'il_meta_rights'
));
99
100
if
($this->db->insert(
'il_meta_rights'
, $fields)) {
101
$this->
setMetaId
($next_id);
102
return
$this->
getMetaId
();
103
}
104
return
false
;
105
}
106
107
public
function
update
()
108
{
109
global
$DIC
;
110
111
$ilDB
= $DIC[
'ilDB'
];
112
113
if
($this->
getMetaId
()) {
114
if
($this->db->update(
115
'il_meta_rights'
,
116
$this->__getFields(),
117
array(
"meta_rights_id"
=> array(
'integer'
,$this->
getMetaId
()))
118
)) {
119
return
true
;
120
}
121
}
122
return
false
;
123
}
124
125
public
function
delete
()
126
{
127
global
$DIC
;
128
129
$ilDB
= $DIC[
'ilDB'
];
130
131
if
($this->
getMetaId
()) {
132
$query
=
"DELETE FROM il_meta_rights "
.
133
"WHERE meta_rights_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
134
135
$this->db->query(
$query
);
136
137
return
true
;
138
}
139
return
false
;
140
}
141
142
143
public
function
__getFields
()
144
{
145
return
array(
'rbac_id'
=> array(
'integer'
,$this->
getRBACId
()),
146
'obj_id'
=> array(
'integer'
,$this->
getObjId
()),
147
'obj_type'
=> array(
'text'
,$this->
getObjType
()),
148
'costs'
=> array(
'text'
,$this->
getCosts
()),
149
'cpr_and_or'
=> array(
'text'
,$this->
getCopyrightAndOtherRestrictions
()),
150
'description'
=> array(
'text'
,$this->
getDescription
()),
151
'description_language'
=> array(
'text'
,$this->
getDescriptionLanguageCode
()));
152
}
153
154
public
function
read
()
155
{
156
global
$DIC
;
157
158
$ilDB
= $DIC[
'ilDB'
];
159
160
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php'
;
161
162
163
if
($this->
getMetaId
()) {
164
$query
=
"SELECT * FROM il_meta_rights "
.
165
"WHERE meta_rights_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
166
167
168
$res
= $this->db->query(
$query
);
169
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
170
$this->
setRBACId
($row->rbac_id);
171
$this->
setObjId
($row->obj_id);
172
$this->
setObjType
($row->obj_type);
173
$this->
setDescription
($row->description);
174
$this->
setDescriptionLanguage
(
new
ilMD5295LanguageItem
($row->description_language));
175
$this->
setCosts
($row->costs);
176
$this->
setCopyrightAndOtherRestrictions
($row->cpr_and_or);
177
}
178
return
true
;
179
}
180
return
false
;
181
}
182
183
/*
184
* XML Export of all meta data
185
* @param object (xml writer) see class.ilMD52952XML.php
186
*
187
*/
188
public
function
toXML
(&$writer)
189
{
190
$writer->xmlStartTag(
'Rights'
, array(
'Cost'
=> $this->
getCosts
()
191
? $this->
getCosts
()
192
:
'No'
,
193
'CopyrightAndOtherRestrictions'
=> $this->
getCopyrightAndOtherRestrictions
()
194
? $this->
getCopyrightAndOtherRestrictions
()
195
:
'No'
));
196
include_once
'./Services/Migration/DBUpdate_5295/classes/class.ilMD5295CopyrightSelectionEntry.php'
;
197
$writer->xmlElement(
198
'Description'
,
199
array(
'Language'
=> $this->
getDescriptionLanguageCode
()
200
? $this->
getDescriptionLanguageCode
()
201
:
'en'
),
202
ilMD5295CopyrightSelectionEntry::lookupCopyyrightTitle($this->
getDescription
())
203
);
204
$writer->xmlEndTag(
'Rights'
);
205
}
206
215
public
static
function
_lookupDescription
($a_rbac_id, $a_obj_id)
216
{
217
global
$DIC
;
218
219
$ilDB
= $DIC[
'ilDB'
];
220
221
$query
=
"SELECT description FROM il_meta_rights "
.
222
"WHERE rbac_id = "
.
$ilDB
->quote($a_rbac_id,
'integer'
) .
" "
.
223
"AND obj_id = "
.
$ilDB
->quote($a_obj_id,
'integer'
) .
" "
;
224
$res
=
$ilDB
->query(
$query
);
225
$row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
);
226
return
$row->description ? $row->description :
''
;
227
}
228
229
// STATIC
230
public
static
function
_getId
($a_rbac_id, $a_obj_id)
231
{
232
global
$DIC
;
233
234
$ilDB
= $DIC[
'ilDB'
];
235
236
$query
=
"SELECT meta_rights_id FROM il_meta_rights "
.
237
"WHERE rbac_id = "
.
$ilDB
->quote($a_rbac_id,
'integer'
) .
" "
.
238
"AND obj_id = "
.
$ilDB
->quote($a_obj_id,
'integer'
);
239
240
$res
=
$ilDB
->query(
$query
);
241
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
242
return
$row->meta_rights_id;
243
}
244
return
false
;
245
}
246
}
ilMD5295Base\getMetaId
getMetaId()
Definition:
class.ilMD5295Base.php:125
ilMD5295Base\getObjId
getObjId()
Definition:
class.ilMD5295Base.php:105
ilMD5295Base\getRBACId
getRBACId()
Definition:
class.ilMD5295Base.php:97
ilMD5295Base\getObjType
getObjType()
Definition:
class.ilMD5295Base.php:113
ilMD5295Rights\getDescription
getDescription()
Definition:
class.ilMD5295Rights.php:72
ilMD5295Rights\setDescription
setDescription($a_description)
Definition:
class.ilMD5295Rights.php:68
ilMD5295Rights\save
save()
Definition:
class.ilMD5295Rights.php:91
ilMD5295Base\setObjType
setObjType($a_type)
Definition:
class.ilMD5295Base.php:109
ilMD5295Rights\update
update()
Definition:
class.ilMD5295Rights.php:107
ilMD5295Rights\read
read()
Definition:
class.ilMD5295Rights.php:154
ilMD5295Rights\_getId
static _getId($a_rbac_id, $a_obj_id)
Definition:
class.ilMD5295Rights.php:230
ilMD5295Rights\setCosts
setCosts($a_costs)
Definition:
class.ilMD5295Rights.php:36
ilMD5295Rights\__getFields
__getFields()
Definition:
class.ilMD5295Rights.php:143
ilMD5295LanguageItem
Definition:
class.ilMD5295LanguageItem.php:32
ilMD5295Rights\toXML
toXML(&$writer)
Definition:
class.ilMD5295Rights.php:188
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMD5295Base
Definition:
class.ilMD5295Base.php:32
ilMD5295Base\setRBACId
setRBACId($a_id)
Definition:
class.ilMD5295Base.php:93
ilMD5295Base\setObjId
setObjId($a_id)
Definition:
class.ilMD5295Base.php:101
ilMD5295Rights\getDescriptionLanguage
& getDescriptionLanguage()
Definition:
class.ilMD5295Rights.php:82
ilMD5295Rights\setCopyrightAndOtherRestrictions
setCopyrightAndOtherRestrictions($a_caor)
Definition:
class.ilMD5295Rights.php:52
ilMD5295Rights\getDescriptionLanguageCode
getDescriptionLanguageCode()
Definition:
class.ilMD5295Rights.php:86
$query
$query
Definition:
proxy_ylocal.php:13
ilMD5295Rights\setDescriptionLanguage
setDescriptionLanguage(&$lng_obj)
Definition:
class.ilMD5295Rights.php:76
ilMD5295Rights\_lookupDescription
static _lookupDescription($a_rbac_id, $a_obj_id)
Lookup description (copyright)
Definition:
class.ilMD5295Rights.php:215
ilMD5295Rights\getCopyrightAndOtherRestrictions
getCopyrightAndOtherRestrictions()
Definition:
class.ilMD5295Rights.php:64
ilMD5295Rights\getCosts
getCosts()
Definition:
class.ilMD5295Rights.php:48
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
$DIC
$DIC
Definition:
xapitoken.php:46
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:11
ilMD5295Rights
Definition:
class.ilMD5295Rights.php:33
ilMD5295Base\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMD5295Base.php:117
Services
Migration
DBUpdate_5295
classes
class.ilMD5295Rights.php
Generated on Fri Apr 11 2025 20:01:29 for ILIAS by
1.8.13 (using
Doxyfile
)