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 
"./Services/Object/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)
 
  163                 include_once 
'Services/MetaData/classes/class.ilMD.php';
 
  171                                 $md_gen = $md->getGeneral();
 
  173                                 if (is_object($md_gen))
 
  176                                         $this->
setTitle($md_gen->getTitle());
 
  178                                         foreach($md_gen->getDescriptionIds() as 
$id)
 
  180                                                 $md_des = $md_gen->getDescription(
$id);
 
  199                 include_once 
'Services/MetaData/classes/class.ilMDCreator.php';
 
  204                 $md_creator->setTitle($this->
getTitle());
 
  205                 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
 
  207                 $md_creator->setDescriptionLanguage($ilUser->getPref(
'language'));
 
  208                 $md_creator->setKeywordLanguage($ilUser->getPref(
'language'));
 
  209                 $md_creator->setLanguage($ilUser->getPref(
'language'));
 
  210                 $md_creator->create();
 
  220                 include_once(
"Services/MetaData/classes/class.ilMD.php");
 
  221                 include_once(
"Services/MetaData/classes/class.ilMDGeneral.php");
 
  222                 include_once(
"Services/MetaData/classes/class.ilMDDescription.php");
 
  225                 $md_gen =& $md->getGeneral();
 
  226                 $md_gen->setTitle($this->
getTitle());
 
  229                 $md_des_ids =& $md_gen->getDescriptionIds();
 
  230                 if (count($md_des_ids) > 0)
 
  232                         $md_des =& $md_gen->getDescription($md_des_ids[0]);
 
  246                 include_once(
'Services/MetaData/classes/class.ilMD.php');
 
  259                 $this->media_items[] = $a_item;
 
  281             foreach ($this->media_items as $media_item)
 
  283                     if($media_item->getPurpose() == $a_purpose)
 
  297             foreach ($this->media_items as $key => $media_item)
 
  299                         if($media_item->getPurpose() == $a_purpose)
 
  301                                 unset($this->media_items[$key]);
 
  307                 foreach ($this->media_items as $media_item)
 
  310                 $media_item->setMobId($this->
getId());
 
  311                         $media_item->setNr($i);
 
  322                 $this->media_items = array();
 
  328                 for($i=0; $i<count($this->media_items); $i++)
 
  330                         if($this->media_items[$i]->getPurpose() == $a_purpose)
 
  394                 $this->is_alias = $a_is_alias;
 
  404                 return $this->origin_id = $a_id;
 
  429                 $this->import_id = $a_id;
 
  435         function create($a_create_meta_data = 
false, $a_save_media_items = 
true)
 
  439                 if (!$a_create_meta_data)
 
  444                 if ($a_save_media_items)
 
  450                                 $item->setMobId($this->
getId());
 
  480                         if (is_object($item))
 
  482                                 $item->setMobId($this->
getId());
 
  484                                 if ($item->getLocationType() == 
"Reference")
 
  486                                         $item->extractUrlParameters();
 
  505                 if ($ilSetting->get(
"disable_personal_workspace") && !$ilSetting->get(
'user_portfolios'))
 
  510                 $parent_obj_ids = array();
 
  515                                 !in_array($parent_obj_id, $parent_obj_ids))
 
  517                                 $parent_obj_ids[]= $parent_obj_id;
 
  526                 include_once 
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
 
  580                 $a_web = 
true, $a_purpose = 
"")
 
  582                 if ($a_purpose == 
"")
 
  584                         $a_purpose = 
"Standard";
 
  597                 return $path.
"/data/".CLIENT_ID.
"/mobs/mm_".$a_mob_id.
"/".
$location;
 
  625                 $a_subdir = str_replace(
"..", 
"", $a_subdir);
 
  629                         $dir.= 
"/".$a_subdir;
 
  636                         foreach ($entries as $e)
 
  638                                 if (is_file($dir.
"/".$e[
"entry"]) && $e[
"entry"] != 
"." && $e[
"entry"] != 
"..")
 
  640                                         $files[] = $e[
"entry"];
 
  662                                 $xml = 
