/** * @param $testRoot string Root directory for the test * @param $fileName string Name of the uploaded file * @return string Destination path for the uploaded file */ function getFileDestination($testRoot, $fileName) { if (!isVideoFile($fileName)) { // non-video files are simply copied to the test root return $testRoot . "/" . $fileName; } // put each run of video data in it's own directory $testPaths = TestPaths::fromUnderscoreFileName($testRoot, $fileName); // make sure video dir exists $videoDir = $testPaths->videoDir(); if (!is_dir($videoDir)) { mkdir($videoDir, 0777, true); } return getVideoFilePath($testPaths); }
<div id="logo"> <a href="index.php"> <span class="first">Cake</span> <span class="second">Box</span> </a> </div> </header> <section id="content"> <h2><?php echo $pathInfo['filename']; ?> </h2> <?php if (isVideoFile($filePath)) { if (SEEN_MODE_ENABLE) { ?> <div id="popcorn" class="littleh2"> <?php // If file is not marked as "already seen" if (!file_exists("data/" . $pathInfo['basename'])) { ?> <?php echo $lang[LOCAL_LANG]['have_you_finished']; ?> <span class="mark" onclick="markfile('<?php echo addslashes($pathInfo['basename']); ?> ');"><?php
function get_nextnprev($file) { $current_dir = recursive_directory_tree(dirname($file)); $current_file = array_keys($current_dir, $file); $current_file = $current_file[0]; // Si le fichier courant n'est pas le dernier, on a notre $next $next = NULL; if ($current_file != count($current_dir) - 1) { // Si le fichier suivant est bien une vidéo if (isVideoFile($current_dir[$current_file + 1])) { $next = htmlspecialchars(urlencode($current_dir[$current_file + 1])); } } // Si le fichier courant n'est pas le premier, on a notre prev $prev = NULL; if ($current_file != 0) { // Si le fichier précédent est bien une vidéo if (isVideoFile($current_dir[$current_file - 1])) { $prev = htmlspecialchars(urlencode($current_dir[$current_file - 1])); } } return array("prev" => $prev, "next" => $next); }