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"];             
 
 1101                                 if ($cont_type == 
"frm")
 
 1103                                         $post_pk = $a_usage[
'id'];
 
 1104                                         include_once 
'Modules/Forum/classes/class.ilForumPost.php';
 
 1105                                         include_once 
'Modules/Forum/classes/class.ilForum.php';
 
 1107                                         $frm_pk =  $oPost->getForumId();
 
 1112                                 if ($cont_type == 
'frm~')
 
 1114                                         $obj_id = $a_usage[
'id'];
 
 1122                                 if ($cont_type == 
"qpl")
 
 1124                                         include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
 1126                                         if ($qinfo[
"original_id"] > 0)
 
 1128                                                 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 1133                                                 $obj_id = $qinfo[
"obj_fi"];             
 
 1138                                 if ($cont_type == 
"lm" || $cont_type == 
"dbk")
 
 1140                                         include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 1145                                 if ($cont_type == 
"gdf")
 
 1147                                         include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
 1148                                         include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 1154                                 if ($cont_type == 
'wpg')
 
 1156                                         include_once 
'Modules/Wiki/classes/class.ilWikiPage.php';
 
 1161                                 if ($cont_type == 
'sahs')
 
 1164                                         include_once(
'./Services/COPage/classes/class.ilPageObject.php');
 
 1169                                 if (in_array($cont_type, array(
"crs", 
"grp", 
"cat", 
"fold", 
"root")))
 
 1182                                 include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
 1197         function _resizeImage($a_file, $a_width, $a_height, $a_constrain_prop = 
false)
 
 1199                 $file_path = pathinfo($a_file);
 
 1200                 $location = substr($file_path[
"basename"],0,strlen($file_path[
"basename"]) -
 
 1201                         strlen($file_path[
"extension"]) - 1).
"_".
 
 1203                         $a_height.
".".$file_path[
"extension"];
 
 1204                 $target_file = $file_path[
"dirname"].
"/".
 
 1207                         (
int) $a_width, (
int) $a_height, $a_constrain_prop);
 
 1221                 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
 
 1258                 $a_file, $a_reference, $a_constrain_proportions, $a_use_original,
 
 1259                 $a_user_width, $a_user_height)
 
 1264                 $width = $a_def_width;
 
 1265                 $height = $a_def_height;
 
 1268                 if ($a_format == 
"audio/mpeg")
 
 1276                         if ($a_type == 
"File")
 
 1278                                 $size = @getimagesize($a_file);
 
 1282                                 $size = @getimagesize($a_reference);
 
 1286                 if ($a_use_original)
 
 1295                                 $info = $lng->txt(
"cont_could_not_determine_resource_size");
 
 1300                         $w = (int) $a_user_width;
 
 1301                         $h = (int) $a_user_height;
 
 1311                                                 $wr = 
$size[0] / $w;
 
 1315                                                 $hr = 