"<MediaObject>";
 
  663                                 $xml .= 
"<MediaAlias OriginId=\"il__mob_".$this->getId().
"\"/>";
 
  668                                         $xml .= 
"<MediaAliasItem Purpose=\"".$item->getPurpose().
"\">";
 
  671                                         $width = ($item->getWidth() != 
"")
 
  672                                                 ? 
"Width=\"".$item->getWidth().
"\"" 
  674                                         $height = ($item->getHeight() != 
"")
 
  675                                                 ? 
"Height=\"".$item->getHeight().
"\"" 
  677                                         $halign = ($item->getHAlign() != 
"")
 
  678                                                 ? 
"HorizontalAlign=\"".$item->getHAlign().
"\"" 
  680                                         $xml .= 
"<Layout $width $height $halign />";
 
  683                                         if ($item->getCaption() != 
"")
 
  685                                                 $xml .= 
"<Caption Align=\"bottom\">".
 
  686                                                         str_replace(
"&", 
"&", $item->getCaption()).
"</Caption>";
 
  690                                         if ($item->getTextRepresentation() != 
"")
 
  692                                                 $xml .= 
"<TextRepresentation>".
 
  693                                                         str_replace(
"&", 
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
 
  697                                         $parameters = $item->getParameters();
 
  698                                         foreach ($parameters as $name => $value)
 
  700                                                 $xml .= 
"<Parameter Name=\"$name\" Value=\"$value\"/>";
 
  702                                         $xml .= $item->getMapAreasXML();
 
  703                                         $xml .= 
"</MediaAliasItem>";
 
  712                                 $xml = 
"<MediaObject Id=\"il__mob_".$this->getId().
"\">";
 
  719                                         $xml .= 
"<MediaItem Purpose=\"".$item->getPurpose().
"\">";
 
  722                                         $xml.= 
"<Location Type=\"".$item->getLocationType().
"\">".
 
  723                                                 $this->
handleAmps($item->getLocation()).
"</Location>";
 
  726                                         $xml.= 
"<Format>".$item->getFormat().
"</Format>";
 
  729                                         $width = ($item->getWidth() != 
"")
 
  730                                                 ? 
"Width=\"".$item->getWidth().
"\"" 
  732                                         $height = ($item->getHeight() != 
"")
 
  733                                                 ? 
"Height=\"".$item->getHeight().
"\"" 
  735                                         $halign = ($item->getHAlign() != 
"")
 
  736                                                 ? 
"HorizontalAlign=\"".$item->getHAlign().
"\"" 
  738                                         $xml .= 
"<Layout $width $height $halign />";
 
  741                                         if ($item->getCaption() != 
"")
 
  743                                                 $xml .= 
"<Caption Align=\"bottom\">".
 
  744                                                         str_replace(
"&", 
"&", $item->getCaption()).
"</Caption>";
 
  748                                         if ($item->getTextRepresentation() != 
"")
 
  750                                                 $xml .= 
"<TextRepresentation>".
 
  751                                                         str_replace(
"&", 
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
 
  755                                         $parameters = $item->getParameters();
 
  756                                         foreach ($parameters as $name => $value)
 
  758                                                 $xml .= 
"<Parameter Name=\"$name\" Value=\"$value\"/>";
 
  760                                         $xml .= $item->getMapAreasXML();
 
  763                                         if ($item->getPurpose() == 
"Standard")
 
  766                                                 foreach ($srts as $srt)
 
  770                                                         if ($ilUser->getLanguage() != $meta_lang &&
 
  771                                                                 $ilUser->getLanguage() == $srt[
"language"])
 
  773                                                                 $def = 
' Default="true" ';
 
  775                                                         $xml .= 
"<Subtitle File=\"".$srt[
"full_path"].
 
  776                                                                 "\" Language=\"".$srt[
"language"].
"\" ".$def.
"/>";
 
  779                                         $xml .= 
"</MediaItem>";
 
  787                                 $xml = 
"<MediaObject>";
 
  790                                 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
 
  792                                 $md2xml->setExportMode(
true);
 
  793                                 $md2xml->startExport();
 
  794                                 $xml.= $md2xml->getXML();
 
  802                                         $xml .= 
"<MediaItem Purpose=\"".$item->getPurpose().
"\">";
 
  805                                         $xml.= 
"<Location Type=\"".$item->getLocationType().
"\">".
 
  806                                                 $this->
handleAmps($item->getLocation()).
"</Location>";
 
  809                                         $xml.= 
"<Format>".$item->getFormat().
"</Format>";
 
  812                                         $width = ($item->getWidth() != 
"")
 
  813                                                 ? 
"Width=\"".$item->getWidth().
"\"" 
  815                                         $height = ($item->getHeight() != 
"")
 
  816                                                 ? 
"Height=\"".$item->getHeight().
"\"" 
  818                                         $halign = ($item->getHAlign() != 
"")
 
  819                                                 ? 
"HorizontalAlign=\"".$item->getHAlign().
"\"" 
  821                                         $xml .= 
"<Layout $width $height $halign />";
 
  824                                         if ($item->getCaption() != 
"")
 
  826                                                 $xml .= 
"<Caption Align=\"bottom\">".
 
  827                                                         str_replace(
"&", 
"&", $item->getCaption()).
"</Caption>";
 
  831                                         if ($item->getTextRepresentation() != 
"")
 
  833                                                 $xml .= 
"<TextRepresentation>".
 
  834                                                         str_replace(
"&", 
"&", $item->getTextRepresentation()).
"</TextRepresentation>";
 
  838                                         $parameters = $item->getParameters();
 
  839                                         foreach ($parameters as $name => $value)
 
  841                                                 $xml .= 
"<Parameter Name=\"$name\" Value=\"$value\"/>";
 
  843                                         $xml .= $item->getMapAreasXML(
true, $a_inst);
 
  844                                         $xml .= 
"</MediaItem>";
 
  848                 $xml .= 
"</MediaObject>";
 
  857                 $a_str = str_replace(
"&", 
"&", $a_str);
 
  858                 $a_str = str_replace(
"&", 
"&", $a_str);
 
  880                 $subdir = 
"il_".IL_INST_ID.
"_mob_".$this->
getId();
 
  890                 $subdir = 
"il_".IL_INST_ID.
"_mob_".$this->
getId();
 
  891                 $a_target_dir = $a_target_dir.
"/objects/".$subdir;
 
  893                 $tpl = 
new ilTemplate(
"tpl.fullscreen.html", 
true, 
true, 
"Modules/LearningModule");
 
  894                 $tpl->setCurrentBlock(
"ilMedia");
 
  902                 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  904                 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
  909                 $xml.= $pg_obj->getMediaAliasElement($this->
getId());
 
  916                 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
 
  917                 $args = array( 
'/_xml' => $xml, 
'/_xsl' => $xsl );
 
  924                 $params = array (
'mode' => 
"fullscreen", 
'enlarge_path' => $enlarge_path,
 
  925                         'link_params' => 
"ref_id=".
$_GET[
"ref_id"],
'fullscreen_link' => 
"",
 
  926                         'ref_id' => 
$_GET[
"ref_id"], 
'webspace_path' => $wb_path);
 
  927                 $output = 
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",NULL,$args, $params);
 
  932                 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
  933                 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", 
"../../css/style.css");
 
  934                 $tpl->setVariable(
"LOCATION_STYLESHEET", 
"../../css/system.css");
 
  935                 $tpl->setVariable(
"MEDIA_CONTENT", $output);
 
  936                 $output = 
$tpl->get();
 
  938                 $output = preg_replace(
"/mobs\/mm_(\d+)\/([^\"]+)/i",
"$2",$output);
 
  939                 $output = preg_replace(
"/\.\/Services\/MediaObjects\/flash_mp3_player/i",
"../../players",$output);
 
  941                 $output = preg_replace(
"/file=..\/..\/..\//i",
"file=../objects/".$subdir.
"/",$output);
 
  943                 fwrite(fopen($a_target_dir.
'/fullscreen.html',
'w'), $output );
 
  948                 if ($a_tag == 
"Identifier" && $a_param == 
"Entry")
 
  969                 $this->contains_int_link = $a_contains_link;
 
  989                 if ($a_usage_hist_nr !== 
false)
 
  991                         $and_hist = 
" AND usage_hist_nr = ".$ilDB->quote($a_usage_hist_nr, 
"integer");
 
  995                 $set = $ilDB->query(
"SELECT id FROM mob_usage".
 
  996                         " WHERE usage_type = ".$ilDB->quote($a_type, 
"text").
 
  997                         " AND usage_id = ".$ilDB->quote($a_id, 
"integer").
 
  998                         " AND usage_lang = ".$ilDB->quote($a_lang, 
"text").
 
 1000                 while(
$row = $ilDB->fetchAssoc($set))
 
 1002                         $mob_ids[] = 
$row[
"id"];
 
 1005                 $q = 
"DELETE FROM mob_usage WHERE usage_type = ".
 
 1006                         $ilDB->quote($a_type, 
"text").
 
 1007                         " AND usage_id= ".$ilDB->quote($a_id, 
"integer").
 
 1008                         " AND usage_lang = ".$ilDB->quote($a_lang, 
"text").
 
 1010                 $ilDB->manipulate($q);
 
 1012                 foreach($mob_ids as $mob_id)
 
 1025                 $q = 
"SELECT * FROM mob_usage WHERE ".
 
 1026                         "usage_type = ".$ilDB->quote($a_type, 
"text").
" AND ".
 
 1027                         "usage_id = ".$ilDB->quote($a_id, 
"integer").
" AND ".
 
 1028                         "usage_lang = ".$ilDB->quote($a_lang, 
"text").
" AND ".
 
 1029                         "usage_hist_nr = ".$ilDB->quote($a_usage_hist_nr, 
"integer");
 
 1031                 $mob_set = $ilDB->query($q);
 
 1032                 while($mob_rec = $ilDB->fetchAssoc($mob_set))
 
 1036                                 $mobs[$mob_rec[
"id"]] = $mob_rec[
"id"];
 
 1046         function _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr = 0, $a_lang = 
"-")
 
 1050                 $q = 
"DELETE FROM mob_usage WHERE ".
 
 1051                         " id = ".$ilDB->quote((
int) $a_mob_id, 
"integer").
" AND ".
 
 1052                         " usage_type = ".$ilDB->quote($a_type, 
"text").
" AND ".
 
 1053                         " usage_id = ".$ilDB->quote((
int) $a_id, 
"integer").
" AND ".
 
 1054                         " usage_lang = ".$ilDB->quote($a_lang, 
"text").
" AND ".
 
 1055                         " usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr, 
"integer");
 
 1056                 $ilDB->manipulate($q);
 
 1057                 $q = 
