50 $this->use_previous_import_ids = $a_val;
63 return array(
"5.1.0",
"4.3.0",
"4.1.0");
66 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
68 return "https://www.ilias.de/xml/Services/MediaObject/" . $a_entity;
71 protected function getTypes(
string $a_entity,
string $a_version): array
74 if ($a_entity ==
"mob") {
81 "Description" =>
"text",
89 "Description" =>
"text",
97 if ($a_entity ==
"mob_media_item") {
104 "MobId" =>
"integer",
105 "Width" =>
"integer",
106 "Height" =>
"integer",
111 "Location" =>
"text",
112 "LocationType" =>
"text",
114 "TextRepresentation" =>
"text" 121 if ($a_entity ==
"mob_mi_map_area") {
122 switch ($a_version) {
131 "LinkType" =>
"text",
136 "TargetFrame" =>
"text",
137 "HighlightMode" =>
"text",
138 "HighlightText" =>
"text" 144 if ($a_entity ==
"mob_mi_parameter") {
145 switch ($a_version) {
166 if (!is_array($a_ids)) {
167 $a_ids = array($a_ids);
171 if ($a_entity ==
"mob") {
172 $this->data = array();
174 switch ($a_version) {
177 foreach ($a_ids as $mob_id) {
179 $this->data[] = array(
"Id" => $mob_id,
188 foreach ($a_ids as $mob_id) {
190 $this->data[] = array(
"Id" => $mob_id,
202 if ($a_entity ==
"mob_media_item") {
203 switch ($a_version) {
208 "caption, nr, purpose, location, location_type, format, text_representation" .
209 " FROM media_item WHERE " .
210 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
218 if ($a_entity ==
"mob_mi_map_area") {
219 switch ($a_version) {
224 " ,shape, coords, link_type, title, href, target, type, target_frame, " .
225 " highlight_mode, highlight_class" .
228 $ilDB->in(
"item_id", $a_ids,
false,
"integer") .
229 " ORDER BY nr",
true,
false) as $r) {
233 if ($r[
"Type"] ==
"RepositoryItem") {
234 $id_arr = explode(
"_", $r[
"Target"]);
241 $r[
"Target"] =
"il_" . $id_arr[1] .
"_" .
$id;
252 if ($a_entity ==
"mob_mi_parameter") {
253 switch ($a_version) {
258 " FROM mob_parameter " .
260 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
272 ?array $a_rec = null,
278 "mob_media_item" => array(
"ids" => $a_rec[
"Id"] ?? null)
281 case "mob_media_item":
283 "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"] ?? null),
284 "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"] ?? null)
295 if ($a_entity ==
"mob") {
300 $a_set[
"Dir"] = $dir;
311 string $a_schema_version
318 $newObj->setType(
"mob");
319 $newObj->setTitle($a_rec[
"Title"]);
320 $newObj->setDescription($a_rec[
"Description"]);
323 $newObj->setImportId($a_rec[
"ImportId"]);
328 $newObj->createDirectory();
330 $this->current_mob = $newObj;
332 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
336 $this->mob_log->debug(
"s:-$source_dir-,t:-$target_dir-");
342 $a_mapping->
addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
346 "0:" . $a_rec[
"Id"] .
":mob",
347 "0:" . $newObj->getId() .
":mob" 351 case "mob_media_item":
354 $mob_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
355 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id) {
362 $newObj->setMobId($mob_id);
363 $newObj->setWidth($a_rec[
"Width"]);
364 $newObj->setHeight($a_rec[
"Height"]);
365 $newObj->setCaption($a_rec[
"Caption"]);
366 $newObj->setNr($a_rec[
"Nr"]);
367 $newObj->setPurpose($a_rec[
"Purpose"]);
368 $newObj->setLocation($a_rec[
"Location"]);
369 $newObj->setLocationType($a_rec[
"LocationType"]);
370 $newObj->setFormat($a_rec[
"Format"]);
371 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
373 $this->current_media_item = $newObj;
375 $a_mapping->
addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
379 case "mob_mi_parameter":
382 $med_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
383 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id) {
388 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
392 case "mob_mi_map_area":
394 $med_id = (
int) $a_mapping->
getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
395 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id) {
402 $map_area->setItemId($med_id);
403 $map_area->setNr($a_rec[
"Nr"]);
404 $map_area->setShape($a_rec[
"Shape"]);
405 $map_area->setCoords($a_rec[
"Coords"]);
406 $map_area->setLinkType($a_rec[
"LinkType"]);
407 $map_area->setTitle($a_rec[
"Title"]);
408 $map_area->setHref($a_rec[
"Href"]);
409 $map_area->setTarget($a_rec[
"Target"]);
410 $map_area->setType($a_rec[
"Type"]);
411 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
412 $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
413 $map_area->setHighlightClass($a_rec[
"HighlightClass"]);
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static _lookupObjId(int $ref_id)
static _lookupImportId(int $obj_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
static _lookupTitle(int $obj_id)
getCurrentInstallationId()
static _lookupDescription(int $obj_id)
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
__construct(Container $dic, ilPlugin $plugin)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
stripTags(array $rec, array $omit_keys=[])
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static insertInstIntoID(string $a_value)
inserts installation id into ILIAS id