$size[1] / $h;
 
 1322                                                 $width = (int) (
$size[0]/$r);
 
 1323                                                 $height = (int) (
$size[1]/$r);
 
 1330                 return array(
"width" => $width, 
"height" => $height, 
"info" => $info);
 
 1338                 $types_map = array (
 
 1339                         '.a'      => 
'application/octet-stream',
 
 1340                         '.ai'     => 
'application/postscript',
 
 1341                         '.aif'    => 
'audio/x-aiff',
 
 1342                         '.aifc'   => 
'audio/x-aiff',
 
 1343                         '.aiff'   => 
'audio/x-aiff',
 
 1344                         '.asd'    => 
'application/astound',
 
 1345                         '.asf'    => 
'video/x-ms-asf',
 
 1346                         '.asn'    => 
'application/astound',
 
 1347                         '.asx'    => 
'video/x-ms-asf',
 
 1348                         '.au'     => 
'audio/basic',
 
 1349                         '.avi'    => 
'video/x-msvideo',
 
 1350                         '.bat'    => 
'text/plain',
 
 1351                         '.bcpio'  => 
'application/x-bcpio',
 
 1352                         '.bin'    => 
'application/octet-stream',
 
 1353                         '.bmp'    => 
'image/x-ms-bmp',
 
 1354                         '.c'      => 
'text/plain',
 
 1355                         '.cdf'    => 
'application/x-cdf',
 
 1356                         '.class'  => 
'application/x-java-applet',
 
 1357                         '.com'    => 
'application/octet-stream',
 
 1358                         '.cpio'   => 
'application/x-cpio',
 
 1359                         '.csh'    => 
'application/x-csh',
 
 1360                         '.css'    => 
'text/css',
 
 1361                         '.csv'    => 
'text/comma-separated-values',
 
 1362                         '.dcr'    => 
'application/x-director',
 
 1363                         '.dir'    => 
'application/x-director',
 
 1364                         '.dll'    => 
'application/octet-stream',
 
 1365                         '.doc'    => 
'application/msword',
 
 1366                         '.dot'    => 
'application/msword',
 
 1367                         '.dvi'    => 
'application/x-dvi',
 
 1368                         '.dwg'    => 
'application/acad',
 
 1369                         '.dxf'    => 
'application/dxf',
 
 1370                         '.dxr'    => 
'application/x-director',
 
 1371                         '.eml'    => 
'message/rfc822',
 
 1372                         '.eps'    => 
'application/postscript',
 
 1373                         '.etx'    => 
'text/x-setext',
 
 1374                         '.exe'    => 
'application/octet-stream',
 
 1375                         '.flv'    => 
'video/x-flv',
 
 1376                         '.gif'    => 
'image/gif',
 
 1377                         '.gtar'   => 
'application/x-gtar',
 
 1378                         '.gz'     => 
'application/gzip',
 
 1379                         '.h'      => 
'text/plain',
 
 1380                         '.hdf'    => 
'application/x-hdf',
 
 1381                         '.htm'    => 
'text/html',
 
 1382                         '.html'   => 
'text/html',
 
 1383                         '.ief'    => 
'image/ief',
 
 1384                         '.iff'    => 
'image/iff',
 
 1385                         '.jar'    => 
'application/x-java-applet',
 
 1386                         '.jpe'    => 
'image/jpeg',
 
 1387                         '.jpeg'   => 
'image/jpeg',
 
 1388                         '.jpg'    => 
'image/jpeg',
 
 1389                         '.js'     => 
'application/x-javascript',
 
 1390                         '.ksh'    => 
'text/plain',
 
 1391                         '.latex'  => 
'application/x-latex',
 
 1392                         '.m1v'    => 
'video/mpeg',
 
 1393                         '.man'    => 
'application/x-troff-man',
 
 1394                         '.me'     => 
'application/x-troff-me',
 
 1395                         '.mht'    => 
'message/rfc822',
 
 1396                         '.mhtml'  => 
'message/rfc822',
 
 1397                         '.mid'    => 
'audio/x-midi',
 
 1398                         '.midi'   => 
'audio/x-midi',
 
 1399                         '.mif'    => 
'application/x-mif',
 
 1400                         '.mov'    => 
'video/quicktime',
 
 1401                         '.movie'  => 
'video/x-sgi-movie',
 
 1402                         '.mp2'    => 
'audio/mpeg',
 
 1403                         '.mp3'    => 
'audio/mpeg',
 
 1404                         '.mpa'    => 
'video/mpeg',
 
 1405                         '.mpe'    => 
'video/mpeg',
 
 1406                         '.mpeg'   => 
'video/mpeg',
 
 1407                         '.mpg'    => 
'video/mpeg',
 
 1408                         '.mp4'    => 
'video/mp4',
 
 1409                         '.mv4'    => 
'video/mp4',
 
 1410                         '.ms'     => 
'application/x-troff-ms',
 
 1411                         '.nc'     => 
'application/x-netcdf',
 
 1412                         '.nws'    => 
'message/rfc822',
 
 1413                         '.o'      => 
'application/octet-stream',
 
 1414                         '.ogg'    => 
'application/ogg',
 
 1415                         '.obj'    => 
'application/octet-stream',
 
 1416                         '.oda'    => 
'application/oda',
 
 1417                         '.p12'    => 
'application/x-pkcs12',
 
 1418                         '.p7c'    => 
'application/pkcs7-mime',
 
 1419                         '.pbm'    => 
'image/x-portable-bitmap',
 
 1420                         '.pdf'    => 
'application/pdf',
 
 1421                         '.pfx'    => 
'application/x-pkcs12',
 
 1422                         '.pgm'    => 
'image/x-portable-graymap',
 
 1423                         '.php'    => 
'application/x-httpd-php',
 
 1424                         '.phtml'  => 
'application/x-httpd-php',
 
 1425                         '.pl'     => 
'text/plain',
 
 1426                         '.png'    => 
'image/png',
 
 1427                         '.pnm'    => 
'image/x-portable-anymap',
 
 1428                         '.pot'    => 
'application/vnd.ms-powerpoint',
 
 1429                         '.ppa'    => 
'application/vnd.ms-powerpoint',
 
 1430                         '.ppm'    => 
'image/x-portable-pixmap',
 
 1431                         '.pps'    => 
'application/vnd.ms-powerpoint',
 
 1432                         '.ppt'    => 
'application/vnd.ms-powerpoint',
 
 1433                         '.ps'     => 
'application/postscript',
 
 1434                         '.psd'    => 
'image/psd',
 
 1435                         '.pwz'    => 
'application/vnd.ms-powerpoint',
 
 1436                         '.py'     => 
'text/x-python',
 
 1437                         '.pyc'    => 
'application/x-python-code',
 
 1438                         '.pyo'    => 
'application/x-python-code',
 
 1439                         '.qt'     => 
'video/quicktime',
 
 1440                         '.ra'     => 
'audio/x-pn-realaudio',
 
 1441                         '.ram'    => 
'application/x-pn-realaudio',
 
 1442                         '.ras'    => 
'image/x-cmu-raster',
 
 1443                         '.rdf'    => 
'application/xml',
 
 1444                         '.rgb'    => 
'image/x-rgb',
 
 1445                         '.roff'   => 
'application/x-troff',
 
 1446                         '.rpm'    => 
'audio/x-pn-realaudio-plugin',
 
 1447                         '.rtf'    => 
'application/rtf',
 
 1448                         '.rtx'    => 
'text/richtext',
 
 1449                         '.sgm'    => 
'text/x-sgml',
 
 1450                         '.sgml'   => 
'text/x-sgml',
 
 1451                         '.sh'     => 
'application/x-sh',
 
 1452                         '.shar'   => 
'application/x-shar',
 
 1453                         '.sit'    => 
'application/x-stuffit',
 
 1454                         '.snd'    => 
'audio/basic',
 
 1455                         '.so'     => 
'application/octet-stream',
 
 1456                         '.spc'    => 
'text/x-speech',
 
 1457                         '.src'    => 
'application/x-wais-source',
 
 1458                         '.sv4cpio'=> 
'application/x-sv4cpio',
 
 1459                         '.sv4crc' => 
'application/x-sv4crc',
 
 1460                         '.svg'    => 
'image/svg+xml',
 
 1461                         '.swf'    => 
'application/x-shockwave-flash',
 
 1462                         '.t'      => 
'application/x-troff',
 
 1463                         '.tar'    => 
'application/x-tar',
 
 1464                         '.talk'   => 
'text/x-speech',
 
 1465                         '.tbk'    => 
'application/toolbook',
 
 1466                         '.tcl'    => 
'application/x-tcl',
 
 1467                         '.tex'    => 
'application/x-tex',
 
 1468                         '.texi'   => 
'application/x-texinfo',
 
 1469                         '.texinfo'=> 
'application/x-texinfo',
 
 1470                         '.tif'    => 
'image/tiff',
 
 1471                         '.tiff'   => 
'image/tiff',
 
 1472                         '.tr'     => 
'application/x-troff',
 
 1473                         '.tsv'    => 
'text/tab-separated-values',
 
 1474                         '.tsp'    => 
'application/dsptype',
 
 1475                         '.txt'    => 
'text/plain',
 
 1476                         '.ustar'  => 
'application',
 
 1477                         '.vcf'    => 
'text/x-vcard',
 
 1478                         '.vox'    => 
'audio/voxware',
 
 1479                         '.wav'    => 
'audio/x-wav',
 
 1480                         '.wax'    => 
'audio/x-ms-wax',
 
 1481                         '.wiz'    => 
'application/msword',
 
 1482                         '.wm'     => 
'video/x-ms-wm',
 
 1483                         '.wma'    => 
'audio/x-ms-wma',
 
 1484                         '.wmd'    => 
'video/x-ms-wmd',
 
 1485                         '.wml'    => 
'text/vnd.wap.wml',
 
 1486                         '.wmlc'   => 
'application/vnd.wap.wmlc',
 
 1487                         '.wmls'   => 
'text/vnd.wap.wmlscript',
 
 1488                         '.wmlsc'  => 
'application/vnd.wap.wmlscriptc',
 
 1489                         '.wmv'    => 
'video/x-ms-wmv',
 
 1490                         '.wmx'    => 
'video/x-ms-wmx',
 
 1491                         '.wmz'    => 
'video/x-ms-wmz',
 
 1492                         '.wvx'    => 
'video/x-ms-wvx',
 
 1493                         '.wrl'    => 
'x-world/x-vrml',
 
 1494                         '.xbm'    => 
'image/x-xbitmap',
 
 1495                         '.xla'    => 
'application/msexcel',
 
 1496                         '.xlb'    => 
'application/vnd.ms-excel',
 
 1497                         '.xls'    => 
'application/msexcel',
 
 1498                         '.xml'    => 
'text/xml',
 
 1499                         '.xpm'    => 
'image/x-xpixmap',
 
 1500                         '.xsl'    => 
'application/xml',
 
 1501                         '.xwd'    => 
'image/x-xwindowdump',
 
 1502                         '.zip'    => 
'application/zip');
 
 1513                 return array(
"image/x-ms-bmp", 
"image/gif", 
"image/jpeg", 
"image/x-portable-bitmap",
 
 1514                         "image/png", 
"image/psd", 
"image/tiff", 
"application/pdf");
 
 1530                 $lpath = pathinfo($a_loc);
 
 1531                 if ($lpath[
"extension"] == 
"mp3" && $a_format == 
"audio/mpeg")
 
 1535                 if ($lpath[
"extension"] == 
"flv")
 
 1549                 $media_object->setTitle($name);
 
 1550                 $media_object->setDescription(
"");
 
 1551                 $media_object->create();
 
 1554                 $media_object->createDirectory();
 
 1558                 $media_object->addMediaItem($media_item);
 
 1559                 $media_item->setPurpose(
"Standard");
 
 1561                 $file = $mob_dir.
"/".$name;
 
 1568                         copy($tmp_name, 
$file);
 
 1574                 $media_item->setFormat($format);
 
 1576                 $media_item->setLocationType(
"LocalFile");
 
 1577                 $media_object->setTitle($name);
 
 1578                 $media_object->setDescription($format);
 
 1583                         $media_item->setWidth(
$size[0]);
 
 1584                         $media_item->setHeight(
$size[1]);
 
 1586                 $media_item->setHAlign(
"Left");
 
 1589                 $media_object->update();
 
 1591                 return $media_object;
 
 1601                 if (!is_array($a_ignore))
 
 1603                         $a_ignore = array();
 
 1609                 foreach($med_items as $med_item)
 
 1612                         foreach ($int_links as $k => $int_link)
 
 1614                                 if ($int_link[
"Type"] == 
"MediaObject")
 
 1616                                         include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
 
 1620                                                 if (!in_array($l_id, $linked) && 
 
 1621                                                         !in_array($l_id, $a_ignore))