"INSERT INTO mob_usage (id, usage_type, usage_id, usage_hist_nr, usage_lang) VALUES".
 
 1058                         " (".$ilDB->quote((
int) $a_mob_id, 
"integer").
",".
 
 1059                         $ilDB->quote($a_type, 
"text").
",".
 
 1060                         $ilDB->quote((
int) $a_id, 
"integer").
",".
 
 1061                         $ilDB->quote((
int) $a_usage_hist_nr, 
"integer").
",".
 
 1062                         $ilDB->quote($a_lang, 
"text").
 
 1064                 $ilDB->manipulate($q);
 
 1072         function _removeUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr = 0, $a_lang = 
"-")
 
 1076                 $q = 
"DELETE FROM mob_usage WHERE ".
 
 1077                         " id = ".$ilDB->quote((
int) $a_mob_id, 
"integer").
" AND ".
 
 1078                         " usage_type = ".$ilDB->quote($a_type, 
"text").
" AND ".
 
 1079                         " usage_id = ".$ilDB->quote((
int) $a_id, 
"integer").
" AND ".
 
 1080                         " usage_lang = ".$ilDB->quote($a_lang, 
"text").
" AND ".
 
 1081                         " usage_hist_nr = ".$ilDB->quote((
int) $a_usage_hist_nr, 
"integer");
 
 1082                 $ilDB->manipulate($q);
 
 1105                 if ($a_include_history)
 
 1107                         $hist_str = 
