4 define (
"IL_MODE_ALIAS", 1);
5 define (
"IL_MODE_OUTPUT", 2);
6 define (
"IL_MODE_FULL", 3);
8 require_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
9 include_once
"classes/class.ilObject.php";
40 $this->is_alias =
false;
41 $this->media_items = array();
42 $this->contains_int_link =
false;
49 $this->ilias->raiseError(
"Operation ilObjMedia::setRefId() not allowed.",$this->ilias->error_obj->FATAL);
59 $this->ilias->raiseError(
"Operation ilObjMedia::putInTree() not allowed.",$this->ilias->error_obj->FATAL);
64 $this->ilias->raiseError(
"Operation ilObjMedia::createReference() not allowed.",$this->ilias->error_obj->FATAL);
88 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
89 if (is_int(strpos($a_id,
"_")))
102 if (!($this->
getId() > 0))
109 if (count($usages) == 0)
159 include_once
'Services/MetaData/classes/class.ilMD.php';
167 $md_gen = $md->getGeneral();
169 if (is_object($md_gen))
172 $this->
setTitle($md_gen->getTitle());
174 foreach($md_gen->getDescriptionIds() as
$id)
176 $md_des = $md_gen->getDescription(
$id);
195 include_once
'Services/MetaData/classes/class.ilMDCreator.php';
200 $md_creator->setTitle($this->
getTitle());
201 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
203 $md_creator->setDescriptionLanguage($ilUser->getPref(
'language'));
204 $md_creator->setKeywordLanguage($ilUser->getPref(
'language'));
205 $md_creator->setLanguage($ilUser->getPref(
'language'));
206 $md_creator->create();
216 include_once(
"Services/MetaData/classes/class.ilMD.php");
217 include_once(
"Services/MetaData/classes/class.ilMDGeneral.php");
218 include_once(
"Services/MetaData/classes/class.ilMDDescription.php");
221 $md_gen =& $md->getGeneral();
222 $md_gen->setTitle($this->
getTitle());
225 $md_des_ids =& $md_gen->getDescriptionIds();
226 if (count($md_des_ids) > 0)
228 $md_des =& $md_gen->getDescription($md_des_ids[0]);
242 include_once(
'Services/MetaData/classes/class.ilMD.php');
255 $this->media_items[] =& $a_item;
277 foreach ($this->media_items as $media_item)
279 if($media_item->getPurpose() == $a_purpose)
293 foreach ($this->media_items as
$key => $media_item)
295 if($media_item->getPurpose() == $a_purpose)
297 unset($this->media_items[
$key]);
303 foreach ($this->media_items as $media_item)
306 $media_item->setMobId($this->
getId());
307 $media_item->setNr($i);
318 $this->media_items = array();
324 for($i=0; $i<count($this->media_items); $i++)
326 if($this->media_items[$i]->getPurpose() == $a_purpose)
390 $this->is_alias = $a_is_alias;
400 return $this->origin_id = $a_id;
425 $this->import_id = $a_id;
431 function create($a_upload =
false, $a_save_media_items =
true)
440 if ($a_save_media_items)
446 $item->setMobId($this->
getId());
471 if (is_object($item))
473 $item->setMobId($this->
getId());
475 if ($item->getLocationType() ==
"Reference")
477 $item->extractUrlParameters();
532 $a_web =
true, $a_purpose =
"")
534 if ($a_purpose ==
"")
536 $a_purpose =
"Standard";
549 return $path.
"/data/".CLIENT_ID.
"/mobs/mm_".$a_mob_id.
"/".
$location;
580 $xml =
"<MediaObject>";
581 $xml .=
"<MediaAlias OriginId=\"il__mob_".$this->getId().
"\"/>";
586 $xml .=
"<MediaAliasItem Purpose=\"".$item->getPurpose().
"\">";
589 $width = ($item->getWidth() !=
"")
590 ?
"Width=\"".$item->getWidth().
"\""
592 $height = ($item->getHeight() !=
"")
593 ?
"Height=\"".$item->getHeight().
"\""
595 $halign = ($item->getHAlign() !=
"")
596 ?
"HorizontalAlign=\"".$item->getHAlign().
"\""
598 $xml .=
"<Layout $width $height $halign />";
601 if ($item->getCaption() !=
"")
603 $xml .=
"<Caption Align=\"bottom\">".
604 str_replace(
"&",
"&", $item->getCaption()).
"</Caption>";
608 if ($item->getTextRepresentation() !=
"")
610 $xml .=
"<TextRepresentation>".
611 str_replace(
"&",
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
615 $parameters = $item->getParameters();
616 foreach ($parameters as
$name => $value)
618 $xml .=
"<Parameter Name=\"$name\" Value=\"$value\"/>";
620 $xml .=
"</MediaAliasItem>";
629 $xml =
"<MediaObject Id=\"il__mob_".$this->getId().
"\">";
635 $xml .=
"<MediaItem Purpose=\"".$item->getPurpose().
"\">";
638 $xml.=
"<Location Type=\"".$item->getLocationType().
"\">".
639 $this->
handleAmps($item->getLocation()).
"</Location>";
642 $xml.=
"<Format>".$item->getFormat().
"</Format>";
645 $width = ($item->getWidth() !=
"")
646 ?
"Width=\"".$item->getWidth().
"\""
648 $height = ($item->getHeight() !=
"")
649 ?
"Height=\"".$item->getHeight().
"\""
651 $halign = ($item->getHAlign() !=
"")
652 ?
"HorizontalAlign=\"".$item->getHAlign().
"\""
654 $xml .=
"<Layout $width $height $halign />";
657 if ($item->getCaption() !=
"")
659 $xml .=
"<Caption Align=\"bottom\">".
660 str_replace(
"&",
"&", $item->getCaption()).
"</Caption>";
664 if ($item->getTextRepresentation() !=
"")
666 $xml .=
"<TextRepresentation>".
667 str_replace(
"&",
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
671 $parameters = $item->getParameters();
672 foreach ($parameters as
$name => $value)
674 $xml .=
"<Parameter Name=\"$name\" Value=\"$value\"/>";
676 $xml .= $item->getMapAreasXML();
677 $xml .=
"</MediaItem>";
685 $xml =
"<MediaObject>";
688 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
690 $md2xml->setExportMode(
true);
691 $md2xml->startExport();
692 $xml.= $md2xml->getXML();
698 $xml .=
"<MediaItem Purpose=\"".$item->getPurpose().
"\">";
701 $xml.=
"<Location Type=\"".$item->getLocationType().
"\">".
702 $this->
handleAmps($item->getLocation()).
"</Location>";
705 $xml.=
"<Format>".$item->getFormat().
"</Format>";
708 $width = ($item->getWidth() !=
"")
709 ?
"Width=\"".$item->getWidth().
"\""
711 $height = ($item->getHeight() !=
"")
712 ?
"Height=\"".$item->getHeight().
"\""
714 $halign = ($item->getHAlign() !=
"")
715 ?
"HorizontalAlign=\"".$item->getHAlign().
"\""
717 $xml .=
"<Layout $width $height $halign />";
720 if ($item->getCaption() !=
"")
722 $xml .=
"<Caption Align=\"bottom\">".
723 str_replace(
"&",
"&", $item->getCaption()).
"</Caption>";
727 if ($item->getTextRepresentation() !=
"")
729 $xml .=
"<TextRepresentation>".
730 str_replace(
"&",
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
734 $parameters = $item->getParameters();
735 foreach ($parameters as
$name => $value)
737 $xml .=
"<Parameter Name=\"$name\" Value=\"$value\"/>";
739 $xml .= $item->getMapAreasXML(
true, $a_inst);
740 $xml .=
"</MediaItem>";
744 $xml .=
"</MediaObject>";
753 $a_str = str_replace(
"&",
"&", $a_str);
754 $a_str = str_replace(
"&",
"&", $a_str);
776 $subdir =
"il_".IL_INST_ID.
"_mob_".$this->
getId();
787 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
808 $this->contains_int_link = $a_contains_link;
827 $q =
"DELETE FROM mob_usage WHERE usage_type = ".
828 $ilDB->quote($a_type,
"text").
829 " AND usage_id= ".$ilDB->quote($a_id,
"integer").
830 " AND usage_hist_nr = ".$ilDB->quote($a_usage_hist_nr,
"integer");
831 $ilDB->manipulate(
$q);
841 $q =
"SELECT * FROM mob_usage WHERE ".
842 "usage_type = ".$ilDB->quote($a_type,
"text").
" AND ".
843 "usage_id = ".$ilDB->quote($a_id,
"integer").
" AND ".
844 "usage_hist_nr = ".$ilDB->quote($a_usage_hist_nr,
"integer");
846 $mob_set = $ilDB->query(
$q);
847 while($mob_rec = $ilDB->fetchAssoc($mob_set))
851 $mobs[$mob_rec[
"id"]] = $mob_rec[
"id"];
861 function _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr = 0)
865 $q =
"DELETE FROM mob_usage WHERE ".
866 " id = ".$ilDB->quote((
int) $a_mob_id,
"integer").
" AND ".
867 " usage_type = ".$ilDB->quote($a_type,
"text").
" AND ".
868 " usage_id = ".$ilDB->quote((
int) $a_id,
"integer").
" AND ".
869 " usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer");
870 $ilDB->manipulate(
$q);
871 $q =
"INSERT INTO mob_usage (id, usage_type, usage_id, usage_hist_nr) VALUES".
872 " (".$ilDB->quote((
int) $a_mob_id,
"integer").
",".
873 $ilDB->quote($a_type,
"text").
",".
874 $ilDB->quote((
int) $a_id,
"integer").
",".
875 $ilDB->quote((
int) $a_usage_hist_nr,
"integer").
")";
876 $ilDB->manipulate(
$q);
886 $q =
"DELETE FROM mob_usage WHERE ".
887 " id = ".$ilDB->quote((
int) $a_mob_id,
"integer").
" AND ".
888 " usage_type = ".$ilDB->quote($a_type,
"text").
" AND ".
889 " usage_id = ".$ilDB->quote((
int) $a_id,
"integer").
" AND ".
890 " usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer");
891 $ilDB->manipulate(
$q);
912 if ($a_include_history)
914 $hist_str =
", usage_hist_nr";
918 $q =
"SELECT DISTINCT usage_type, usage_id".$hist_str.
" FROM mob_usage WHERE id = ".
919 $ilDB->quote($a_id,
"integer");
921 $us_set = $ilDB->query(
$q);
923 while($us_rec = $ilDB->fetchAssoc($us_set))
926 if(is_int(strpos($us_rec[
"usage_type"],
":")))
928 $us_arr = explode(
":", $us_rec[
"usage_type"]);
937 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
946 $ret[] = array(
"type" => $us_rec[
"usage_type"],
947 "id" => $us_rec[
"usage_id"],
948 "hist_nr" => $us_rec[
"usage_hist_nr"]);
953 $q =
"SELECT DISTINCT mep_id FROM mep_tree JOIN mep_item ON (child = obj_id) WHERE mep_item.foreign_id = ".
954 $ilDB->quote($a_id,
"integer").
" AND mep_item.type = ".$ilDB->quote(
"mob",
"text");
955 $us_set = $ilDB->query(
$q);
956 while($us_rec = $ilDB->fetchAssoc($us_set))
958 $ret[] = array(
"type" =>
"mep",
959 "id" => $us_rec[
"mep_id"]);
963 include_once(
"./Services/News/classes/class.ilNewsItem.php");
965 foreach($news_usages as $nu)
972 $q =
"SELECT DISTINCT mob_id FROM media_item it, map_area area ".
973 " WHERE area.item_id = it.id ".
974 " AND area.link_type = ".$ilDB->quote(
"int",
"text").
" ".
975 " AND area.target = ".$ilDB->quote(
"il__mob_".$a_id,
"text");
976 $us_set = $ilDB->query(
$q);
977 while($us_rec = $ilDB->fetchAssoc($us_set))
979 $ret[] = array(
"type" =>
"map",
980 "id" => $us_rec[
"mob_id"]);
985 foreach ($users as
$user)
987 $ret[] = array(
"type" =>
"clip",
999 if(is_int(strpos($a_usage[
"type"],
":")))
1001 $us_arr = explode(
":", $a_usage[
"type"]);
1003 $cont_type = $us_arr[0];
1007 $type = $a_usage[
"type"];
1010 $id = $a_usage[
"id"];
1016 if ($cont_type ==
"cat")
1021 if ($cont_type ==
"tst")
1027 if ($cont_type ==
"qpl")
1029 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
1031 if ($qinfo[
"original_id"] > 0)
1033 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
1038 $obj_id = $qinfo[
"obj_fi"];
1043 if ($cont_type ==
"frm")
1045 $post_pk = $a_usage[
'id'];
1046 include_once
'Modules/Forum/classes/class.ilForumPost.php';
1047 include_once
'Modules/Forum/classes/class.ilForum.php';
1049 $frm_pk = $oPost->getForumId();
1054 if ($cont_type ==
'frm~')
1056 $obj_id = $a_usage[
'id'];
1064 if ($cont_type ==
"qpl")
1066 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
1068 if ($qinfo[
"original_id"] > 0)
1070 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
1075 $obj_id = $qinfo[
"obj_fi"];
1080 if ($cont_type ==
"lm" || $cont_type ==
"dbk")
1082 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1087 if ($cont_type ==
"gdf")
1089 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
1090 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1096 if ($cont_type ==
'wpg')
1098 include_once
'Modules/Wiki/classes/class.ilWikiPage.php';
1103 if ($cont_type ==
'sahs')
1106 include_once(
'./Services/COPage/classes/class.ilPageObject.php');
1119 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1134 function _resizeImage($a_file, $a_width, $a_height, $a_constrain_prop =
false)
1136 $file_path = pathinfo($a_file);
1137 $location = substr($file_path[
"basename"],0,strlen($file_path[
"basename"]) -
1138 strlen($file_path[
"extension"]) - 1).
"_".
1140 $a_height.
".".$file_path[
"extension"];
1141 $target_file = $file_path[
"dirname"].
"/".
1144 (
int) $a_width, (
int) $a_height, $a_constrain_prop);
1158 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
1195 $a_file, $a_reference, $a_constrain_proportions, $a_use_original,
1196 $a_user_width, $a_user_height)
1201 $width = $a_def_width;
1202 $height = $a_def_height;
1205 if ($a_format ==
"audio/mpeg")
1213 if ($a_type ==
"File")
1215 $size = @getimagesize($a_file);
1219 $size = @getimagesize($a_reference);
1223 if ($a_use_original)
1232 $info = $lng->txt(
"cont_could_not_determine_resource_size");
1237 $w = (int) $a_user_width;
1238 $h = (int) $a_user_height;
1248 $wr =
$size[0] / $w;
1252 $hr =
$size[1] / $h;
1259 $width = (int) (
$size[0]/$r);
1260 $height = (int) (
$size[1]/$r);
1267 return array(
"width" => $width,
"height" => $height,
"info" => $info);
1275 $types_map = array (
1276 '.a' =>
'application/octet-stream',
1277 '.ai' =>
'application/postscript',
1278 '.aif' =>
'audio/x-aiff',
1279 '.aifc' =>
'audio/x-aiff',
1280 '.aiff' =>
'audio/x-aiff',
1281 '.asd' =>
'application/astound',
1282 '.asf' =>
'video/x-ms-asf',
1283 '.asn' =>
'application/astound',
1284 '.asx' =>
'video/x-ms-asf',
1285 '.au' =>
'audio/basic',
1286 '.avi' =>
'video/x-msvideo',
1287 '.bat' =>
'text/plain',
1288 '.bcpio' =>
'application/x-bcpio',
1289 '.bin' =>
'application/octet-stream',
1290 '.bmp' =>
'image/x-ms-bmp',
1291 '.c' =>
'text/plain',
1292 '.cdf' =>
'application/x-cdf',
1293 '.class' =>
'application/x-java-applet',
1294 '.com' =>
'application/octet-stream',
1295 '.cpio' =>
'application/x-cpio',
1296 '.csh' =>
'application/x-csh',
1297 '.css' =>
'text/css',
1298 '.csv' =>
'text/comma-separated-values',
1299 '.dcr' =>
'application/x-director',
1300 '.dir' =>
'application/x-director',
1301 '.dll' =>
'application/octet-stream',
1302 '.doc' =>
'application/msword',
1303 '.dot' =>
'application/msword',
1304 '.dvi' =>
'application/x-dvi',
1305 '.dwg' =>
'application/acad',
1306 '.dxf' =>
'application/dxf',
1307 '.dxr' =>
'application/x-director',
1308 '.eml' =>
'message/rfc822',
1309 '.eps' =>
'application/postscript',
1310 '.etx' =>
'text/x-setext',
1311 '.exe' =>
'application/octet-stream',
1312 '.flv' =>
'video/x-flv',
1313 '.gif' =>
'image/gif',
1314 '.gtar' =>
'application/x-gtar',
1315 '.gz' =>
'application/gzip',
1316 '.h' =>
'text/plain',
1317 '.hdf' =>
'application/x-hdf',
1318 '.htm' =>
'text/html',
1319 '.html' =>
'text/html',
1320 '.ief' =>
'image/ief',
1321 '.iff' =>
'image/iff',
1322 '.jar' =>
'application/x-java-applet',
1323 '.jpe' =>
'image/jpeg',
1324 '.jpeg' =>
'image/jpeg',
1325 '.jpg' =>
'image/jpeg',
1326 '.js' =>
'application/x-javascript',
1327 '.ksh' =>
'text/plain',
1328 '.latex' =>
'application/x-latex',
1329 '.m1v' =>
'video/mpeg',
1330 '.man' =>
'application/x-troff-man',
1331 '.me' =>
'application/x-troff-me',
1332 '.mht' =>
'message/rfc822',
1333 '.mhtml' =>
'message/rfc822',
1334 '.mid' =>
'audio/x-midi',
1335 '.midi' =>
'audio/x-midi',
1336 '.mif' =>
'application/x-mif',
1337 '.mov' =>
'video/quicktime',
1338 '.movie' =>
'video/x-sgi-movie',
1339 '.mp2' =>
'audio/mpeg',
1340 '.mp3' =>
'audio/mpeg',
1341 '.mpa' =>
'video/mpeg',
1342 '.mpe' =>
'video/mpeg',
1343 '.mpeg' =>
'video/mpeg',
1344 '.mpg' =>
'video/mpeg',
1345 '.mp4' =>
'video/mp4',
1346 '.mv4' =>
'video/mp4',
1347 '.ms' =>
'application/x-troff-ms',
1348 '.nc' =>
'application/x-netcdf',
1349 '.nws' =>
'message/rfc822',
1350 '.o' =>
'application/octet-stream',
1351 '.ogg' =>
'application/ogg',
1352 '.obj' =>
'application/octet-stream',
1353 '.oda' =>
'application/oda',
1354 '.p12' =>
'application/x-pkcs12',
1355 '.p7c' =>
'application/pkcs7-mime',
1356 '.pbm' =>
'image/x-portable-bitmap',
1357 '.pdf' =>
'application/pdf',
1358 '.pfx' =>
'application/x-pkcs12',
1359 '.pgm' =>
'image/x-portable-graymap',
1360 '.php' =>
'application/x-httpd-php',
1361 '.phtml' =>
'application/x-httpd-php',
1362 '.pl' =>
'text/plain',
1363 '.png' =>
'image/png',
1364 '.pnm' =>
'image/x-portable-anymap',
1365 '.pot' =>
'application/vnd.ms-powerpoint',
1366 '.ppa' =>
'application/vnd.ms-powerpoint',
1367 '.ppm' =>
'image/x-portable-pixmap',
1368 '.pps' =>
'application/vnd.ms-powerpoint',
1369 '.ppt' =>
'application/vnd.ms-powerpoint',
1370 '.ps' =>
'application/postscript',
1371 '.psd' =>
'image/psd',
1372 '.pwz' =>
'application/vnd.ms-powerpoint',
1373 '.py' =>
'text/x-python',
1374 '.pyc' =>
'application/x-python-code',
1375 '.pyo' =>
'application/x-python-code',
1376 '.qt' =>
'video/quicktime',
1377 '.ra' =>
'audio/x-pn-realaudio',
1378 '.ram' =>
'application/x-pn-realaudio',
1379 '.ras' =>
'image/x-cmu-raster',
1380 '.rdf' =>
'application/xml',
1381 '.rgb' =>
'image/x-rgb',
1382 '.roff' =>
'application/x-troff',
1383 '.rpm' =>
'audio/x-pn-realaudio-plugin',
1384 '.rtf' =>
'application/rtf',
1385 '.rtx' =>
'text/richtext',
1386 '.sgm' =>
'text/x-sgml',
1387 '.sgml' =>
'text/x-sgml',
1388 '.sh' =>
'application/x-sh',
1389 '.shar' =>
'application/x-shar',
1390 '.sit' =>
'application/x-stuffit',
1391 '.snd' =>
'audio/basic',
1392 '.so' =>
'application/octet-stream',
1393 '.spc' =>
'text/x-speech',
1394 '.src' =>
'application/x-wais-source',
1395 '.sv4cpio'=>
'application/x-sv4cpio',
1396 '.sv4crc' =>
'application/x-sv4crc',
1397 '.svg' =>
'image/svg+xml',
1398 '.swf' =>
'application/x-shockwave-flash',
1399 '.t' =>
'application/x-troff',
1400 '.tar' =>
'application/x-tar',
1401 '.talk' =>
'text/x-speech',
1402 '.tbk' =>
'application/toolbook',
1403 '.tcl' =>
'application/x-tcl',
1404 '.tex' =>
'application/x-tex',
1405 '.texi' =>
'application/x-texinfo',
1406 '.texinfo'=>
'application/x-texinfo',
1407 '.tif' =>
'image/tiff',
1408 '.tiff' =>
'image/tiff',
1409 '.tr' =>
'application/x-troff',
1410 '.tsv' =>
'text/tab-separated-values',
1411 '.tsp' =>
'application/dsptype',
1412 '.txt' =>
'text/plain',
1413 '.ustar' =>
'application',
1414 '.vcf' =>
'text/x-vcard',
1415 '.vox' =>
'audio/voxware',
1416 '.wav' =>
'audio/x-wav',
1417 '.wax' =>
'audio/x-ms-wax',
1418 '.wiz' =>
'application/msword',
1419 '.wm' =>
'video/x-ms-wm',
1420 '.wma' =>
'audio/x-ms-wma',
1421 '.wmd' =>
'video/x-ms-wmd',
1422 '.wml' =>
'text/vnd.wap.wml',
1423 '.wmlc' =>
'application/vnd.wap.wmlc',
1424 '.wmls' =>
'text/vnd.wap.wmlscript',
1425 '.wmlsc' =>
'application/vnd.wap.wmlscriptc',
1426 '.wmv' =>
'video/x-ms-wmv',
1427 '.wmx' =>
'video/x-ms-wmx',
1428 '.wmz' =>
'video/x-ms-wmz',
1429 '.wvx' =>
'video/x-ms-wvx',
1430 '.wrl' =>
'x-world/x-vrml',
1431 '.xbm' =>
'image/x-xbitmap',
1432 '.xla' =>
'application/msexcel',
1433 '.xlb' =>
'application/vnd.ms-excel',
1434 '.xls' =>
'application/msexcel',
1435 '.xml' =>
'text/xml',
1436 '.xpm' =>
'image/x-xpixmap',
1437 '.xsl' =>
'application/xml',
1438 '.xwd' =>
'image/x-xwindowdump',
1439 '.zip' =>
'application/zip');
1450 return array(
"image/x-ms-bmp",
"image/gif",
"image/jpeg",
"image/x-portable-bitmap",
1451 "image/png",
"image/psd",
"image/tiff",
"application/pdf");
1467 $lpath = pathinfo($a_loc);
1468 if ($lpath[
"extension"] ==
"mp3" && $a_format ==
"audio/mpeg")
1472 if ($lpath[
"extension"] ==
"flv")
1486 $media_object->setTitle(
$name);
1487 $media_object->setDescription(
"");
1488 $media_object->create();
1491 $media_object->createDirectory();
1495 $media_object->addMediaItem($media_item);
1496 $media_item->setPurpose(
"Standard");
1505 copy($tmp_name,
$file);
1511 $media_item->setFormat($format);
1513 $media_item->setLocationType(
"LocalFile");
1514 $media_object->setTitle(
$name);
1515 $media_object->setDescription($format);
1520 $media_item->setWidth(
$size[0]);
1521 $media_item->setHeight(
$size[1]);
1523 $media_item->setHAlign(
"Left");
1526 $media_object->update();
1528 return $media_object;
1538 if (!is_array($a_ignore))
1540 $a_ignore = array();
1546 foreach($med_items as $med_item)
1549 foreach ($int_links as $k => $int_link)
1551 if ($int_link[
"Type"] ==
"MediaObject")
1553 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
1557 if (!in_array($l_id, $linked) &&
1558 !in_array($l_id, $a_ignore))