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());
473 if (is_object($item))
475 $item->setMobId($this->
getId());
477 if ($item->getLocationType() ==
"Reference")
479 $item->extractUrlParameters();
534 $a_web =
true, $a_purpose =
"")
536 if ($a_purpose ==
"")
538 $a_purpose =
"Standard";
551 return $path.
"/data/".CLIENT_ID.
"/mobs/mm_".$a_mob_id.
"/".
$location;
582 $xml =
"<MediaObject>";
583 $xml .=
"<MediaAlias OriginId=\"il__mob_".$this->getId().
"\"/>";
588 $xml .=
"<MediaAliasItem Purpose=\"".$item->getPurpose().
"\">";
591 $width = ($item->getWidth() !=
"")
592 ?
"Width=\"".$item->getWidth().
"\""
594 $height = ($item->getHeight() !=
"")
595 ?
"Height=\"".$item->getHeight().
"\""
597 $halign = ($item->getHAlign() !=
"")
598 ?
"HorizontalAlign=\"".$item->getHAlign().
"\""
600 $xml .=
"<Layout $width $height $halign />";
603 if ($item->getCaption() !=
"")
605 $xml .=
"<Caption Align=\"bottom\">".
606 str_replace(
"&",
"&", $item->getCaption()).
"</Caption>";
610 if ($item->getTextRepresentation() !=
"")
612 $xml .=
"<TextRepresentation>".
613 str_replace(
"&",
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
617 $parameters = $item->getParameters();
618 foreach ($parameters as
$name => $value)
620 $xml .=
"<Parameter Name=\"$name\" Value=\"$value\"/>";
622 $xml .=
"</MediaAliasItem>";
631 $xml =
"<MediaObject Id=\"il__mob_".$this->getId().
"\">";
637 $xml .=
"<MediaItem Purpose=\"".$item->getPurpose().
"\">";
640 $xml.=
"<Location Type=\"".$item->getLocationType().
"\">".
641 $this->
handleAmps($item->getLocation()).
"</Location>";
644 $xml.=
"<Format>".$item->getFormat().
"</Format>";
647 $width = ($item->getWidth() !=
"")
648 ?
"Width=\"".$item->getWidth().
"\""
650 $height = ($item->getHeight() !=
"")
651 ?
"Height=\"".$item->getHeight().
"\""
653 $halign = ($item->getHAlign() !=
"")
654 ?
"HorizontalAlign=\"".$item->getHAlign().
"\""
656 $xml .=
"<Layout $width $height $halign />";
659 if ($item->getCaption() !=
"")
661 $xml .=
"<Caption Align=\"bottom\">".
662 str_replace(
"&",
"&", $item->getCaption()).
"</Caption>";
666 if ($item->getTextRepresentation() !=
"")
668 $xml .=
"<TextRepresentation>".
669 str_replace(
"&",
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
673 $parameters = $item->getParameters();
674 foreach ($parameters as
$name => $value)
676 $xml .=
"<Parameter Name=\"$name\" Value=\"$value\"/>";
678 $xml .= $item->getMapAreasXML();
679 $xml .=
"</MediaItem>";
687 $xml =
"<MediaObject>";
690 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
692 $md2xml->setExportMode(
true);
693 $md2xml->startExport();
694 $xml.= $md2xml->getXML();
700 $xml .=
"<MediaItem Purpose=\"".$item->getPurpose().
"\">";
703 $xml.=
"<Location Type=\"".$item->getLocationType().
"\">".
704 $this->
handleAmps($item->getLocation()).
"</Location>";
707 $xml.=
"<Format>".$item->getFormat().
"</Format>";
710 $width = ($item->getWidth() !=
"")
711 ?
"Width=\"".$item->getWidth().
"\""
713 $height = ($item->getHeight() !=
"")
714 ?
"Height=\"".$item->getHeight().
"\""
716 $halign = ($item->getHAlign() !=
"")
717 ?
"HorizontalAlign=\"".$item->getHAlign().
"\""
719 $xml .=
"<Layout $width $height $halign />";
722 if ($item->getCaption() !=
"")
724 $xml .=
"<Caption Align=\"bottom\">".
725 str_replace(
"&",
"&", $item->getCaption()).
"</Caption>";
729 if ($item->getTextRepresentation() !=
"")
731 $xml .=
"<TextRepresentation>".
732 str_replace(
"&",
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
736 $parameters = $item->getParameters();
737 foreach ($parameters as
$name => $value)
739 $xml .=
"<Parameter Name=\"$name\" Value=\"$value\"/>";
741 $xml .= $item->getMapAreasXML(
true, $a_inst);
742 $xml .=
"</MediaItem>";
746 $xml .=
"</MediaObject>";
755 $a_str = str_replace(
"&",
"&", $a_str);
756 $a_str = str_replace(
"&",
"&", $a_str);
778 $subdir =
"il_".IL_INST_ID.
"_mob_".$this->
getId();
788 $subdir =
"il_".IL_INST_ID.
"_mob_".$this->
getId();
789 $a_target_dir = $a_target_dir.
"/objects/".$subdir;
791 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Modules/LearningModule");
792 $tpl->setCurrentBlock(
"ilMedia");
800 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
802 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
807 $xml.= $pg_obj->getMediaAliasElement($this->
getId());
814 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
815 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
822 $params = array (
'mode' =>
"fullscreen",
'enlarge_path' => $enlarge_path,
823 'link_params' =>
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' =>
"",
824 'ref_id' =>
$_GET[
"ref_id"],
'webspace_path' => $wb_path);
825 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
830 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"../../css/style.css");
831 $tpl->setVariable(
"LOCATION_STYLESHEET",
"../../css/system.css");
832 $tpl->setVariable(
"MEDIA_CONTENT", $output);
833 $output =
$tpl->get();
835 $output = preg_replace(
"/mobs\/mm_(\d+)\/([^\"]+)/i",
"$2",$output);
836 $output = preg_replace(
"/\.\/Services\/MediaObjects\/flash_mp3_player/i",
"../../players",$output);
837 $output = preg_replace(
"/\.\/Services\/MediaObjects\/flash_flv_player/i",
"../../players",$output);
838 $output = preg_replace(
"/file=..\/..\/..\//i",
"file=../objects/".$subdir.
"/",$output);
840 fwrite(fopen($a_target_dir.
'/fullscreen.html',
'w'), $output );
845 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
866 $this->contains_int_link = $a_contains_link;
885 $q =
"DELETE FROM mob_usage WHERE usage_type = ".
886 $ilDB->quote($a_type,
"text").
887 " AND usage_id= ".$ilDB->quote($a_id,
"integer").
888 " AND usage_hist_nr = ".$ilDB->quote($a_usage_hist_nr,
"integer");
889 $ilDB->manipulate($q);
899 $q =
"SELECT * FROM mob_usage WHERE ".
900 "usage_type = ".$ilDB->quote($a_type,
"text").
" AND ".
901 "usage_id = ".$ilDB->quote($a_id,
"integer").
" AND ".
902 "usage_hist_nr = ".$ilDB->quote($a_usage_hist_nr,
"integer");
904 $mob_set = $ilDB->query($q);
905 while($mob_rec = $ilDB->fetchAssoc($mob_set))
909 $mobs[$mob_rec[
"id"]] = $mob_rec[
"id"];
919 function _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr = 0)
923 $q =
"DELETE FROM mob_usage WHERE ".
924 " id = ".$ilDB->quote((
int) $a_mob_id,
"integer").
" AND ".
925 " usage_type = ".$ilDB->quote($a_type,
"text").
" AND ".
926 " usage_id = ".$ilDB->quote((
int) $a_id,
"integer").
" AND ".
927 " usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer");
928 $ilDB->manipulate($q);
929 $q =
"INSERT INTO mob_usage (id, usage_type, usage_id, usage_hist_nr) VALUES".
930 " (".$ilDB->quote((
int) $a_mob_id,
"integer").
",".
931 $ilDB->quote($a_type,
"text").
",".
932 $ilDB->quote((
int) $a_id,
"integer").
",".
933 $ilDB->quote((
int) $a_usage_hist_nr,
"integer").
")";
934 $ilDB->manipulate($q);
944 $q =
"DELETE FROM mob_usage WHERE ".
945 " id = ".$ilDB->quote((
int) $a_mob_id,
"integer").
" AND ".
946 " usage_type = ".$ilDB->quote($a_type,
"text").
" AND ".
947 " usage_id = ".$ilDB->quote((
int) $a_id,
"integer").
" AND ".
948 " usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr,
"integer");
949 $ilDB->manipulate($q);
970 if ($a_include_history)
972 $hist_str =
", usage_hist_nr";
976 $q =
"SELECT DISTINCT usage_type, usage_id".$hist_str.
" FROM mob_usage WHERE id = ".
977 $ilDB->quote($a_id,
"integer");
979 $us_set = $ilDB->query($q);
981 while($us_rec = $ilDB->fetchAssoc($us_set))
984 if(is_int(strpos($us_rec[
"usage_type"],
":")))
986 $us_arr = explode(
":", $us_rec[
"usage_type"]);
995 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1004 $ret[] = array(
"type" => $us_rec[
"usage_type"],
1005 "id" => $us_rec[
"usage_id"],
1006 "hist_nr" => $us_rec[
"usage_hist_nr"]);
1011 $q =
"SELECT DISTINCT mep_id FROM mep_tree JOIN mep_item ON (child = obj_id) WHERE mep_item.foreign_id = ".
1012 $ilDB->quote($a_id,
"integer").
" AND mep_item.type = ".$ilDB->quote(
"mob",
"text");
1013 $us_set = $ilDB->query($q);
1014 while($us_rec = $ilDB->fetchAssoc($us_set))
1016 $ret[] = array(
"type" =>
"mep",
1017 "id" => $us_rec[
"mep_id"]);
1021 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1023 foreach($news_usages as $nu)
1030 $q =
"SELECT DISTINCT mob_id FROM media_item it, map_area area ".
1031 " WHERE area.item_id = it.id ".
1032 " AND area.link_type = ".$ilDB->quote(
"int",
"text").
" ".
1033 " AND area.target = ".$ilDB->quote(
"il__mob_".$a_id,
"text");
1034 $us_set = $ilDB->query($q);
1035 while($us_rec = $ilDB->fetchAssoc($us_set))
1037 $ret[] = array(
"type" =>
"map",
1038 "id" => $us_rec[
"mob_id"]);
1043 foreach ($users as $user)
1045 $ret[] = array(
"type" =>
"clip",
1057 if(is_int(strpos($a_usage[
"type"],
":")))
1059 $us_arr = explode(
":", $a_usage[
"type"]);
1061 $cont_type = $us_arr[0];
1065 $type = $a_usage[
"type"];
1068 $id = $a_usage[
"id"];
1074 if ($cont_type ==
"cat")
1079 if ($cont_type ==
"tst")
1085 if ($cont_type ==
"qpl")
1087 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
1089 if ($qinfo[
"original_id"] > 0)
1091 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
1096 $obj_id = $qinfo[
"obj_fi"];
1105 if ($cont_type ==
"qpl")
1107 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
1109 if ($qinfo[
"original_id"] > 0)
1111 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
1116 $obj_id = $qinfo[
"obj_fi"];
1121 if ($cont_type ==
"lm" || $cont_type ==
"dbk")
1123 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
1128 if ($cont_type ==
"gdf")
1130 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
1131 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1143 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1158 function _resizeImage($a_file, $a_width, $a_height, $a_constrain_prop =
false)
1160 $file_path = pathinfo($a_file);
1161 $location = substr($file_path[
"basename"],0,strlen($file_path[
"basename"]) -
1162 strlen($file_path[
"extension"]) - 1).
"_".
1164 $a_height.
".".$file_path[
"extension"];
1165 $target_file = $file_path[
"dirname"].
"/".
1168 (
int) $a_width, (
int) $a_height, $a_constrain_prop);
1182 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
1219 $a_file, $a_reference, $a_constrain_proportions, $a_use_original,
1220 $a_user_width, $a_user_height)
1225 $width = $a_def_width;
1226 $height = $a_def_height;
1229 if ($a_format ==
"audio/mpeg")
1237 if ($a_type ==
"File")
1239 $size = @getimagesize($a_file);
1243 $size = @getimagesize($a_reference);
1247 if ($a_use_original)
1249 if ($size[0] > 0 && $size[1] > 0)
1256 $info = $lng->txt(
"cont_could_not_determine_resource_size");
1261 $w = (int) $a_user_width;
1262 $h = (int) $a_user_height;
1268 if ($size[0] > 0 && $size[1] > 0)
1272 $wr = $size[0] / $w;
1276 $hr = $size[1] / $h;
1283 $width = (int) ($size[0]/$r);
1284 $height = (int) ($size[1]/$r);
1291 return array(
"width" => $width,
"height" => $height,
"info" => $info);
1299 $types_map = array (
1300 '.a' =>
'application/octet-stream',
1301 '.ai' =>
'application/postscript',
1302 '.aif' =>
'audio/x-aiff',
1303 '.aifc' =>
'audio/x-aiff',
1304 '.aiff' =>
'audio/x-aiff',
1305 '.asd' =>
'application/astound',
1306 '.asf' =>
'video/x-ms-asf',
1307 '.asn' =>
'application/astound',
1308 '.asx' =>
'video/x-ms-asf',
1309 '.au' =>
'audio/basic',
1310 '.avi' =>
'video/x-msvideo',
1311 '.bat' =>
'text/plain',
1312 '.bcpio' =>
'application/x-bcpio',
1313 '.bin' =>
'application/octet-stream',
1314 '.bmp' =>
'image/x-ms-bmp',
1315 '.c' =>
'text/plain',
1316 '.cdf' =>
'application/x-cdf',
1317 '.class' =>
'application/x-java-applet',
1318 '.com' =>
'application/octet-stream',
1319 '.cpio' =>
'application/x-cpio',
1320 '.csh' =>
'application/x-csh',
1321 '.css' =>
'text/css',
1322 '.csv' =>
'text/comma-separated-values',
1323 '.dcr' =>
'application/x-director',
1324 '.dir' =>
'application/x-director',
1325 '.dll' =>
'application/octet-stream',
1326 '.doc' =>
'application/msword',
1327 '.dot' =>
'application/msword',
1328 '.dvi' =>
'application/x-dvi',
1329 '.dwg' =>
'application/acad',
1330 '.dxf' =>
'application/dxf',
1331 '.dxr' =>
'application/x-director',
1332 '.eml' =>
'message/rfc822',
1333 '.eps' =>
'application/postscript',
1334 '.etx' =>
'text/x-setext',
1335 '.exe' =>
'application/octet-stream',
1336 '.flv' =>
'video/x-flv',
1337 '.gif' =>
'image/gif',
1338 '.gtar' =>
'application/x-gtar',
1339 '.gz' =>
'application/gzip',
1340 '.h' =>
'text/plain',
1341 '.hdf' =>
'application/x-hdf',
1342 '.htm' =>
'text/html',
1343 '.html' =>
'text/html',
1344 '.ief' =>
'image/ief',
1345 '.iff' =>
'image/iff',
1346 '.jar' =>
'application/x-java-applet',
1347 '.jpe' =>
'image/jpeg',
1348 '.jpeg' =>
'image/jpeg',
1349 '.jpg' =>
'image/jpeg',
1350 '.js' =>
'application/x-javascript',
1351 '.ksh' =>
'text/plain',
1352 '.latex' =>
'application/x-latex',
1353 '.m1v' =>
'video/mpeg',
1354 '.man' =>
'application/x-troff-man',
1355 '.me' =>
'application/x-troff-me',
1356 '.mht' =>
'message/rfc822',
1357 '.mhtml' =>
'message/rfc822',
1358 '.mid' =>
'audio/x-midi',
1359 '.midi' =>
'audio/x-midi',
1360 '.mif' =>
'application/x-mif',
1361 '.mov' =>
'video/quicktime',
1362 '.movie' =>
'video/x-sgi-movie',
1363 '.mp2' =>
'audio/mpeg',
1364 '.mp3' =>
'audio/mpeg',
1365 '.mpa' =>
'video/mpeg',
1366 '.mpe' =>
'video/mpeg',
1367 '.mpeg' =>
'video/mpeg',
1368 '.mpg' =>
'video/mpeg',
1369 '.mp4' =>
'video/mp4',
1370 '.mv4' =>
'video/mp4',
1371 '.ms' =>
'application/x-troff-ms',
1372 '.nc' =>
'application/x-netcdf',
1373 '.nws' =>
'message/rfc822',
1374 '.o' =>
'application/octet-stream',
1375 '.ogg' =>
'application/ogg',
1376 '.obj' =>
'application/octet-stream',
1377 '.oda' =>
'application/oda',
1378 '.p12' =>
'application/x-pkcs12',
1379 '.p7c' =>
'application/pkcs7-mime',
1380 '.pbm' =>
'image/x-portable-bitmap',
1381 '.pdf' =>
'application/pdf',
1382 '.pfx' =>
'application/x-pkcs12',
1383 '.pgm' =>
'image/x-portable-graymap',
1384 '.php' =>
'application/x-httpd-php',
1385 '.phtml' =>
'application/x-httpd-php',
1386 '.pl' =>
'text/plain',
1387 '.png' =>
'image/png',
1388 '.pnm' =>
'image/x-portable-anymap',
1389 '.pot' =>
'application/vnd.ms-powerpoint',
1390 '.ppa' =>
'application/vnd.ms-powerpoint',
1391 '.ppm' =>
'image/x-portable-pixmap',
1392 '.pps' =>
'application/vnd.ms-powerpoint',
1393 '.ppt' =>
'application/vnd.ms-powerpoint',
1394 '.ps' =>
'application/postscript',
1395 '.psd' =>
'image/psd',
1396 '.pwz' =>
'application/vnd.ms-powerpoint',
1397 '.py' =>
'text/x-python',
1398 '.pyc' =>
'application/x-python-code',
1399 '.pyo' =>
'application/x-python-code',
1400 '.qt' =>
'video/quicktime',
1401 '.ra' =>
'audio/x-pn-realaudio',
1402 '.ram' =>
'application/x-pn-realaudio',
1403 '.ras' =>
'image/x-cmu-raster',
1404 '.rdf' =>
'application/xml',
1405 '.rgb' =>
'image/x-rgb',
1406 '.roff' =>
'application/x-troff',
1407 '.rpm' =>
'audio/x-pn-realaudio-plugin',
1408 '.rtf' =>
'application/rtf',
1409 '.rtx' =>
'text/richtext',
1410 '.sgm' =>
'text/x-sgml',
1411 '.sgml' =>
'text/x-sgml',
1412 '.sh' =>
'application/x-sh',
1413 '.shar' =>
'application/x-shar',
1414 '.sit' =>
'application/x-stuffit',
1415 '.snd' =>
'audio/basic',
1416 '.so' =>
'application/octet-stream',
1417 '.spc' =>
'text/x-speech',
1418 '.src' =>
'application/x-wais-source',
1419 '.sv4cpio'=>
'application/x-sv4cpio',
1420 '.sv4crc' =>
'application/x-sv4crc',
1421 '.svg' =>
'image/svg+xml',
1422 '.swf' =>
'application/x-shockwave-flash',
1423 '.t' =>
'application/x-troff',
1424 '.tar' =>
'application/x-tar',
1425 '.talk' =>
'text/x-speech',
1426 '.tbk' =>
'application/toolbook',
1427 '.tcl' =>
'application/x-tcl',
1428 '.tex' =>
'application/x-tex',
1429 '.texi' =>
'application/x-texinfo',
1430 '.texinfo'=>
'application/x-texinfo',
1431 '.tif' =>
'image/tiff',
1432 '.tiff' =>
'image/tiff',
1433 '.tr' =>
'application/x-troff',
1434 '.tsv' =>
'text/tab-separated-values',
1435 '.tsp' =>
'application/dsptype',
1436 '.txt' =>
'text/plain',
1437 '.ustar' =>
'application',
1438 '.vcf' =>
'text/x-vcard',
1439 '.vox' =>
'audio/voxware',
1440 '.wav' =>
'audio/x-wav',
1441 '.wax' =>
'audio/x-ms-wax',
1442 '.wiz' =>
'application/msword',
1443 '.wm' =>
'video/x-ms-wm',
1444 '.wma' =>
'audio/x-ms-wma',
1445 '.wmd' =>
'video/x-ms-wmd',
1446 '.wml' =>
'text/vnd.wap.wml',
1447 '.wmlc' =>
'application/vnd.wap.wmlc',
1448 '.wmls' =>
'text/vnd.wap.wmlscript',
1449 '.wmlsc' =>
'application/vnd.wap.wmlscriptc',
1450 '.wmv' =>
'video/x-ms-wmv',
1451 '.wmx' =>
'video/x-ms-wmx',
1452 '.wmz' =>
'video/x-ms-wmz',
1453 '.wvx' =>
'video/x-ms-wvx',
1454 '.wrl' =>
'x-world/x-vrml',
1455 '.xbm' =>
'image/x-xbitmap',
1456 '.xla' =>
'application/msexcel',
1457 '.xlb' =>
'application/vnd.ms-excel',
1458 '.xls' =>
'application/msexcel',
1459 '.xml' =>
'text/xml',
1460 '.xpm' =>
'image/x-xpixmap',
1461 '.xsl' =>
'application/xml',
1462 '.xwd' =>
'image/x-xwindowdump',
1463 '.zip' =>
'application/zip');
1474 return array(
"image/x-ms-bmp",
"image/gif",
"image/jpeg",
"image/x-portable-bitmap",
1475 "image/png",
"image/psd",
"image/tiff",
"application/pdf");
1491 $lpath = pathinfo($a_loc);
1492 if ($lpath[
"extension"] ==
"mp3" && $a_format ==
"audio/mpeg")
1496 if ($lpath[
"extension"] ==
"flv")
1510 $media_object->setTitle(
$name);
1511 $media_object->setDescription(
"");
1512 $media_object->create();
1515 $media_object->createDirectory();
1519 $media_object->addMediaItem($media_item);
1520 $media_item->setPurpose(
"Standard");
1529 copy($tmp_name,
$file);
1535 $media_item->setFormat($format);
1537 $media_item->setLocationType(
"LocalFile");
1538 $media_object->setTitle(
$name);
1539 $media_object->setDescription($format);
1543 $size = getimagesize(
$file);
1544 $media_item->setWidth($size[0]);
1545 $media_item->setHeight($size[1]);
1547 $media_item->setHAlign(
"Left");
1550 $media_object->update();
1552 return $media_object;
1562 if (!is_array($a_ignore))
1564 $a_ignore = array();
1570 foreach($med_items as $med_item)
1573 foreach ($int_links as $k => $int_link)
1575 if ($int_link[
"Type"] ==
"MediaObject")
1577 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
1581 if (!in_array($l_id, $linked) &&
1582 !in_array($l_id, $a_ignore))