", usage_hist_nr";
 
 1111                 $q = 
"SELECT DISTINCT usage_type, usage_id, usage_lang".$hist_str.
" FROM mob_usage WHERE id = ".
 
 1112                         $ilDB->quote($a_id, 
"integer");
 
 1114                 if (!$a_include_history)
 
 1116                         $q.= 
" AND usage_hist_nr = ".$ilDB->quote(0, 
"integer");
 
 1119                 $us_set = $ilDB->query($q);
 
 1121                 while($us_rec = $ilDB->fetchAssoc($us_set))
 
 1124                         if(is_int(strpos($us_rec[
"usage_type"], 
":")))
 
 1126                                 $us_arr = explode(
":", $us_rec[
"usage_type"]);
 
 1135                                 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
 1144                                 $ret[] = array(
"type" => $us_rec[
"usage_type"],
 
 1145                                         "id" => $us_rec[
"usage_id"],
 
 1146                                         "lang" => $us_rec[
"usage_lang"],
 
 1147                                         "hist_nr" => $us_rec[
"usage_hist_nr"]);
 
 1152                 $q = 
"SELECT DISTINCT mep_id FROM mep_tree JOIN mep_item ON (child = obj_id) WHERE mep_item.foreign_id = ".
 
 1153                         $ilDB->quote($a_id, 
"integer").
" AND mep_item.type = ".$ilDB->quote(
"mob", 
"text");
 
 1154                 $us_set = $ilDB->query($q);
 
 1155                 while($us_rec = $ilDB->fetchAssoc($us_set))
 
 1157                         $ret[] = array(
"type" => 
"mep",
 
 1158                                 "id" => $us_rec[
"mep_id"]);
 
 1162                 include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
 1164                 foreach($news_usages as $nu)
 
 1171                 $q = 
