ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilMediaPoolPage.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once(
"./Services/COPage/classes/class.ilPageObject.php"
);
5
14
class
ilMediaPoolPage
extends
ilPageObject
15
{
21
public
function
getParentType
()
22
{
23
return
"mep"
;
24
}
25
32
public
function
update
($a_validate =
true
, $a_no_history =
false
)
33
{
34
$ilDB
=
$this->db
;
35
parent::update
($a_validate, $a_no_history);
36
37
return
true
;
38
}
39
43
public
function
read
()
44
{
45
$ilDB
=
$this->db
;
46
47
// get co page
48
parent::read();
49
}
50
51
57
public
function
delete
()
58
{
59
$ilDB
=
$this->db
;
60
61
62
// delete internal links information to this page
63
// include_once("./Services/Link/classes/class.ilInternalLink.php");
64
// ilInternalLink::_deleteAllLinksToTarget("mep", $this->getId());
65
66
67
// delete co page
68
parent::delete();
69
70
return
true
;
71
}
72
78
public
static
function
deleteAllPagesOfMediaPool
($a_media_pool_id)
79
{
80
global
$DIC
;
81
82
$ilDB
= $DIC->database();
83
84
// todo
85
/*
86
$query = "SELECT * FROM il_media_pool_page".
87
" WHERE media_pool_id = ".$ilDB->quote($a_media_pool_id, "integer");
88
$set = $ilDB->query($query);
89
90
while($rec = $ilDB->fetchAssoc($set))
91
{
92
$mp_page = new ilMediaPoolPage($rec["id"]);
93
$mp_page->delete();
94
}
95
*/
96
}
97
101
public
static
function
exists
($a_media_pool_id, $a_title)
102
{
103
global
$DIC
;
104
105
$ilDB
= $DIC->database();
106
107
// todo
108
/*
109
110
$query = "SELECT * FROM il_media_pool_page".
111
" WHERE media_pool_id = ".$ilDB->quote($a_media_pool_id, "integer").
112
" AND title = ".$ilDB->quote($a_title, "text");
113
$set = $ilDB->query($query);
114
if($rec = $ilDB->fetchAssoc($set))
115
{
116
return true;
117
}
118
*/
119
return
false
;
120
}
121
125
public
static
function
lookupTitle
($a_page_id)
126
{
127
global
$DIC
;
128
129
$ilDB
= $DIC->database();
130
131
include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php"
);
132
return
ilMediaPoolItem::lookupTitle
($a_page_id);
133
}
134
135
143
public
static
function
_mediaPoolPageExists
($a_media_pool_id, $a_title)
144
{
145
global
$DIC
;
146
147
$ilDB
= $DIC->database();
148
// todo
149
/*
150
$query = "SELECT id FROM il_media_pool_page".
151
" WHERE media_pool_id = ".$ilDB->quote($a_media_pool_id, "integer").
152
" AND title = ".$ilDB->quote($a_title, "text");
153
$set = $ilDB->query($query);
154
155
$pages = array();
156
if ($rec = $ilDB->fetchAssoc($set))
157
{
158
return true;
159
}
160
*/
161
return
false
;
162
}
163
167
public
function
getUsages
($a_incl_hist =
true
)
168
{
169
return
self::lookupUsages($this->
getId
(), $a_incl_hist);
170
}
171
177
public
static
function
lookupUsages
($a_id, $a_incl_hist =
true
)
178
{
179
global
$DIC
;
180
181
$ilDB
= $DIC->database();
182
183
// get usages in pages
184
$q =
"SELECT * FROM page_pc_usage WHERE pc_id = "
.
185
$ilDB
->quote($a_id,
"integer"
) .
186
" AND pc_type = "
.
$ilDB
->quote(
"incl"
,
"text"
);
187
188
if
(!$a_incl_hist) {
189
$q .=
" AND usage_hist_nr = "
.
$ilDB
->quote(0,
"integer"
);
190
}
191
192
$us_set =
$ilDB
->query($q);
193
$ret
= array();
194
while
($us_rec =
$ilDB
->fetchAssoc($us_set)) {
195
$ut =
""
;
196
if
(is_int(strpos($us_rec[
"usage_type"
],
":"
))) {
197
$us_arr = explode(
":"
, $us_rec[
"usage_type"
]);
198
$ut = $us_arr[1];
199
$ct = $us_arr[0];
200
}
201
202
// check whether page exists
203
$skip =
false
;
204
if
($ut ==
"pg"
) {
205
include_once(
"./Services/COPage/classes/class.ilPageObject.php"
);
206
if
(!
ilPageObject::_exists
($ct, $us_rec[
"usage_id"
])) {
207
$skip =
true
;
208
}
209
}
210
211
if
(!$skip) {
212
$ret
[] = array(
"type"
=> $us_rec[
"usage_type"
],
213
"id"
=> $us_rec[
"usage_id"
],
214
"hist_nr"
=> $us_rec[
"usage_hist_nr"
],
215
"lang"
=> $us_rec[
"usage_lang"
]);
216
}
217
}
218
219
// get usages in media pools
220
$q =
"SELECT DISTINCT mep_id FROM mep_tree JOIN mep_item ON (child = obj_id) WHERE mep_item.obj_id = "
.
221
$ilDB
->quote($a_id,
"integer"
) .
" AND mep_item.type = "
.
$ilDB
->quote(
"pg"
,
"text"
);
222
$us_set =
$ilDB
->query($q);
223
while
($us_rec =
$ilDB
->fetchAssoc($us_set)) {
224
$ret
[] = array(
"type"
=>
"mep"
,
225
"id"
=> $us_rec[
"mep_id"
]);
226
}
227
228
return
$ret
;
229
}
230
}
ilPageObject\_exists
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Definition:
class.ilPageObject.php:407
$DIC
global $DIC
Definition:
saml.php:7
ilMediaPoolPage\_mediaPoolPageExists
static _mediaPoolPageExists($a_media_pool_id, $a_title)
Check whether page exists in media pool or not.
Definition:
class.ilMediaPoolPage.php:143
ilMediaPoolPage
Class ilMediaPoolPage.
Definition:
class.ilMediaPoolPage.php:14
ilMediaPoolPage\lookupTitle
static lookupTitle($a_page_id)
Lookup title.
Definition:
class.ilMediaPoolPage.php:125
ilMediaPoolPage\read
read()
Read media_pool data.
Definition:
class.ilMediaPoolPage.php:43
ilMediaPoolPage\deleteAllPagesOfMediaPool
static deleteAllPagesOfMediaPool($a_media_pool_id)
delete media pool page and al related data
Definition:
class.ilMediaPoolPage.php:78
ilPageObject\getId
getId()
Definition:
class.ilPageObject.php:517
ilMediaPoolPage\update
update($a_validate=true, $a_no_history=false)
update object data
Definition:
class.ilMediaPoolPage.php:32
ilPageObject
Class ilPageObject.
Definition:
class.ilPageObject.php:48
ilMediaPoolPage\getUsages
getUsages($a_incl_hist=true)
get all usages of current media object
Definition:
class.ilMediaPoolPage.php:167
ilMediaPoolPage\lookupUsages
static lookupUsages($a_id, $a_incl_hist=true)
Lookup usages of media object.
Definition:
class.ilMediaPoolPage.php:177
ilMediaPoolPage\getParentType
getParentType()
Get parent type.
Definition:
class.ilMediaPoolPage.php:21
League\Flysystem\Adapter\Polyfill\update
update($pash, $contents, Config $config)
ilMediaPoolItem\lookupTitle
static lookupTitle($a_id)
Lookup title.
Definition:
class.ilMediaPoolItem.php:255
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
$ret
$ret
Definition:
parser.php:6
php
ilPageObject\$db
$db
Definition:
class.ilPageObject.php:60
ilMediaPoolPage\exists
static exists($a_media_pool_id, $a_title)
Checks whether a page with given title exists.
Definition:
class.ilMediaPoolPage.php:101
Modules
MediaPool
classes
class.ilMediaPoolPage.php
Generated on Thu Jan 16 2025 19:02:06 for ILIAS by
1.8.13 (using
Doxyfile
)