34                        "/lm_".$this->lm->getId().
"/srt_tmp";
 
   48                include_once(
"./Modules/LearningModule/exceptions/class.ilLMException.php");
 
   49                if (!is_file($a_file[
"tmp_name"]))
 
   76                include_once(
"./Services/MetaData/classes/class.ilMDLanguageItem.php");
 
   81                foreach ($files as $k => $i)
 
   84                        if ($i[
"type"] == 
"file" && !in_array($k, array(
".", 
"..")))
 
   86                                if (pathinfo($k, PATHINFO_EXTENSION) == 
"srt")
 
   89                                        if (substr($k, strlen($k) - 7, 1) == 
"_")
 
   91                                                $lang = substr($k, strlen($k) - 6, 2);
 
   92                                                if (!in_array(
$lang, $lang_codes))
 
   97                                        $items[] = array(
"filename" => $k, 
"lang" => 
$lang);
 
  104                include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
  105                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  108                foreach ($pages as $page)
 
  112                        foreach ($pg_mobs as $k => $pg_mob)
 
  117                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  118                foreach (
$mobs as $mob)
 
  121                        $mi = $m->getMediaItem(
"Standard");
 
  122                        if ($mi->getLocationType() == 
"LocalFile" && is_int(strpos($mi->getFormat(), 
"video")))
 
  126                                $loc = pathinfo($mi->getLocation(), PATHINFO_FILENAME);
 
  127                                foreach ($items as $i => $item)
 
  129                                        if (substr($item[
"filename"], 0, strlen($loc)) == $loc &&
 
  130                                                substr($item[
"filename"], strlen($loc), 1) == 
"_" &&
 
  131                                                pathinfo($item[
"filename"], PATHINFO_EXTENSION) == 
"srt")
 
  133                                                $l = substr($item[
"filename"], strlen($loc)+1, 2);
 
  134                                                if (in_array(
$l, $lang_codes))
 
  136                                                        $items[$i][
"lang"] = 
$l;
 
  137                                                        $items[$i][
"mob"] = $mob;
 
  138                                                        $items[$i][
"mob_title"] = $m->getTitle();
 
  155                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  157                foreach ($items as $i)
 
  159                        if ($i[
"mob"] > 0 && $i[
"lang"] != 
"")
 
Base exception class for learning modules.
Handler class for multi srt upload in learning modules.
moveMultiSrtFiles()
Move all srt files that could be mapped to media objects.
getMultiSrtUploadDir()
Get directory for multi srt upload.
__construct(ilObjLearningModule $a_lm)
Construcotr.
uploadMultipleSubtitleFile($a_file)
Upload multi srt file.
getMultiSrtFiles()
Get all srt files of srt multi upload.
clearMultiSrtDirectory()
Clear multi feedback directory.
getPageList($lm_id)
static
_getPossibleLanguageCodes()
Class ilObjLearningModule.
static getDataDir()
get data directory (outside webspace)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static makeDirParents($a_dir)
Create a new directory and all parent directories.