"SELECT DISTINCT mob_id FROM media_item it, map_area area ".
 
 1172                         " WHERE area.item_id = it.id ".
 
 1173                         " AND area.link_type = ".$ilDB->quote(
"int", 
"text").
" ".
 
 1174                         " AND area.target = ".$ilDB->quote(
"il__mob_".$a_id, 
"text");
 
 1175                 $us_set = $ilDB->query($q);
 
 1176                 while($us_rec = $ilDB->fetchAssoc($us_set))
 
 1178                         $ret[] = array(
"type" => 
"map",
 
 1179                                 "id" => $us_rec[
"mob_id"]);
 
 1184                 foreach ($users as $user)
 
 1186                         $ret[] = array(
"type" => 
"clip",
 
 1200                 if(is_int(strpos($a_usage[
"type"], 
":")))
 
 1202                         $us_arr = explode(
":", $a_usage[
"type"]);
 
 1204                         $cont_type = $us_arr[0];
 
 1208                         $type = $a_usage[
"type"];
 
 1211                 $id = $a_usage[
"id"];
 
 1223                                                 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
 1225                                                 if ($qinfo[
"original_id"] > 0)
 
 1227                                                         include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 1232                                                         $obj_id = $qinfo[
"obj_fi"];             
 
 1238                                                 include_once(
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php");
 
 1242                                                         if ($quest->getOriginalId() > 0)
 
 1244                                                                 $obj_id = $quest->getSurveyId();
 
 1248                                                                 $obj_id = $quest->getObjId(); 
 
 1256                                                 $returned_pk = $a_usage[
'id'];                                  
 
 1258                                                 include_once 
'Modules/Exercise/classes/class.ilObjExercise.php';
 
 1264                                                 $post_pk = $a_usage[
'id'];
 
 1265                                                 include_once 
'Modules/Forum/classes/class.ilForumPost.php';
 
 1266                                                 include_once 
'Modules/Forum/classes/class.ilForum.php';
 
 1268                                                 $frm_pk =  $oPost->getForumId();
 
 1275                                                 $obj_id = $a_usage[
'id'];
 
 1297                                                 include_once(
'./Services/COPage/classes/class.ilPageObject.php');
 
 1303                                                 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
 1305                                                 if ($qinfo[
"original_id"] > 0)
 
 1307                                                         include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 1312                                                         $obj_id = $qinfo[
"obj_fi"];             
 
 1316                                                         include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
 
 1318                                                         if ($pinfo && $pinfo[
"parent_type"] == 
"lm")
 
 1320                                                                 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 1324                                                         if ($pinfo && $pinfo[
"parent_type"] == 
"sahs")
 
 1326                                                                 include_once(
"./Modules/SCORM2004/classes/class.ilSCORM2004Node.php");
 
 1335                                                 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
 
 1341                                                 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
 
 1342                                                 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
 
 1349                                                 include_once 
'Modules/Wiki/classes/class.ilWikiPage.php';
 
 1356                                                 include_once(
'./Services/COPage/classes/class.ilPageObject.php');
 
 1362                                                 include_once 
"Modules/Portfolio/classes/class.ilPortfolioPage.php";                                     
 
 1368                                                 include_once 
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";                                     
 
 1374                                                 include_once(
'./Services/COPage/classes/class.ilPageObject.php');
 
 1401                                 include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
 1416         function _resizeImage($a_file, $a_width, $a_height, $a_constrain_prop = 
false)
 
 1418                 $file_path = pathinfo($a_file);
 
 1419                 $location = substr($file_path[
"basename"],0,strlen($file_path[
"basename"]) -
 
 1420                         strlen($file_path[
"extension"]) - 1).
"_".
 
 1422                         $a_height.
".".$file_path[
"extension"];
 
 1423                 $target_file = $file_path[
"dirname"].
"/".
 
 1426                         (
int) $a_width, (
int) $a_height, $a_constrain_prop);
 
 1440                 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
 
 1449                 $a_file, $a_reference, $a_constrain_proportions, $a_use_original,
 
 1450                 $a_user_width, $a_user_height)
 
 1455                 $width = $a_def_width;
 
 1456                 $height = $a_def_height;
 
 1459                 if ($a_format == 
"audio/mpeg")
 
 1467                         if ($a_type == 
"File")
 
 1469                                 $size = @getimagesize($a_file);
 
 1473                                 $size = @getimagesize($a_reference);
 
 1477                 if ($a_use_original)
 
 1486                                 $info = $lng->txt(
"cont_could_not_determine_resource_size");
 
 1491                         $w = (int) $a_user_width;
 
 1492                         $h = (int) $a_user_height;
 
 1502                                                 $wr = 
$size[0] / $w;
 
 1506                                                 $hr = 
$size[1] / $h;
 
 1513                                                 $width = (int) (
$size[0]/$r);
 
 1514                                                 $height = (int) (
$size[1]/$r);
 
 1521                 return array(
"width" => $width, 
"height" => $height, 
"info" => $info);
 
 1530                 return array(
"image/x-ms-bmp", 
"image/gif", 
"image/jpeg", 
"image/x-portable-bitmap",
 
 1531                         "image/png", 
"image/psd", 
"image/tiff", 
"application/pdf");
 
 1547                 $lpath = pathinfo($a_loc);
 
 1548                 if ($lpath[
"extension"] == 
"mp3" && $a_format == 
"audio/mpeg")
 
 1552                 if ($lpath[
"extension"] == 
"flv")
 
 1556                 if (in_array($a_format, array(
"video/mp4", 
"video/webm")))
 
 1570                 $media_object->setTitle($name);
 
 1571                 $media_object->setDescription(
"");
 
 1572                 $media_object->create();
 
 1575                 $media_object->createDirectory();
 
 1579                 $media_object->addMediaItem($media_item);
 
 1580                 $media_item->setPurpose(
"Standard");
 
 1582                 $file = $mob_dir.
"/".$name;
 
 1589                         copy($tmp_name, 
$file);
 
 1595                 $media_item->setFormat($format);
 
 1597                 $media_item->setLocationType(
"LocalFile");
 
 1598                 $media_object->setTitle($name);
 
 1599                 $media_object->setDescription($format);
 
 1604                         $media_item->setWidth(
$size[0]);
 
 1605                         $media_item->setHeight(
$size[1]);
 
 1607                 $media_item->setHAlign(
"Left");
 
 1610                 $media_object->update();
 
 1612                 return $media_object;
 
 1620                 $a_subdir = str_replace(
"..", 
"", $a_subdir);
 
 1622                 if ($a_subdir != 
"")
 
 1624                         $dir.= 
"/".$a_subdir;
 
 1639                 if (is_file($a_tmp_name) && $a_language != 
"")
 
 1654                 if (!is_dir($srt_dir))
 
 1661                 $srt_files = array();
 
 1662                 foreach ($items as $i)
 
 1664                         if (!in_array($i[
"entry"], array(
".", 
"..")) && $i[
"type"] == 
"file")
 
 1666                                 $name = explode(
".", $i[
"entry"]);
 
 1667                                 if ($name[1] == 
"srt" && substr($name[0], 0, 9) == 
"subtitle_")
 
 1669                                         $srt_files[] = array(
"file" => $i[
"entry"],
 
 1670                                                 "full_path" => 
"srt/".$i[
"entry"], 
"language" => substr($name[0], 9, 2));
 
 1688                         $t_dir.
"/".$a_thumbname, $a_format, $a_size);
 
 1700                 return $t_dir.
"/".$a_thumbname;
 
 1709                 $file = str_replace(
"..", 
"", $a_file);
 
 1725                 if (!is_array($a_ignore))
 
 1727                         $a_ignore = array();
 
 1733                 foreach($med_items as $med_item)
 
 1736                         foreach ($int_links as $k => $int_link)
 
 1738                                 if ($int_link[
"Type"] == 
"MediaObject")
 
 1740                                         include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
 
 1744                                                 if (!in_array($l_id, $linked) && 
 
 1745                                                         !in_array($l_id, $a_ignore))
 
 1763                 $str = $mset->get(
"restricted_file_types");
 
 1764                 $types = explode(
",", $str);
 
 1765                 $suffixes = array();
 
 1766                 if (count($types) > 0)
 
 1768                         foreach ($types as $k => 
$t)
 
 1770                                 if (($s = strtolower(trim(
$t))) != 
"")
 
 1785                 $new_obj->setTitle($this->
getTitle());
 
 1791                         $new_obj->addMediaItem($val);
 
 1794                 $new_obj->create(
false, 
true);
 
 1797                 $new_obj->createDirectory();
 
 1805                 include_once(
"Services/MetaData/classes/class.ilMD.php");
 
 1806                 $md = 
new ilMD(0, $this->
getId(), 
"mob");
 
 1807                 $new_md = $md->cloneMD(0, $new_obj->getId(), 
"mob");
 
 1820                 $pi = pathinfo($a_prevpic[
"name"]);
 
 1821                 $ext = $pi[
"extension"];
 
 1822                 if (in_array($ext, array(
"jpg", 
"jpeg", 
"png")))
 
 1838                 if ($item->getLocationType() == 
"LocalFile" &&
 
 1839                         is_int(strpos($item->getFormat(), 
"image/")))
 
 1843                                 $item->getLocation();
 
 1867                 $ppics = array(
"mob_vpreview.jpg",
 
 1868                         "mob_vpreview.jpeg",
 
 1869                         "mob_vpreview.png");
 
 1870                 foreach ($ppics as $p)
 
 1872                         if (is_file($dir.
"/".$p))
 
 1874                                 if ($a_filename_only)